home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / jots.zip / USEDLIST.BAS < prev    next >
BASIC Source File  |  1989-03-13  |  974b  |  44 lines

  1. ' USEDLIST.BAS -- This module handles the list of letters that have
  2. ' already been used in a word
  3. ' $INCLUDE: 'J.INC'
  4.  
  5. DECLARE SUB RedrawUsedList ()
  6.  
  7. DIM SHARED MyBox AS BoxType, TopRow, BotRow, LftCol, RtCol
  8. DIM SHARED UsedList AS STRING * 26
  9.  
  10. SUB InitUsedList
  11.     CALL BoxCoords(UsedBox, MyBox)
  12.     TopRow = MyBox.TopRow
  13.     BotRow = MyBox.BotRow
  14.     LftCol = MyBox.LftCol
  15.     RtCol = MyBox.RtCol
  16.  
  17.     NormalBox (UsedBox)
  18.     LOCATE TopRow + 1, LftCol + 2, 0
  19.     PRINT "Untried Letters:"
  20.     UsedList$ = " "
  21.     RedrawUsedList
  22. END SUB
  23.  
  24. SUB AddToUsedList (Word$)
  25.     FOR Lp = 1 TO 5
  26.         Letter$ = MID$(Word$, Lp, 1)
  27.         MID$(UsedList$, ASC(Letter$) - ASC("@"), 1) = Letter$
  28.     NEXT Lp
  29.     RedrawUsedList
  30. END SUB
  31.  
  32. SUB RedrawUsedList
  33.     LOCATE TopRow + 3, LftCol + 2, 0
  34.     FOR Lp = ASC("A") TO ASC("Z")
  35.         IF INSTR(UsedList$, CHR$(Lp)) THEN
  36.             COLOR Exclude, Background, Background
  37.         ELSE
  38.             COLOR Normal, Background, Background
  39.         END IF
  40.         PRINT CHR$(Lp); " ";
  41.     NEXT Lp
  42. END SUB
  43.  
  44.