terrell@musky2.MUSKINGUM.EDU (07/18/88)
Posting-number: Volume 3, Issue 92 Submitted-by: "A. Nonymous" <terrell@musky2.MUSKINGUM.EDU> Archive-name: vms-hangman/Part2 +-+-+-+ Beginning of part 2 +-+-+-+ X BEGIN X IF NewWord[Counter] = ChPressed THEN X SMG$PUT_CHARS_HIGHWIDE (WordDisp, ChPressed, 1, Column); X X Column := Column + 2; X END; (* FOR *) X X NumGuessed := NumGuessed + 1; X WordSolved := NumGuessed = NumUniqueLetters; X END X ELSE X BEGIN X NumWrong := NumWrong + 1; X DrawMan (NumWrong); X ManHanged := NumWrong = NumBodyParts; X END; (* IF/ELSE *) X END; (* IF *) X X UNTIL WordSolved OR ManHanged OR (CharCode = 26); X X Done := CharCode = 26; X X IF ManHanged THEN X BEGIN X SMG$RING_BELL (ManDisplay, 3); X X Column := 1; X FOR Counter := 1 TO WordLength DO X BEGIN X SMG$PUT_CHARS_HIGHWIDE (WordDisp, NewWord[Counter], 1, Column); X X Column := Column + 2; X END; (* FOR *) X X LIB$WAIT (3.5); X END; (* IF *) X XEND; (* SolveWord *) X X XBEGIN X SMG$CREATE_PASTEBOARD (Pasteboard); X SMG$CREATE_VIRTUAL_KEYBOARD (Keyboard); X X SMG$CREATE_VIRTUAL_DISPLAY (4, 65, LetterDisp); X SMG$CREATE_VIRTUAL_DISPLAY (12, 18, ManDisplay, SMG$M_BORDER); X SMG$CREATE_VIRTUAL_DISPLAY (2, 30, WordDisp); X SMG$CREATE_VIRTUAL_DISPLAY (10, 60, HelpDisp); X X SMG$PASTE_VIRTUAL_DISPLAY (LetterDisp, Pasteboard, 20, 2); X SMG$PASTE_VIRTUAL_DISPLAY (ManDisplay, Pasteboard, 2, 2); X SMG$PASTE_VIRTUAL_DISPLAY (WordDisp, Pasteboard, 17, 25); X SMG$PASTE_VIRTUAL_DISPLAY (HelpDisp, Pasteboard, 2, 22); X X FillHelpDisplay; X X TIME (CurrTime); X SmallStr[1] := CurrTime[10]; (* Get the initial random number seed *) X SmallStr[2] := CurrTime[11]; (* from the hundredth-of-a-second *) X READV (SmallStr, RandomSeed); (* portion of the current time. *) X X Done := FALSE; X X REPEAT X SMG$ERASE_DISPLAY (ManDisplay); X FillLetters; X X GetWord (NewWord); X SolveWord (NewWord); X UNTIL Done; (* Ctrl/Z has been pressed *) X X SMG$DELETE_PASTEBOARD (Pasteboard); XEND. $ GOSUB UNPACK_FILE $ EXIT -+-+-+-+-+ End of part 2 +-+-+-+-+-