home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IO Examples / Scrabble / English / language.dcl < prev    next >
Encoding:
Modula Definition  |  1997-05-14  |  2.8 KB  |  109 lines  |  [TEXT/3PRM]

  1. definition module language
  2.  
  3.  
  4. import    StdList, StdArray, _SystemArray, StdEnum
  5. import    deltaTimer, deltaSystem
  6. import    types
  7.  
  8.  
  9. /*    This module contains macro's to make the scrabble application language customisable.
  10. */
  11.  
  12. //    The filename of the lexicon:
  13.  
  14. lexiconfilename    :==    toString DirSeparator+++"English"+++toString DirSeparator+++"English_lexicon"
  15.  
  16. //    The filename of the help file:
  17.  
  18. helpfilename    :==    toString DirSeparator+++"English"+++toString DirSeparator+++"ScrabbleHelp"
  19.  
  20.  
  21. //    The set of letters used in the scrabble game.
  22.  
  23. letterbox    :: [Char]
  24. lettervalue    :: !Char -> Int
  25.  
  26.  
  27. //    String conversion functions:
  28.  
  29. instance toString Player
  30. instance toString Playerkind
  31. instance toString Direction
  32. instance toString Strength
  33. instance toString (a,b) | toString a & toString b
  34.  
  35.  
  36. //    Text used to communicate with the user in the display control.
  37.  
  38. exchanges_letters
  39.     :==    " exchanges letters."
  40. placement_error word pos
  41.     :==    [    " by placing the word '"+++word+++"'"
  42.         ,    " at "+++toString pos
  43.         ,    " it will not adjoin any present word."
  44.         ]
  45. anonymous_placement_error
  46.     :==    [    "word can not be place at this position." ]
  47. missing_letters_error cs
  48.     :==    [    "you can not form this word because you do not have the letter(s): "
  49.         ,    "   "+++{c\\c<-cs}+++"."
  50.         ]
  51. nr_new_words_placed nr words
  52.     :==    if (nr==0)
  53.             ["No new words placed.",Wait (2*TicksPerSecond) ""]
  54.        (if (nr==1)
  55.                ["New word placed:",hd words,Wait (2*TicksPerSecond) ""]
  56.             [toString nr+++" New words placed" : words++[Wait (2*TicksPerSecond) ""]]
  57.        )
  58. has_won                :==    " has won."
  59. is_a_draw            :==    "It is a draw."
  60. is_move                :==    " is playing."
  61.  
  62. determines_new_word    :==    " determines a new word"
  63. determined_new_word    :==    " has determined a new word."
  64. found_upto_now        :==    "found word up to now:"
  65. score_upto_now        :==    "score up to now:"
  66. at_pos                :== "at:"
  67.  
  68.  
  69. //    Text used in the GUI definition.
  70.  
  71. //    The Scrabble menu:
  72. scrabblemenutitle        :==    "Scrabble"
  73. playersmenutitle        :==    "Players"
  74. newgametitle            :==    "New"
  75. quitgametitle            :==    "Quit"
  76.  
  77. //    The Strength menu:
  78. strengthmenutitle        :==    "Strength"
  79.  
  80. //    The Scrabble dialog:
  81. scrabbledialogtitle        :==    "Scrabble"
  82. scrabbledialogscore        :==    "Score"
  83. scrabbledialogword        :==    "Player word"
  84. scrabbledialogdirection    :==    "Direction"
  85. scrabbledialogplaceword    :==    "Place Word"
  86. scrabbledialoginittext lexicon
  87.     :==    [    "Number of read words: "
  88.         ,    toString (sizetree lexicon)
  89.         ,    "Depth searchtree:"
  90.         ,    toString (depthtree lexicon)
  91.         ,    Wait (2*TicksPerSecond) ""
  92.         ]
  93.  
  94. //    The Add Words dialog:
  95. addwordstitle            :==    "Add New"
  96. addwordsheading nr
  97.     :==    if (nr==1)    ("Word does not occur.",    "Would you like to add it?")
  98.                     ("Words do not occur.","Would you like to add them?")
  99. addwords_yes            :==    "Yes"
  100. addwords_no                :==    "No"
  101.  
  102. //    The Save notice:
  103. save_notice_text
  104.     :==    [    "Save added words to lexicon?"
  105.         ]
  106. save_notice_yes            :==    "Yes"
  107. save_notice_no            :==    "No"
  108.  
  109.