]> git.lizzy.rs Git - ttfe.git/commitdiff
Use wasd as control keys
authorElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 7 Jun 2021 10:21:59 +0000 (12:21 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 7 Jun 2021 10:21:59 +0000 (12:21 +0200)
README
main.c

diff --git a/README b/README
index a50c5f1829685ebbd3d4a7e9a8fc4a53eff67267..c54e819c120a6d11dede9f0f0213aa801a0b7cc9 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
 My own toy implementation of 2048 on the command line.
 
-It supports hjkl for movements and q for quit.
+It supports wasd for movements and q for quit.
 
diff --git a/main.c b/main.c
index b72a53154e1d5ee200228c22543d87ed547d9648..913ff9627666168a8d3b437d0888f6730676ff90 100644 (file)
--- a/main.c
+++ b/main.c
@@ -56,16 +56,16 @@ void game_loop(board *b) {
                printf("Make a move:\n");
                fgets(c, sizeof(c), stdin);
                switch(c[0]) {
-                       case 'h':
+                       case 'a':
                                d = west;
                                break;
-                       case 'j':
+                       case 's':
                                d = south;
                                break;
-                       case 'k':
+                       case 'w':
                                d = north;
                                break;
-                       case 'l':
+                       case 'd':
                                d = east;
                                break;
                        case 'q':