Changeset 1433ecda in mainline for uspace/dist/src/c/demos/tetris/tetris.c
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/c/demos/tetris/tetris.c
r47b2d7e3 r1433ecda 52 52 53 53 static volatile const char copyright[] = 54 55 54 "@(#) Copyright (c) 1992, 1993\n" 55 "\tThe Regents of the University of California. All rights reserved.\n"; 56 56 57 57 #include <sys/time.h> … … 122 122 /* This row is to be elided */ 123 123 rows++; 124 memset(&board[base], 0, sizeof(cell) * 124 memset(&board[base], 0, sizeof(cell) *(B_COLS - 2)); 125 125 126 126 scr_update(); … … 185 185 printf("Level = %d (press keys 1 - 9 to change)", level); 186 186 moveto(9, 10); 187 printf("Preview is %s (press 'p' to change)", (showpreview ? "on " : "off"));187 printf("Preview is %s (press 'p' to change)", (showpreview ? "on " : "off")); 188 188 moveto(12, 10); 189 189 printf("Press 'h' to show hiscore table."); … … 204 204 int i = getchar(); 205 205 206 switch (i) {207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 206 switch (i) { 207 case 'p': 208 showpreview = !showpreview; 209 moveto(9, 21); 210 if (showpreview) 211 printf("on "); 212 else 213 printf("off"); 214 break; 215 case 'h': 216 loadscores(); 217 showscores(firstgame); 218 tetris_menu_draw(*level); 219 break; 220 case 's': 221 firstgame = 0; 222 return 1; 223 case 'q': 224 return 0; 225 case '1': 226 case '2': 227 case '3': 228 case '4': 229 case '5': 230 case '6': 231 case '7': 232 case '8': 233 case '9': 234 *level = i - '0'; 235 moveto(8, 18); 236 printf("%d", *level); 237 break; 238 238 } 239 239 } … … 259 259 260 260 while ((ch = getopt(argc, argv, "ck:ps")) != -1) 261 switch (ch) {261 switch (ch) { 262 262 case 'c': 263 263 /*
Note:
See TracChangeset
for help on using the changeset viewer.