home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume15 / scrbble2 / patch1 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  24.9 KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v15i009:  scrabble2 - another version of the crossword-puzzle board game, Patch1
  5. Message-ID: <3813@master.CNA.TEK.COM>
  6. Date: 26 Oct 92 16:26:33 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 860
  9. Approved: billr@saab.CNA.TEK.COM
  10. Xref: uunet comp.sources.games:1508
  11.  
  12. Submitted-by: jac@doe.carleton.ca (James A. Cherry)
  13. Posting-number: Volume 15, Issue 9
  14. Archive-name: scrabble2/Patch1
  15. Patch-To: scrabble2: Volume 14, Issue 92-111
  16. Environment: curses
  17.  
  18. [From the author...]
  19.     [[Here are a set of updates for scrabble V1.21 to V1.30
  20.     A list of people who suggested changes to scrabble, followed by my
  21.     responses to them is in the CHANGES file.]]
  22.  
  23. #! /bin/sh
  24. # This is a shell archive.  Remove anything before this line, then unpack
  25. # it by saving it into a file and typing "sh file".  To overwrite existing
  26. # files, type "sh file -c".  You can also feed this as standard input via
  27. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  28. # will see the following message at the end:
  29. #        "End of shell archive."
  30. # Contents:  patches01
  31. # Wrapped by billr@saab on Mon Oct 26 08:23:27 1992
  32. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  33. if test -f 'patches01' -a "${1}" != "-c" ; then 
  34.   echo shar: Will not clobber existing file \"'patches01'\"
  35. else
  36. echo shar: Extracting \"'patches01'\" \(22997 characters\)
  37. sed "s/^X//" >'patches01' <<'END_OF_FILE'
  38. X*** cmove.c.orig    Sun Jul 26 11:20:23 1992
  39. X--- cmove.c    Mon Oct 26 08:17:37 1992
  40. X***************
  41. X*** 231,237 ****
  42. X--- 231,241 ----
  43. X                          tile++;
  44. X                      if( blank > oldbl && tile > 0 ) {
  45. X                          oldbl = blank;
  46. X+ #ifdef DBLSIZE_BOARD
  47. X+                         move( BOARD_UY + sy - 1, BOARD_LX + sx * 2 - 2 );
  48. X+ #else
  49. X                          move( BOARD_UY + sy - 1, BOARD_LX + sx - 1 );
  50. X+ #endif
  51. X                          refresh();
  52. X                          try_tiles( sx, sy, blank, dir );
  53. X                      }
  54. X*** misc.c.orig    Tue Sep 22 11:21:51 1992
  55. X--- misc.c    Mon Oct 26 08:17:38 1992
  56. X***************
  57. X*** 61,68 ****
  58. X              }
  59. X          }
  60. X          if( rlen > tlen ) {
  61. X              tlen = rlen;
  62. X-             wlen[tlen] = wr;
  63. X          }
  64. X          strcpy( &words[pt], inp );
  65. X          wptr[wr++] = pt;
  66. X--- 61,68 ----
  67. X              }
  68. X          }
  69. X          if( rlen > tlen ) {
  70. X+             for( i = tlen + 1; i <= rlen; i++ ) wlen[i] = wr;
  71. X              tlen = rlen;
  72. X          }
  73. X          strcpy( &words[pt], inp );
  74. X          wptr[wr++] = pt;
  75. X***************
  76. X*** 69,76 ****
  77. X          pt += rlen + 1;
  78. X          strcpy( tinp, inp );
  79. X      }
  80. X      dict_size = pt;
  81. X!     wlen[16] = wr;
  82. X      fclose( fp );
  83. X  }
  84. X  
  85. X--- 69,78 ----
  86. X          pt += rlen + 1;
  87. X          strcpy( tinp, inp );
  88. X      }
  89. X+     words[pt] = '\0';
  90. X+     wptr[wr] = pt;
  91. X      dict_size = pt;
  92. X!     for( i = tlen + 1; i < 17; i++ ) wlen[i] = wr;
  93. X      fclose( fp );
  94. X  }
  95. X  
  96. X***************
  97. X*** 111,119 ****
  98. X  print_board() {
  99. X      int i, j;
  100. X  
  101. X      for( i = 1; i < 16; i++ ) {
  102. X-         move( BOARD_UY + i - 1, BOARD_LX );
  103. X          for( j = 1; j < 16; j++ ) {
  104. X              if( board[i][j] >= 'A' ) standout();
  105. X              if( ( i == b1y && j == b1x ) || ( i == b2y && j == b2x ) )
  106. X                  addch( board[i][j] - 'A' + 'a' );
  107. X--- 113,126 ----
  108. X  print_board() {
  109. X      int i, j;
  110. X  
  111. X+     clear_rect( BOARD_UY, BOARD_LX, BOARD_LY, BOARD_RX );
  112. X      for( i = 1; i < 16; i++ ) {
  113. X          for( j = 1; j < 16; j++ ) {
  114. X+ #ifdef DBLSIZE_BOARD
  115. X+             move( BOARD_UY + i - 1, BOARD_LX + j * 2 - 2 );
  116. X+ #else
  117. X+             move( BOARD_UY + i - 1, BOARD_LX + j - 1 );
  118. X+ #endif
  119. X              if( board[i][j] >= 'A' ) standout();
  120. X              if( ( i == b1y && j == b1x ) || ( i == b2y && j == b2x ) )
  121. X                  addch( board[i][j] - 'A' + 'a' );
  122. X***************
  123. X*** 129,143 ****
  124. X      int i, j;
  125. X  
  126. X      clear_rect( TILE_RACKS_Y, TILE_RACKS_X,
  127. X!                   TILE_RACKS_Y + 7, TILE_RACKS_X + 24 );
  128. X      for( i = 0; i < players; i++ ) {
  129. X          move( TILE_RACKS_Y + i * 3, TILE_RACKS_X - 4 );
  130. X          if( plr_skills[i] != 0 ) printw( "(%d)", plr_skills[i] );
  131. X!         move( TILE_RACKS_Y + i * 3, TILE_RACKS_X );
  132. X          if( i == human_player )
  133. X!             printw( "Your tiles:" );
  134. X          else
  135. X!             printw( "%s tiles:", you[i] );
  136. X          for( j = 0; j < 7; j++ ) {
  137. X              addch( ' ' );
  138. X              if( plr_tiles[i][j] > 0 ) {
  139. X--- 136,150 ----
  140. X      int i, j;
  141. X  
  142. X      clear_rect( TILE_RACKS_Y, TILE_RACKS_X,
  143. X!                   TILE_RACKS_Y + 7, TILE_RACKS_X + 19 );
  144. X      for( i = 0; i < players; i++ ) {
  145. X          move( TILE_RACKS_Y + i * 3, TILE_RACKS_X - 4 );
  146. X          if( plr_skills[i] != 0 ) printw( "(%d)", plr_skills[i] );
  147. X!         move( TILE_RACKS_Y + i * 3, TILE_RACKS_X + 1 );
  148. X          if( i == human_player )
  149. X!             printw( " You:" );
  150. X          else
  151. X!             printw( "%s:", you[i] );
  152. X          for( j = 0; j < 7; j++ ) {
  153. X              addch( ' ' );
  154. X              if( plr_tiles[i][j] > 0 ) {
  155. X***************
  156. X*** 150,156 ****
  157. X  #endif
  158. X              } else addch( ' ' );
  159. X          }
  160. X!         move( TILE_RACKS_Y + i * 3 + 1, TILE_RACKS_X + 5 );
  161. X          printw( "Score: %3d", plr_scores[i] );
  162. X      }
  163. X      move( TILE_RACKS_Y + 12, TILE_RACKS_X - 2 );
  164. X--- 157,163 ----
  165. X  #endif
  166. X              } else addch( ' ' );
  167. X          }
  168. X!         move( TILE_RACKS_Y + i * 3 + 1, TILE_RACKS_X );
  169. X          printw( "Score: %3d", plr_scores[i] );
  170. X      }
  171. X      move( TILE_RACKS_Y + 12, TILE_RACKS_X - 2 );
  172. X***************
  173. X*** 157,169 ****
  174. X      i = 0;
  175. X      if( b1x != 0 ) i++;
  176. X      if( b2x != 0 ) i++;
  177. X!     printw( "Blank tiles placed so far: %d", i );
  178. X      if( b1x != 0 ) {
  179. X!         move( TILE_RACKS_Y + 13, TILE_RACKS_X + 3 );
  180. X          printw( "Row %2d, Column %2d (%c)", b1y, b1x, board[b1y][b1x] );
  181. X      }
  182. X      if( b2x != 0 ) {
  183. X!         move( TILE_RACKS_Y + 14, TILE_RACKS_X + 3 );
  184. X          printw( "Row %2d, Column %2d (%c)", b2y, b2x, board[b2y][b2x] );
  185. X      }
  186. X      move( TILE_RACKS_Y + human_player * 3, TILE_RACKS_X - 1 );
  187. X--- 164,176 ----
  188. X      i = 0;
  189. X      if( b1x != 0 ) i++;
  190. X      if( b2x != 0 ) i++;
  191. X!     printw( "Blank tiles placed: %d", i );
  192. X      if( b1x != 0 ) {
  193. X!         move( TILE_RACKS_Y + 13, TILE_RACKS_X - 1 );
  194. X          printw( "Row %2d, Column %2d (%c)", b1y, b1x, board[b1y][b1x] );
  195. X      }
  196. X      if( b2x != 0 ) {
  197. X!         move( TILE_RACKS_Y + 14, TILE_RACKS_X - 1 );
  198. X          printw( "Row %2d, Column %2d (%c)", b2y, b2x, board[b2y][b2x] );
  199. X      }
  200. X      move( TILE_RACKS_Y + human_player * 3, TILE_RACKS_X - 1 );
  201. X***************
  202. X*** 187,201 ****
  203. X              break;
  204. X      }
  205. X      tiles_left[i]--;
  206. X!     print_tiles_left( tleft - 1 );
  207. X      return( i == 26 ? CH_BL : i + 'A' );
  208. X  }
  209. X  
  210. X! print_tiles_left( t )
  211. X!   int t;
  212. X! {
  213. X      move( TILES_LEFT_Y, TILES_LEFT_X );
  214. X!     printw( "Tiles left to draw: %3d", t );
  215. X  }
  216. X  
  217. X  char get_key() {
  218. X--- 194,241 ----
  219. X              break;
  220. X      }
  221. X      tiles_left[i]--;
  222. X!     print_tiles_left();
  223. X      return( i == 26 ? CH_BL : i + 'A' );
  224. X  }
  225. X  
  226. X! print_tiles_left() {
  227. X!     int i, tleft;
  228. X! 
  229. X!     tleft = 0;
  230. X!     for( i = 0; i < 27; i++ )
  231. X!         tleft += tiles_left[i];
  232. X! 
  233. X      move( TILES_LEFT_Y, TILES_LEFT_X );
  234. X!     printw( "Tiles left to draw: %3d", tleft );
  235. X! }
  236. X! 
  237. X! print_passed_turns() {
  238. X!     if( game_done == 0 ) clear_rect( 1, 50, 1, 79 );
  239. X!     else {
  240. X!         move( 1, 63 );
  241. X!         printw( "Passed turns:  %d", game_done );
  242. X!     }
  243. X!     refresh();
  244. X! }
  245. X! 
  246. X! print_whos_move( plr ) {
  247. X!     clear_turn();
  248. X!     printw( "*** %s turn to play  ", your[plr] );
  249. X! }
  250. X! 
  251. X! print_version() {
  252. X!     clear();
  253. X!     printw( "*** SCRABBLE 1.30 ***\n\n" );
  254. X! }
  255. X! 
  256. X! screen_redraw() {
  257. X!     print_version();
  258. X!     print_info();
  259. X!     print_board();
  260. X!     print_tiles_left( tiles_left );
  261. X!     print_passed_turns();
  262. X!     print_tiles();
  263. X!     print_whos_move( human_player );
  264. X  }
  265. X  
  266. X  char get_key() {
  267. X*** pmove.c.orig    Wed Aug 19 11:58:07 1992
  268. X--- pmove.c    Mon Oct 26 08:17:39 1992
  269. X***************
  270. X*** 12,22 ****
  271. X      char c;
  272. X      int xpos, ypos, done;
  273. X  
  274. X!     xpos = BOARD_LX;
  275. X!     ypos = BOARD_UY;
  276. X      for( ;; ) {
  277. X          clear_prompt();
  278. X!         printw( "  Use the 'hjkl' keys to move the cursor.\n" );
  279. X          printw( "  Press <RETURN> on an empty square to start placing tiles on the board.\n" );
  280. X          printw( "  Press <SPACE> to rearrange your tiles.\n" );
  281. X          printw( "  Press '.' to use your turn to draw new tiles.\n" );
  282. X--- 12,22 ----
  283. X      char c;
  284. X      int xpos, ypos, done;
  285. X  
  286. X!     xpos = 1;
  287. X!     ypos = 1;
  288. X      for( ;; ) {
  289. X          clear_prompt();
  290. X!         printw( "  Use the 'hjkl' keys to move the cursor, and control-L to refresh the screen.\n" );
  291. X          printw( "  Press <RETURN> on an empty square to start placing tiles on the board.\n" );
  292. X          printw( "  Press <SPACE> to rearrange your tiles.\n" );
  293. X          printw( "  Press '.' to use your turn to draw new tiles.\n" );
  294. X***************
  295. X*** 23,47 ****
  296. X          refresh();
  297. X          done = 0;
  298. X          do {
  299. X!             move( ypos, xpos );
  300. X              refresh();
  301. X              c = get_key();
  302. X              switch( c ) {
  303. X                case 'H':
  304. X!                 if( xpos > BOARD_LX ) xpos--;
  305. X                  break;
  306. X                case 'L':
  307. X!                 if( xpos < BOARD_RX ) xpos++;
  308. X                  break;
  309. X                case 'J':
  310. X!                 if( ypos < BOARD_LY ) ypos++;
  311. X                  break;
  312. X                case 'K':
  313. X!                 if( ypos > BOARD_UY ) ypos--;
  314. X                  break;
  315. X                case '\n':
  316. X!                 if( board[ypos - BOARD_UY + 1][xpos - BOARD_LX + 1] < 'A' )
  317. X!                     done = place_tiles( xpos, ypos );
  318. X                  break;
  319. X                case ' ':
  320. X                  done = rearrange_tiles();
  321. X--- 23,50 ----
  322. X          refresh();
  323. X          done = 0;
  324. X          do {
  325. X! #ifdef DBLSIZE_BOARD
  326. X!             move( BOARD_UY + ypos - 1, BOARD_LX + xpos * 2 - 2 );
  327. X! #else
  328. X!             move( BOARD_UY + ypos - 1, BOARD_LX + xpos - 1 );
  329. X! #endif
  330. X              refresh();
  331. X              c = get_key();
  332. X              switch( c ) {
  333. X                case 'H':
  334. X!                 if( xpos > 1 ) xpos--;
  335. X                  break;
  336. X                case 'L':
  337. X!                 if( xpos < 15 ) xpos++;
  338. X                  break;
  339. X                case 'J':
  340. X!                 if( ypos < 15 ) ypos++;
  341. X                  break;
  342. X                case 'K':
  343. X!                 if( ypos > 1 ) ypos--;
  344. X                  break;
  345. X                case '\n':
  346. X!                 if( board[ypos][xpos] < 'A' ) done = place_tiles( xpos, ypos );
  347. X                  break;
  348. X                case ' ':
  349. X                  done = rearrange_tiles();
  350. X***************
  351. X*** 49,54 ****
  352. X--- 52,61 ----
  353. X                case '.':
  354. X                  done = draw_new_tiles();
  355. X                  break;
  356. X+               case ' ':
  357. X+                 screen_redraw();
  358. X+                 done = -1;
  359. X+                 break;
  360. X              }
  361. X          } while( done == 0 );
  362. X          if( done == 1 ) break;
  363. X***************
  364. X*** 83,89 ****
  365. X      show_instructions();
  366. X      placed = 0;
  367. X      for( ;; ) {
  368. X!         move( ypos, xpos );
  369. X          refresh();
  370. X          c = get_key();
  371. X          if( c == '-' || c == 127 || c == 8 ) {
  372. X--- 90,100 ----
  373. X      show_instructions();
  374. X      placed = 0;
  375. X      for( ;; ) {
  376. X! #ifdef DBLSIZE_BOARD
  377. X!         move( BOARD_UY + ypos - 1, BOARD_LX + xpos * 2 - 2 );
  378. X! #else
  379. X!         move( BOARD_UY + ypos - 1, BOARD_LX + xpos - 1 );
  380. X! #endif
  381. X          refresh();
  382. X          c = get_key();
  383. X          if( c == '-' || c == 127 || c == 8 ) {
  384. X***************
  385. X*** 92,99 ****
  386. X              do {
  387. X                  xpos -= xinc;
  388. X                  ypos -= yinc;
  389. X!             } while( board[ypos - BOARD_UY + 1][xpos - BOARD_LX + 1] >= 'A' );
  390. X!             move( ypos, xpos );
  391. X              addch( newlet[placed].oldlet );
  392. X              plr_tiles[human_player][newlet[placed].tilepos]
  393. X                = newlet[placed].letter;
  394. X--- 103,114 ----
  395. X              do {
  396. X                  xpos -= xinc;
  397. X                  ypos -= yinc;
  398. X!             } while( board[ypos][xpos] >= 'A' );
  399. X! #ifdef DBLSIZE_BOARD
  400. X!             move( BOARD_UY + ypos - 1, BOARD_LX + xpos * 2 - 2 );
  401. X! #else
  402. X!             move( BOARD_UY + ypos - 1, BOARD_LX + xpos - 1 );
  403. X! #endif
  404. X              addch( newlet[placed].oldlet );
  405. X              plr_tiles[human_player][newlet[placed].tilepos]
  406. X                = newlet[placed].letter;
  407. X***************
  408. X*** 103,110 ****
  409. X                  do {
  410. X                      xpos -= xinc;
  411. X                      ypos -= yinc;
  412. X!                 } while( board[ypos - BOARD_UY + 1][xpos - BOARD_LX + 1] >= 'A' );
  413. X!                 move( ypos, xpos );
  414. X                  addch( newlet[placed].oldlet );
  415. X                  plr_tiles[human_player][newlet[placed].tilepos]
  416. X                    = newlet[placed].letter;
  417. X--- 118,129 ----
  418. X                  do {
  419. X                      xpos -= xinc;
  420. X                      ypos -= yinc;
  421. X!                 } while( board[ypos][xpos] >= 'A' );
  422. X! #ifdef DBLSIZE_BOARD
  423. X!                 move( BOARD_UY + ypos - 1, BOARD_LX + xpos * 2 - 2 );
  424. X! #else
  425. X!                 move( BOARD_UY + ypos - 1, BOARD_LX + xpos - 1 );
  426. X! #endif
  427. X                  addch( newlet[placed].oldlet );
  428. X                  plr_tiles[human_player][newlet[placed].tilepos]
  429. X                    = newlet[placed].letter;
  430. X***************
  431. X*** 191,197 ****
  432. X              } else press_return();
  433. X              show_instructions();
  434. X          } else {
  435. X!             if( xpos > BOARD_RX || ypos > BOARD_LY ) continue;
  436. X              tile = -1;
  437. X              for( i = 0; i < 7; i++ ) {
  438. X                  if( c == plr_tiles[human_player][i] ) tile = i;
  439. X--- 210,216 ----
  440. X              } else press_return();
  441. X              show_instructions();
  442. X          } else {
  443. X!             if( xpos > 15 || ypos > 15 ) continue;
  444. X              tile = -1;
  445. X              for( i = 0; i < 7; i++ ) {
  446. X                  if( c == plr_tiles[human_player][i] ) tile = i;
  447. X***************
  448. X*** 203,212 ****
  449. X                  newlet[placed].blankchar = c;
  450. X              newlet[placed].letter = plr_tiles[human_player][tile];
  451. X              plr_tiles[human_player][tile] = 0;
  452. X!             newlet[placed].x = xpos - BOARD_LX + 1;
  453. X!             newlet[placed].y = ypos - BOARD_UY + 1;
  454. X!             newlet[placed].oldlet =
  455. X!               board[ypos - BOARD_UY + 1][xpos - BOARD_LX + 1];
  456. X              if( newlet[placed].oldlet == CH_DW ) newlet[placed].oldlet = 'o';
  457. X              newlet[placed].tilepos = tile;
  458. X              addch( newlet[placed].letter );
  459. X--- 222,230 ----
  460. X                  newlet[placed].blankchar = c;
  461. X              newlet[placed].letter = plr_tiles[human_player][tile];
  462. X              plr_tiles[human_player][tile] = 0;
  463. X!             newlet[placed].x = xpos;
  464. X!             newlet[placed].y = ypos;
  465. X!             newlet[placed].oldlet = board[ypos][xpos];
  466. X              if( newlet[placed].oldlet == CH_DW ) newlet[placed].oldlet = 'o';
  467. X              newlet[placed].tilepos = tile;
  468. X              addch( newlet[placed].letter );
  469. X***************
  470. X*** 213,220 ****
  471. X              do {
  472. X                  xpos += xinc;
  473. X                  ypos += yinc;
  474. X!             } while( board[ypos - BOARD_UY + 1][xpos - BOARD_LX + 1] >= 'A'
  475. X!               && xpos <= BOARD_RX && ypos <= BOARD_LY );
  476. X              print_tiles();
  477. X              placed++;
  478. X          }
  479. X--- 231,237 ----
  480. X              do {
  481. X                  xpos += xinc;
  482. X                  ypos += yinc;
  483. X!             } while( board[ypos][xpos] >= 'A' && xpos <= 15 && ypos <= 15 );
  484. X              print_tiles();
  485. X              placed++;
  486. X          }
  487. X*** score.c.orig    Tue Aug  4 11:26:00 1992
  488. X--- score.c    Mon Oct 26 08:17:42 1992
  489. X***************
  490. X*** 98,103 ****
  491. X--- 98,104 ----
  492. X  
  493. X      f = wlen[strlen( word )];
  494. X      l = wlen[strlen( word ) + 1] - 1;
  495. X+     if( f > l ) return( 0 );
  496. X      found = 0;
  497. X      do {
  498. X          m = ( f + l ) / 2;
  499. X***************
  500. X*** 143,148 ****
  501. X--- 144,150 ----
  502. X          }
  503. X          printw( "%s  ", word );
  504. X          score += new_words[i].score;
  505. X+         xloc += strlen( word ) + 2;
  506. X          if( bin_search( word ) == 0 ) {
  507. X              ind[illword++] = i;
  508. X          }
  509. X***************
  510. X*** 156,163 ****
  511. X          }
  512. X          for( i = 0; i < illword; i++ ) {
  513. X              clear_rect( 21, 0, 22, 79 );
  514. X              printw( "  %s is not in the computer's dictionary.\n",
  515. X!               &(new_words[i].letters[0]) );
  516. X              printw( "  Is it a valid Scrabble word (y/n)? " );
  517. X              refresh();
  518. X              do {
  519. X--- 158,166 ----
  520. X          }
  521. X          for( i = 0; i < illword; i++ ) {
  522. X              clear_rect( 21, 0, 22, 79 );
  523. X+             j = ind[i];
  524. X              printw( "  %s is not in the computer's dictionary.\n",
  525. X!               &(new_words[j].letters[0]) );
  526. X              printw( "  Is it a valid Scrabble word (y/n)? " );
  527. X              refresh();
  528. X              do {
  529. X***************
  530. X*** 166,174 ****
  531. X              if( c == 'N' ) break;
  532. X              clear_rect( 21, 0, 22, 79 );
  533. X              printw( "  Inserting %s into the dictionary...",
  534. X!               &(new_words[i].letters[0]) );
  535. X              refresh();
  536. X!             add_dict( &(new_words[i].letters[0]) );
  537. X              dict_changed = 1;
  538. X          }
  539. X          clear_rect( 21, 0, 22, 79 );
  540. X--- 169,177 ----
  541. X              if( c == 'N' ) break;
  542. X              clear_rect( 21, 0, 22, 79 );
  543. X              printw( "  Inserting %s into the dictionary...",
  544. X!               &(new_words[j].letters[0]) );
  545. X              refresh();
  546. X!             add_dict( &(new_words[j].letters[0]) );
  547. X              dict_changed = 1;
  548. X          }
  549. X          clear_rect( 21, 0, 22, 79 );
  550. X***************
  551. X*** 246,258 ****
  552. X      for( p1 = wlen[l];
  553. X            p1 < wlen[l + 1] && strcmp( word, &(words[wptr[p1]]) ) > 0;
  554. X            p1++ );
  555. X!     for( p2 = dict_size - 1; p2 >= wptr[p1]; p2-- ) words[p2 + l + 1] = words[p2];
  556. X!     for( p2 = wlen[16]; p2 > p1; p2-- ) wptr[p2] = wptr[p2 - 1] + l + 1;
  557. X      for( i = l + 1; i < 17; i++ ) wlen[i]++;
  558. X      strcpy( &(words[wptr[p1]]), word );
  559. X      dict_size += l + 1;
  560. X  /*    printw( "\n  " );
  561. X!     for( p2 = p1 - 2; p2 < p1 + 3; p2++ )
  562. X          printw( "%s  ", &(words[wptr[p2]]) );
  563. X      printw( "%s  %s", &(words[wptr[wlen[8]]]), &(words[wptr[wlen[16] - 1]]) );
  564. X      press_return(); */
  565. X--- 249,261 ----
  566. X      for( p1 = wlen[l];
  567. X            p1 < wlen[l + 1] && strcmp( word, &(words[wptr[p1]]) ) > 0;
  568. X            p1++ );
  569. X!     for( p2 = dict_size; p2 >= wptr[p1]; p2-- ) words[p2 + l + 1] = words[p2];
  570. X!     for( p2 = wlen[16] + 1; p2 > p1; p2-- ) wptr[p2] = wptr[p2 - 1] + l + 1;
  571. X      for( i = l + 1; i < 17; i++ ) wlen[i]++;
  572. X      strcpy( &(words[wptr[p1]]), word );
  573. X      dict_size += l + 1;
  574. X  /*    printw( "\n  " );
  575. X!     for( p2 = ( p1 - 2 >= 0 ? p1 - 2 : 0 ); p2 < p1 + 3 && p2 <= wlen[16]; p2++ )
  576. X          printw( "%s  ", &(words[wptr[p2]]) );
  577. X      printw( "%s  %s", &(words[wptr[wlen[8]]]), &(words[wptr[wlen[16] - 1]]) );
  578. X      press_return(); */
  579. X*** scrab.h.orig    Tue Sep 15 13:42:33 1992
  580. X--- scrab.h    Mon Oct 26 08:17:45 1992
  581. X***************
  582. X*** 19,35 ****
  583. X  #define CH_BL            '*'
  584. X  #define CH_IT            '_'
  585. X  
  586. X- #define BOARD_UY        2
  587. X- #define BOARD_LY        16
  588. X- #define BOARD_LX        34
  589. X- #define BOARD_RX        48
  590. X  #define INFO_Y            2
  591. X  #define INFO_X            0
  592. X  #define TILE_RACKS_Y    2
  593. X! #define TILE_RACKS_X    54
  594. X  #define TILES_LEFT_Y    0
  595. X  #define TILES_LEFT_X    57
  596. X  /* #define PRINT_CPU_TILES */
  597. X  
  598. X  #define DICT_FILE        "scrabbledict"
  599. X  
  600. X--- 19,45 ----
  601. X  #define CH_BL            '*'
  602. X  #define CH_IT            '_'
  603. X  
  604. X  #define INFO_Y            2
  605. X  #define INFO_X            0
  606. X  #define TILE_RACKS_Y    2
  607. X! #define TILE_RACKS_X    59
  608. X  #define TILES_LEFT_Y    0
  609. X  #define TILES_LEFT_X    57
  610. X+ 
  611. X  /* #define PRINT_CPU_TILES */
  612. X+ /* #define DBLSIZE_BOARD */
  613. X+ 
  614. X+ #ifdef  DBLSIZE_BOARD
  615. X+ #define BOARD_UY        2
  616. X+ #define BOARD_LY        16
  617. X+ #define BOARD_LX        25
  618. X+ #define BOARD_RX        53
  619. X+ #else
  620. X+ #define BOARD_UY        2
  621. X+ #define BOARD_LY        16
  622. X+ #define BOARD_LX        32
  623. X+ #define BOARD_RX        46
  624. X+ #endif
  625. X  
  626. X  #define DICT_FILE        "scrabbledict"
  627. X  
  628. X*** scrabble.6.orig    Wed Sep 16 12:46:16 1992
  629. X--- scrabble.6    Mon Oct 26 08:17:46 1992
  630. X***************
  631. X*** 1,5 ****
  632. X! .\" @(#)scrabble.6 1.02 92/09/16 JAC
  633. X! .TH SCRABBLE 6 "16 September 1992"
  634. X  .SH NAME
  635. X  scrabble \- play the Scrabble(TM) board game
  636. X  .SH SYNOPSIS
  637. X--- 1,5 ----
  638. X! .\" @(#)scrabble.6 1.03 92/09/16 JAC
  639. X! .TH SCRABBLE 6 "5 October 1992"
  640. X  .SH NAME
  641. X  scrabble \- play the Scrabble(TM) board game
  642. X  .SH SYNOPSIS
  643. X***************
  644. X*** 7,13 ****
  645. X  .SH DESCRIPTION
  646. X  .LP
  647. X  .B scrabble
  648. X! is a computer version of the Selchow & Righter board game, Scrabble.
  649. X  Only one human player plays; the user may select the number of
  650. X  computer opponents, from one to three.
  651. X  .SH BASIC SCRABBLE RULES
  652. X--- 7,13 ----
  653. X  .SH DESCRIPTION
  654. X  .LP
  655. X  .B scrabble
  656. X! is a computer version of the Milton Bradley board game, Scrabble.
  657. X  Only one human player plays; the user may select the number of
  658. X  computer opponents, from one to three.
  659. X  .SH BASIC SCRABBLE RULES
  660. X***************
  661. X*** 241,246 ****
  662. X--- 241,250 ----
  663. X  l
  664. X  Moves the cursor right.  If the cursor is on the right edge
  665. X  of the board, this key has no effect.
  666. X+ .TP
  667. X+ ^L
  668. X+ Redraws the screen.  This is provided in case the screen
  669. X+ should somehow become corrupted.
  670. X  .TP
  671. X  RETURN
  672. X  Starts placing tiles on the board.  If the cursor is over
  673. X*** smain.c.orig    Tue Sep 15 13:45:37 1992
  674. X--- smain.c    Mon Oct 26 08:17:43 1992
  675. X***************
  676. X*** 76,96 ****
  677. X      move( INFO_Y + 5, INFO_X + 2 );
  678. X      printw( "%c: Blank tile", CH_BL );
  679. X      move( INFO_Y + 7, INFO_X );
  680. X!     printw( "Tile values & distributions:" );
  681. X      move( INFO_Y + 8, INFO_X + 2 );
  682. X!     printw( "A-1, 9  H-4, 2  O-1, 8  V-4, 2" );
  683. X      move( INFO_Y + 9, INFO_X + 2 );
  684. X!     printw( "B-3, 2  I-1, 9  P-3, 2  W-4, 2" );
  685. X      move( INFO_Y +10, INFO_X + 2 );
  686. X!     printw( "C-3, 2  J-8, 1  Q10, 1  X-8, 1" );
  687. X      move( INFO_Y +11, INFO_X + 2 );
  688. X!     printw( "D-2, 4  K-5, 1  R-1, 6  Y-4, 2" );
  689. X!     move( INFO_Y +12, INFO_X + 2 );
  690. X!     printw( "E-1,12  L-1, 4  S-1, 4  Z10, 1" );
  691. X      move( INFO_Y +13, INFO_X + 2 );
  692. X!     printw( "F-4, 2  M-3, 2  T-1, 6  %c-0, 2", CH_BL );
  693. X      move( INFO_Y +14, INFO_X + 2 );
  694. X!     printw( "G-2, 3  N-1, 6  U-1, 4" );
  695. X      refresh();
  696. X  }
  697. X  
  698. X--- 76,96 ----
  699. X      move( INFO_Y + 5, INFO_X + 2 );
  700. X      printw( "%c: Blank tile", CH_BL );
  701. X      move( INFO_Y + 7, INFO_X );
  702. X!     printw( "Tile distribs & values:" );
  703. X      move( INFO_Y + 8, INFO_X + 2 );
  704. X!     printw( "9A1  2H4  8O1  2V4" );
  705. X      move( INFO_Y + 9, INFO_X + 2 );
  706. X!     printw( "2B3  9I1  2P3  2W4" );
  707. X      move( INFO_Y +10, INFO_X + 2 );
  708. X!     printw( "2C3  1J8  1Q10 1X8" );
  709. X      move( INFO_Y +11, INFO_X + 2 );
  710. X!     printw( "4D2  1K5  6R1  2Y4" );
  711. X!     move( INFO_Y +12, INFO_X + 1 );
  712. X!     printw( "12E1  4L1  4S1  1Z10" );
  713. X      move( INFO_Y +13, INFO_X + 2 );
  714. X!     printw( "2F4  2M3  6T1  2%c0", CH_BL );
  715. X      move( INFO_Y +14, INFO_X + 2 );
  716. X!     printw( "3G2  6N1  4U1" );
  717. X      refresh();
  718. X  }
  719. X  
  720. X***************
  721. X*** 144,150 ****
  722. X          if( j == 4 ) strcpy( cs, "fourth" );
  723. X          printw( "\n  You will play %s.", cs );
  724. X          human_player = j - 1;
  725. X!         print_tiles_left( 100 );
  726. X          press_return();
  727. X          clear_prompt();
  728. X          refresh();
  729. X--- 144,150 ----
  730. X          if( j == 4 ) strcpy( cs, "fourth" );
  731. X          printw( "\n  You will play %s.", cs );
  732. X          human_player = j - 1;
  733. X!         print_tiles_left();
  734. X          press_return();
  735. X          clear_prompt();
  736. X          refresh();
  737. X***************
  738. X*** 300,313 ****
  739. X      int i;
  740. X  
  741. X      set_up_window();
  742. X!     clear();
  743. X!     printw( "*** SCRABBLE 1.21 ***\n\n" );
  744. X  
  745. X      read_words();
  746. X      dict_changed = 0;
  747. X  
  748. X!     clear();
  749. X!     printw( "*** SCRABBLE 1.21 ***\n\n" );
  750. X  
  751. X      init_board();
  752. X      seed_random();
  753. X--- 300,311 ----
  754. X      int i;
  755. X  
  756. X      set_up_window();
  757. X!     print_version();
  758. X  
  759. X      read_words();
  760. X      dict_changed = 0;
  761. X  
  762. X!     print_version();
  763. X  
  764. X      init_board();
  765. X      seed_random();
  766. X***************
  767. X*** 319,326 ****
  768. X      abort = 0;
  769. X      do {
  770. X          for( plr = 0; plr < players; plr++ ) {
  771. X!             clear_turn();
  772. X!             printw( "*** %s turn to play  ", your[plr] );
  773. X              if( plr == human_player ) {
  774. X                  player_move();
  775. X              } else {
  776. X--- 317,323 ----
  777. X      abort = 0;
  778. X      do {
  779. X          for( plr = 0; plr < players; plr++ ) {
  780. X!             print_whos_move( plr );
  781. X              if( plr == human_player ) {
  782. X                  player_move();
  783. X              } else {
  784. X***************
  785. X*** 327,338 ****
  786. X                  computer_move( plr );
  787. X              }
  788. X              if( abort != 0 ) break;
  789. X!             if( game_done == 0 ) clear_rect( 1, 50, 1, 79 );
  790. X!             else {
  791. X!                 move( 1, 64 );
  792. X!                 printw( "Passed turns:  %d", game_done );
  793. X!             }
  794. X!             refresh();
  795. X              if( game_done == players ) break;
  796. X              for( i = 0; i < 7; i++ )
  797. X                  if( plr_tiles[plr][i] != 0 ) break;
  798. X--- 324,330 ----
  799. X                  computer_move( plr );
  800. X              }
  801. X              if( abort != 0 ) break;
  802. X!             print_passed_turns();
  803. X              if( game_done == players ) break;
  804. X              for( i = 0; i < 7; i++ )
  805. X                  if( plr_tiles[plr][i] != 0 ) break;
  806. X*** /dev/null    Mon Oct 26 08:10:12 1992
  807. X--- CHANGES    Mon Oct 26 08:19:02 1992
  808. X***************
  809. X*** 0 ****
  810. X--- 1,53 ----
  811. X+ Here is a list of people who suggested changes to scrabble, followed by my
  812. X+ responses to them
  813. X+ 
  814. X+ 
  815. X+ 1.   alainc%tollys.UUCP%bnrmtl.UUCP@Larry.McRCIM.McGill.EDU (Alain Caron)
  816. X+    was trying to get scrabble to work with a french dictionary, and there were
  817. X+    bugs in the dictionary insertion routine.  They have now been fixed.
  818. X+    These bugs were quite serious.
  819. X+ 
  820. X+ 2.   "Bradley D. Keister" <keister@poincare.phys.cmu.edu> noticed some problems
  821. X+    once with how scrabble was displayed on his screen.  As well, Nick Sayer
  822. X+    <mrapple@quack.sac.ca.us> recommended that a redraw screen key be added.
  823. X+ 
  824. X+    Now, the screen may be redrawn by pressing ctrl-L when it is the human
  825. X+    player's turn.  It may only be used when moving around the board with the
  826. X+    'hjkl' keys; if you are placing tiles or anything else, you must press ESC
  827. X+    before pressing ctrl-L.  As well, it cannot be redrawn when the computer
  828. X+    players are playing.  The justification for this is that, the computer play-
  829. X+    ers don't actually care about the screen layout when they're playing a move
  830. X+    whereas the human player does.  Thus, it seemed acceptable that only during
  831. X+    the human player's turn may the screen be redrawn.
  832. X+ 
  833. X+ 3.   wixer!cb@cs.utexas.edu (Cyberspace Buddha) recommended the use of the
  834. X+    Official Scrabble Players' Dictionary with scrabble.  He tells me a copy
  835. X+    may be obtained from 
  836. X+ 
  837. X+     Christopher Hall
  838. X+     P.O. Box 26025
  839. X+     Austin, Tx 78755-0025
  840. X+ 
  841. X+     FidoNet    : 1:382/29.4
  842. X+     CompuServe  : 72150,752
  843. X+ 
  844. X+ 4.   Nick Sayer <mrapple@quack.sac.ca.us> recommended that the board width be
  845. X+    doubled, partly to make the board look more square, and partly to allow
  846. X+    reverse-video to be displayed on "magic-cookie" type terminals.
  847. X+ 
  848. X+    Now, the file scrab.h has a preprocessor directive which may be uncommented:
  849. X+ 
  850. X+    /* #define DBLSIZE_BOARD */
  851. X+ 
  852. X+    If this directive is uncommented, the board width doubles.  Otherwise, it
  853. X+    remains as narrow as in V1.21.  I prefer the narrow board, myself.
  854. X+ 
  855. X+ 5.   sthomas@serene.clipper.ingr.com (Steve Thomas) points out that, in fact,
  856. X+    Selchow and Righter no longer own the rights to scrabble.  Depending on the
  857. X+    country, the rights are now owned by Milton Bradley or JW Spear & Sons.
  858. X+ 
  859. X+    As well, Steve had a number of good suggestions for improving the computer
  860. X+    players' speed.  He recommended a form of rack management, and he directed
  861. X+    me to an article by Appel & Jacobson about how to improve the computer.  I
  862. X+    have not implemented his suggestions yet.  Maybe later...
  863. X+ 
  864. END_OF_FILE
  865. if test 22997 -ne `wc -c <'patches01'`; then
  866.     echo shar: \"'patches01'\" unpacked with wrong size!
  867. fi
  868. # end of 'patches01'
  869. fi
  870. echo shar: End of shell archive.
  871. exit 0
  872.