|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 8052 (0x1f74) Types: TextFile Names: »mahjongg2.patch1«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/Sun/Mahjongg/mahjongg2.patch1«
*** mahjongg.6 Fri Jul 8 16:33:09 1988 --- mahjongg.6.new Fri Jul 8 16:31:30 1988 *************** *** 44,55 **** Two help features are currently implemented. By selecting the "help" button in the control window when no tiles are selected, you will be shown all available tile combinations. To see each combination press the left mouse button until ! the message "No more moves [DONE] [] []" is shown. To cancel "help" press the right mouse button. If you have selected a tile, pressing the middle mouse button or selecting the "help" button in the control window, will find the first matching tile (if any) starting at the top of the pile and working down. If a match is found, you will be asked to confirm and the pair will be ! removed from the board. .SH UNDO Since some people tend to be a little faster on the mouse then they should be, the undo feature was implemented. The "undo" button replaces the previous --- 44,56 ---- Two help features are currently implemented. By selecting the "help" button in the control window when no tiles are selected, you will be shown all available tile combinations. To see each combination press the left mouse button until ! no more moves are shown. To cancel "help" press the right mouse button. If you have selected a tile, pressing the middle mouse button or selecting the "help" button in the control window, will find the first matching tile (if any) starting at the top of the pile and working down. If a match is found, you will be asked to confirm and the pair will be ! removed from the board. If an alternate match is available pressing the middle ! button labeled "NEXT" will show it. .SH UNDO Since some people tend to be a little faster on the mouse then they should be, the undo feature was implemented. The "undo" button replaces the previous *************** *** 73,86 **** Copyright 1988 Mark A. Holm .br <tektronix!tessi!exc!markh> .SH BUGS If a tile is selected when the game goes iconic it is not drawn as selected ! when the game is re-opened. the board returns to normal after the next icon pair is removed or by pressing undo (backs up one move). .PP Sunview option "-WI iconfile" only works in black and white. .PP ! Board number is not checked very close. If you put something wierd in, you deserve everthing you get. .PP No score file. It is up to you to keep track of who did how well on what board. --- 74,96 ---- Copyright 1988 Mark A. Holm .br <tektronix!tessi!exc!markh> + .SH ACKNOWLEGED CONTRIBUTORS + .nf + .na + Dorothy Robinson (Prime-CV Beaverton) Tiles + Jim Batch (Prime-CV Beaverton) Theory and code help + Gilbert Harrus (Gip-Altair/INRIA) Shuffling algorithm + Jim Flar (??) (Sun) New selection and help + .fi + .ad .SH BUGS If a tile is selected when the game goes iconic it is not drawn as selected ! when the game is re-opened, the board returns to normal after the next icon pair is removed or by pressing undo (backs up one move). .PP Sunview option "-WI iconfile" only works in black and white. .PP ! Board number is not checked very close. If you put something weird in, you deserve everthing you get. .PP No score file. It is up to you to keep track of who did how well on what board. *** mahjongg.c Fri Jul 8 16:32:54 1988 --- mahjongg.c.new Fri Jul 8 13:25:49 1988 *************** *** 17,22 **** --- 17,25 ---- * 1.1 removed non-working reverse video cursor code * added 386 support. * added blank tiles for hidden tiles to stop cheating. + * + * 1.2 incorporated sun fix for panel messages and added new + * shuffling algorithm. */ #ifndef lint *************** *** 62,67 **** --- 65,71 ---- extern void board_num_proc(); extern void play_back_proc(); extern void play_event_proc(); + extern void panel_msg(); extern short stick_image[]; extern int undo_count; *************** *** 779,797 **** /* clear stand_by message and release input mask */ ! panel_set(message, PANEL_SHOW_ITEM, ! FALSE, ! 0); - window_set(message_panel, WIN_CONSUME_PICK_EVENTS, - WIN_MOUSE_BUTTONS, 0, - 0); - window_set(message_panel, WIN_CONSUME_KBD_EVENT, - WIN_ASCII_EVENTS, 0, 0); - - cursor_set(play_cursor, CURSOR_IMAGE, &stick, 0); - window_set(play_panel, WIN_CURSOR, play_cursor, 0); - } void build_image(oldimage) --- 783,790 ---- /* clear stand_by message and release input mask */ ! panel_msg((char *)0, &stick); } void build_image(oldimage) *************** *** 800,809 **** { int i; int j; - int pool[42]; boolean ok; boolean dir; char seed_text[80]; /* initialize selected structures */ --- 793,804 ---- { int i; int j; boolean ok; boolean dir; char seed_text[80]; + int tmp_pool[144]; + int tmp_tiles_left; + int pos; /* initialize selected structures */ *************** *** 836,853 **** /* show stand_by message while building image and grab all input */ ! panel_set(message, PANEL_LABEL_STRING, ! "Building board. Please wait.", ! PANEL_SHOW_ITEM, ! TRUE, 0); - window_set(message_panel, WIN_IGNORE_PICK_EVENTS, - WIN_MOUSE_BUTTONS, 0, 0); - window_set(message_panel, WIN_IGNORE_KBD_EVENT, - WIN_ASCII_EVENTS, 0, 0); - cursor_set(play_cursor, CURSOR_IMAGE, &wait, 0); - window_set(play_panel, WIN_CURSOR, play_cursor, 0); - /* initialize random number counter */ (void) srandom(seed); --- 831,838 ---- /* show stand_by message while building image and grab all input */ ! panel_msg( "Building board. Please wait.", &wait); /* initialize random number counter */ (void) srandom(seed); *************** *** 854,863 **** tile_count = 144; ! /* initialize tile pool */ ! for(i = 0; i < 34; i++) pool[i] = 4; ! for(; i < 42; i++) pool[i] = 1; /* assign values to each location. Board is built from upper left * * to lower right, bottom to top. Exception are left tile for row * * 4pt5 is before rows 4 and 5, and right tiles for row 4.5 are * --- 839,853 ---- tile_count = 144; ! /* initialize tmp_pool */ ! for(j = 0; j < 136; j++) tmp_pool[j] = j/4; /* tiles * 4 */ ! for(j=136; j<144; j++) tmp_pool[j] = j- 102; /* flowers & seasons */ ! /* 136 --> 34 */ ! /* 143 --> 41 */ ! tmp_tiles_left = 144; + + /* assign values to each location. Board is built from upper left * * to lower right, bottom to top. Exception are left tile for row * * 4pt5 is before rows 4 and 5, and right tiles for row 4.5 are * *************** *** 869,896 **** if (!oldimage) { /* not repeating last board */ ! /* Randomly seed index into pool. Randomly * ! * run up or down list until unused tile * ! * is found or end of list. If end of * ! * list reseed and run in opposite * ! * direction in list until unused tile is * ! * found. If beginning of list found, * ! * start over. */ ! ok = FALSE; ! while (ok == FALSE) { ! i = RANDOM(41); ! /* Up, up, up! */ ! dir = random()&01; ! while ((i < 42 || i >=0) && pool[i] == 0) (dir) ? i++ : i--; ! if (i == 42 || i < 0) { /* Thud! Reverse march! */ ! i = RANDOM(41); ! while ((i < 42 || i >= 0) && pool[i] == 0) (dir) ? i-- : i++; ! } ! if (i == 42 || i < 0) continue; /* Missed! try again */ ! pool[i]--; ! ok = TRUE; ! } /* all flowers and all seasons */ --- 859,870 ---- if (!oldimage) { /* not repeating last board */ ! /* Shuffle/pick tile */ ! pos = RANDOM(tmp_tiles_left); ! i= tmp_pool[pos]; ! for(;pos<tmp_tiles_left; pos++) tmp_pool[pos] = tmp_pool[pos+1]; ! tmp_tiles_left--; /* all flowers and all seasons */