Changeset 1433ecda in mainline for uspace/dist/src
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- uspace/dist/src/c/demos
- Files:
-
- 7 edited
-
edit/search.c (modified) (1 diff)
-
hello/hello.c (modified) (1 diff)
-
tetris/scores.c (modified) (2 diffs)
-
tetris/screen.c (modified) (1 diff)
-
tetris/shapes.c (modified) (1 diff)
-
tetris/tetris.c (modified) (5 diffs)
-
top/top.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/c/demos/edit/search.c
r47b2d7e3 r1433ecda 91 91 search->back_table[table_idx] = pattern_idx; 92 92 table_idx++; 93 } 94 else if (pattern_idx > 0) { 93 } else if (pattern_idx > 0) { 95 94 pattern_idx = search->back_table[pattern_idx]; 96 } 97 else { 95 } else { 98 96 pattern_idx = 0; 99 97 table_idx++; -
uspace/dist/src/c/demos/hello/hello.c
r47b2d7e3 r1433ecda 3 3 #define TERMINATOR '!' 4 4 5 int main(void) { 5 int main(void) 6 { 6 7 /* Prints "hello" to the standard output. */ 7 8 putchar('h'); -
uspace/dist/src/c/demos/tetris/scores.c
r47b2d7e3 r1433ecda 135 135 off = 6; 136 136 137 moveto(10 , 28);138 printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME -i,137 moveto(10, 28); 138 printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME - i, 139 139 "........................................"); 140 140 … … 191 191 192 192 for (j = NUMSPOTS - 2; j > i; j--) 193 copyhiscore(j, j -1);193 copyhiscore(j, j - 1); 194 194 195 195 copyhiscore(i, NUMSPOTS - 1); -
uspace/dist/src/c/demos/tetris/screen.c
r47b2d7e3 r1433ecda 256 256 tc = t % B_COLS; 257 257 258 moveto(tr, 2 *tc);258 moveto(tr, 2 * tc); 259 259 putstr(" "); 260 260 } -
uspace/dist/src/c/demos/tetris/shapes.c
r47b2d7e3 r1433ecda 68 68 69 69 const struct shape shapes[] = { 70 /* 0 */ { 7, 7, { TL, TC, MR }, 0x00aaaa },71 /* 1 */ { 8, 8, { TC, TR, ML }, 0x00aa00 },72 /* 2 */ { 9, 11, { ML, MR, BC }, 0xaa5500 },73 /* 3 */ { 3, 3, { TL, TC, ML }, 0x0000aa },74 /* 4 */ { 12, 14, { ML, BL, MR }, 0xaa00aa },75 /* 5 */ { 15, 17, { ML, BR, MR }, 0xffa500 },76 /* 6 */ { 18, 18, { ML, MR, 2 }, 0xaa0000 }, /* sticks out */77 /* 7 */ { 0, 0, { TC, ML, BL }, 0x00aaaa },78 /* 8 */ { 1, 1, { TC, MR, BR }, 0x00aa00 },79 /* 9 */ { 10, 2, { TC, MR, BC }, 0xaa5500 },80 /* 10 */ { 11, 9, { TC, ML, MR }, 0xaa5500 },81 /* 11 */ { 2, 10, { TC, ML, BC }, 0xaa5500 },82 /* 12 */ { 13, 4, { TC, BC, BR }, 0xaa00aa },83 /* 13 */ { 14, 12, { TR, ML, MR }, 0xaa00aa },84 /* 14 */ { 4, 13, { TL, TC, BC }, 0xaa00aa },85 /* 15 */ { 16, 5, { TR, TC, BC }, 0xffa500 },86 /* 16 */ { 17, 15, { TL, MR, ML }, 0xffa500 },87 /* 17 */ { 5, 16, { TC, BC, BL }, 0xffa500 },88 /* 18 */ { 6, 6, { TC, BC, 2 * B_COLS }, 0xaa0000 } /* sticks out */70 /* 0 */ { 7, 7, { TL, TC, MR }, 0x00aaaa }, 71 /* 1 */ { 8, 8, { TC, TR, ML }, 0x00aa00 }, 72 /* 2 */ { 9, 11, { ML, MR, BC }, 0xaa5500 }, 73 /* 3 */ { 3, 3, { TL, TC, ML }, 0x0000aa }, 74 /* 4 */ { 12, 14, { ML, BL, MR }, 0xaa00aa }, 75 /* 5 */ { 15, 17, { ML, BR, MR }, 0xffa500 }, 76 /* 6 */ { 18, 18, { ML, MR, 2 }, 0xaa0000 }, /* sticks out */ 77 /* 7 */ { 0, 0, { TC, ML, BL }, 0x00aaaa }, 78 /* 8 */ { 1, 1, { TC, MR, BR }, 0x00aa00 }, 79 /* 9 */ { 10, 2, { TC, MR, BC }, 0xaa5500 }, 80 /* 10 */ { 11, 9, { TC, ML, MR }, 0xaa5500 }, 81 /* 11 */ { 2, 10, { TC, ML, BC }, 0xaa5500 }, 82 /* 12 */ { 13, 4, { TC, BC, BR }, 0xaa00aa }, 83 /* 13 */ { 14, 12, { TR, ML, MR }, 0xaa00aa }, 84 /* 14 */ { 4, 13, { TL, TC, BC }, 0xaa00aa }, 85 /* 15 */ { 16, 5, { TR, TC, BC }, 0xffa500 }, 86 /* 16 */ { 17, 15, { TL, MR, ML }, 0xffa500 }, 87 /* 17 */ { 5, 16, { TC, BC, BL }, 0xffa500 }, 88 /* 18 */ { 6, 6, { TC, BC, 2 * B_COLS }, 0xaa0000 } /* sticks out */ 89 89 }; 90 90 -
uspace/dist/src/c/demos/tetris/tetris.c
r47b2d7e3 r1433ecda 52 52 53 53 static volatile const char copyright[] = 54 "@(#) Copyright (c) 1992, 1993\n"55 "\tThe Regents of the University of California. All rights reserved.\n";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) * (B_COLS - 2));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 case 'p':208 showpreview = !showpreview;209 moveto(9, 21);210 if (showpreview)211 printf("on ");212 else213 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;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 /* -
uspace/dist/src/c/demos/top/top.h
r47b2d7e3 r1433ecda 81 81 82 82 typedef enum { 83 FIELD_EMPTY, FIELD_UINT, FIELD_UINT_SUFFIX_BIN, FIELD_UINT_SUFFIX_DEC, 84 FIELD_PERCENT, FIELD_STRING 83 FIELD_EMPTY, 84 FIELD_UINT, 85 FIELD_UINT_SUFFIX_BIN, 86 FIELD_UINT_SUFFIX_DEC, 87 FIELD_PERCENT, 88 FIELD_STRING 85 89 } field_type_t; 86 90
Note:
See TracChangeset
for help on using the changeset viewer.
