crap:
PRINT "Error, Line number" beginning:
CONST arrowKeyMove$
= "L64O2C" CONST enterKeyHit$
= "L45O4C"
DIM SHARED translationMatrix$
(1 TO 26, 1 TO 2):
FOR cl
= 1 TO 26: translationMatrix$
(cl
, 1) = "": translationMatrix$
(cl
, 2) = "":
NEXT cl
DIM SHARED highlightedLetter: highlightedLetter
= 0 FOR cl
= 1 TO numberOfLines
workingLines$(cl) = ""
initiallyCodedLines$(cl) = ""
answerLines$(cl) = ""
leftPositions(cl) = 0
opt = 1
mode = Normal
PrintAgain:
COLOR 14, 2: a$
= "Mode = Easy Normal":
PRINT "Load a Saved Game"
PRINT "Add New Phrase to Data File"
opt = opt - 1
mode = Normal
mode = Easy
opt = opt + 1
mode = Normal
mode = Easy
loaded = FALSE
loaded = TRUE
a$
= "A random phrase picked from " + CHR$(34) + "Phrases.txt" + CHR$(34) + " will be displayed in code." a$
= "The goal is to decode the phrase. The coded letters are in one color":
LOCATE 14, Center
(a$
):
PRINT a$
a$
= "and the letters you choose in another color. In easy mode, incorrect":
LOCATE 16, Center
(a$
):
PRINT a$
a$
= "letters are displayed in yet another color. Different types":
LOCATE 18, Center
(a$
):
PRINT a$
a$
= "of hints are available from the hint menu.":
LOCATE 20, Center
(a$
):
PRINT a$
a$
= "Use the arrow keys to select the letter you wish to change. Type":
LOCATE 25, Center
(a$
):
PRINT a$
a$
= "in the letter you wish to change it to. Push the [ESC] key":
LOCATE 27, Center
(a$
):
PRINT a$
a$
= "to reset the puzzle to the starting code.":
LOCATE 29, Center
(a$
):
PRINT a$
a$
= "Hit any key to return to the Main Menu":
LOCATE 45, Center
(a$
):
COLOR 11, 13:
PRINT a$: l$
= P$
a$
= "Type in the phrase you want to add. Do not hit":
LOCATE 15, Center
(a$
):
PRINT a$
a$
= " the [ENTER] key until you've entered the entire phrase. ":
LOCATE 17, Center
(a$
):
PRINT a$
a$
= "Don't worry if your entry passes the end of the screen":
LOCATE 19, Center
(a$
):
PRINT a$
a$
= "and continues on to the next line. In fact, longer":
LOCATE 21, Center
(a$
):
PRINT a$
a$
= "phrases are easier to decode.":
LOCATE 23, Center
(a$
):
PRINT a$
maxIndex = FileStatus
DIM fileArray$
(1 TO maxIndex
+ 1) FOR index
= 1 TO maxIndex
fileArray$(maxIndex + 1) = newPhrase$
FOR index
= 1 TO maxIndex
+ 1 PRINT #1, fileArray$
(index
)
maxLineNumber = 0
translationMatrix$(index, 1) = "": translationMatrix$(index, 2) = ""
usersCode$(index, 1) = "": usersCode$(index, 2) = ""
codedPhrase$ = ""
answerPhrase$ = ""
highlightedLetter = 0
mode = 0
workingLines$(index) = ""
initiallyCodedLines$(index) = ""
answerLines$(index) = ""
leftPositions(index) = 0
FOR index
= 1 TO maxLineNumber
PRINT #1, S$
(maxLineNumber
) PRINT #1, translationMatrix$
(index
, 1) PRINT #1, translationMatrix$
(index
, 2) PRINT #1, usersCode$
(index
, 1) PRINT #1, usersCode$
(index
, 2) PRINT #1, S$
(highlightedLetter
) FOR index
= 1 TO maxLineNumber
PRINT #1, workingLines$
(index
) PRINT #1, initiallyCodedLines$
(index
) PRINT #1, answerLines$
(index
) PRINT #1, S$
(leftPositions
(index
))
translationMatrix$(cl, 1) = ""
translationMatrix$(cl, 2) = ""
usersCode$
(cl
, 1) = CHR$(cl
+ 64) usersCode$(cl, 2) = "-"
codedPhrase$ = ""
answerPhrase$ = ""
highlightedLetter = 1
FOR index
= 1 TO numberOfLines
workingLines$(index) = ""
initiallyCodedLines$(index) = ""
answerLines$(index) = ""
leftPositions(index) = 0
maxLineNumber = 0
'first, pick a phrase
randomPhrase
= INT(RND * FileStatus
) + 1 FOR x
= 1 TO randomPhrase
'second, create a code
usedAlphabet$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
translationMatrix$
(allLetters
, 1) = CHR$(allLetters
+ 64) newRndLet:
randomLetter
= INT(RND * LEN(usedAlphabet$
)) + 1 translationMatrix$
(allLetters
, 2) = MID$(usedAlphabet$
, randomLetter
, 1) IF translationMatrix$
(allLetters
, 1) = translationMatrix$
(allLetters
, 2) THEN GOTO newRndLet
usedAlphabet$
= MID$(usedAlphabet$
, 1, randomLetter
- 1) + MID$(usedAlphabet$
, randomLetter
+ 1, LEN(usedAlphabet$
))
'third: put the phrase in code
answerLetter$
= MID$(answerPhrase$
, letter
, 1) upAnsLet$
= UCASE$(answerLetter$
) answerLetterNumber
= ASC(upAnsLet$
) - 64 upCodeLet$
= translationMatrix$
(ASC(upAnsLet$
) - 64, 2) codedLetter$ = upCodeLet$
codedLetter$
= LCASE$(upCodeLet$
) codedLetter$ = answerLetter$
codedPhrase$ = codedPhrase$ + codedLetter$
'next on the list is to center the phrases
lineNumber = 0
shrinkingCode$ = codedPhrase$
shrinkingAnswer$ = answerPhrase$
checking = 60
wheresSpace$
= MID$(shrinkingAnswer$
, checking
, 1) checking = checking - 1
lineNumber = lineNumber + 1
answerLines$
(lineNumber
) = MID$(shrinkingAnswer$
, 1, checking
) workingLines$
(lineNumber
) = MID$(shrinkingCode$
, 1, checking
) initiallyCodedLines$
(lineNumber
) = MID$(shrinkingCode$
, 1, checking
) leftPositions(lineNumber) = Center(answerLines$(lineNumber))
shrinkingAnswer$
= MID$(shrinkingAnswer$
, checking
+ 1, LEN(shrinkingAnswer$
)) shrinkingCode$
= MID$(shrinkingCode$
, checking
+ 1, LEN(shrinkingCode$
)) lineNumber = lineNumber + 1
answerLines$(lineNumber) = shrinkingAnswer$
leftPositions(lineNumber) = Center(answerLines$(lineNumber))
workingLines$(lineNumber) = shrinkingCode$
initiallyCodedLines$(lineNumber) = shrinkingCode$
maxLineNumber = lineNumber
highlightedLetter = 1
loaded = FALSE
refresh = TRUE
refresh = TRUE
PLAY enterKeyHit$
+ enterKeyHit$
+ arrowKeyMove$
refresh = TRUE
highlightedLetter = 1
FOR cl
= 1 TO 26: translationMatrix$
(cl
, 1) = "": translationMatrix$
(cl
, 2) = "": usersCode$
(cl
, 1) = "": usersCode$
(cl
, 2) = "":
NEXT cl
FOR cl
= 1 TO numberOfLines
workingLines$(cl) = ""
initiallyCodedLines$(cl) = ""
answerLines$(cl) = ""
leftPositions(cl) = 0
FOR cl
= 1 TO 26: translationMatrix$
(cl
, 1) = "": translationMatrix$
(cl
, 2) = "": usersCode$
(cl
, 1) = "": usersCode$
(cl
, 2) = "":
NEXT cl
mode = Normal
highlightedLetter = highlightedLetter - 1
highlightedLetter = 26
refresh = TRUE
IF highlightedLetter
< 26 THEN highlightedLetter = highlightedLetter + 1
highlightedLetter = 1
refresh = TRUE
CASE "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" usersCode$(highlightedLetter, 2) = userInput$
refresh = TRUE
refresh = FALSE
nope:
a$
= "You have an option of 3 types of hints to choose from.":
LOCATE 10, Center
(a$
):
PRINT a$
a$
= "Wheel of Fortune reveals the letters for R, S, T, L, N and E":
LOCATE 11, Center
(a$
):
PRINT a$
a$
= "Or you can choose to reveal a single letter.":
LOCATE 12, Center
(a$
):
PRINT a$
a$
= "1.) Wheel of Fortune: Example phrase = Emtlele ewrtse":
LOCATE 17, Center
(a$
):
PRINT "1.) Wheel of Fortune: ";:
COLOR 10, 1:
PRINT "Example phrase = ";
a$
= "2.) Reveal a single random letter: Rmtleyr ewatbr":
LOCATE 19, Center
(a$
):
PRINT "2.) Reveal a single random letter: ";:
COLOR 12, 1:
PRINT "E";:
COLOR 10, 1 a$
= "3.) Choose a single coded letter to decode:":
LOCATE 21, Center
(a$
):
PRINT a$
a$
= " Pick any letter in example phrase":
LOCATE 22, Center
(a$
):
PRINT " Pick any letter in ";:
COLOR 10, 1:
PRINT "R";
a$
= "4.) Reveal a letter you think is in the answer phrase:":
LOCATE 25, Center
(a$
):
PRINT a$
a$
= "Choosing " + CHR$(34) + "K" + CHR$(34) + " wouldn't reveal anything. Choosing " + CHR$(34) + "L" + CHR$(34):
LOCATE 26, Center
(a$
):
PRINT a$
a$
= " Reveals the " + CHR$(34) + "L" + CHR$(34) + " -- example phrase":
LOCATE 27, Center
(a$
):
PRINT "reveals the " + CHR$(34) + "L" + CHR$(34) + " -- ";
a$
= "5.) Switch to easy mode":
LOCATE 29, Center
(a$
):
PRINT a$
a$
= "6.) Display every coded letter and the letter":
LOCATE 31, Center
(a$
):
PRINT a$
a$
= " it should be for 2 seconds":
LOCATE 32, Center
(a$
):
PRINT a$
r$ = P$
r$
= translationMatrix$
(18, 2): re
= ASC(r$
) - 64: highlightedLetter
= re:
CALL Switch
("R"): usersCode$
(re
, 2) = "R" ss$
= translationMatrix$
(19, 2): se
= ASC(ss$
) - 64: highlightedLetter
= se:
CALL Switch
("S"): usersCode$
(se
, 2) = "S" t$
= translationMatrix$
(20, 2): te
= ASC(t$
) - 64: highlightedLetter
= te:
CALL Switch
("T"): usersCode$
(te
, 2) = "T" l$
= translationMatrix$
(12, 2): le
= ASC(l$
) - 64: highlightedLetter
= le:
CALL Switch
("L"): usersCode$
(le
, 2) = "L" n$
= translationMatrix$
(14, 2): ne
= ASC(n$
) - 64: highlightedLetter
= ne:
CALL Switch
("N"): usersCode$
(ne
, 2) = "N" e$
= translationMatrix$
(5, 2): ee
= ASC(e$
) - 64: highlightedLetter
= ee:
CALL Switch
("E"): usersCode$
(ee
, 2) = "E" gotThis:
tryAgain:
there = FALSE
FOR x
= 1 TO maxLineNumber
itShouldBeCodedAs$
= translationMatrix$
(ASC(someRandom$
) - 64, 2) usersAttempt$
= usersCode$
(ASC(itShouldBeCodedAs$
) - 64, 2) highlightedLetter
= ASC(itShouldBeCodedAs$
) - 64 Switch (someRandom$)
usersCode$(highlightedLetter, 2) = someRandom$
a$
= "What code letter do you want to know the answer letter for? ":
LOCATE 37, Center
(a$
):
PRINT a$;
aCodedLetter$
= P$: aCodedLetter$
= UCASE$(aCodedLetter$
) theCorrectLetter$ = ""
IF translationMatrix$
(index
, 2) = aCodedLetter$
THEN theCorrectLetter$
= translationMatrix$
(index
, 1) highlightedLetter
= ASC(aCodedLetter$
) - 64 usersCode$
(ASC(aCodedLetter$
) - 64, 2) = theCorrectLetter$
CALL Switch
(theCorrectLetter$
) a$
= "What answer letter do you want the code for? ":
LOCATE 37, Center
(a$
):
PRINT a$;: theCorrectLetter$
= P$: theCorrectLetter$
= UCASE$(theCorrectLetter$
) f$ = P$
clPosition
= ASC(theCorrectLetter$
) - 64 letterCode$ = translationMatrix$(clPosition, 2)
highlightedLetter
= ASC(letterCode$
) - 64 usersCode$
(highlightedLetter
, 2) = UCASE$(theCorrectLetter$
) mode = Easy
LOCATE 22, ((80 - 52) / 2) + (index
* 2) PRINT translationMatrix$
(index
, 1) LOCATE 24, ((80 - 52) / 2) + (index
* 2) PRINT translationMatrix$
(index
, 2) 'just go away
highlightedLetter = 1
ag = TRUE
FOR x
= 1 TO maxLineNumber
IF workingLines$
(x
) <> answerLines$
(x
) THEN ag
= FALSE
CorrectPhrase = ag
DIM newLines$
(1 TO maxLineNumber
):
FOR i
= 1 TO maxLineNumber: newLines$
(i
) = "":
NEXT i
FOR l
= 1 TO maxLineNumber
letter$
= CHR$(highlightedLetter
+ 64) initialLetter$
= MID$(initiallyCodedLines$
(l
), c
, 1) wcl$
= MID$(workingLines$
(l
), c
, 1) newLines$(l) = newLines$(l) + withThis$
newLines$(l) = newLines$(l) + wcl$
FOR index
= 1 TO maxLineNumber
workingLines$(index) = newLines$(index)
FOR c
= 1 TO maxLineNumber
workingLines$(c) = initiallyCodedLines$(c)
usersCode$(xx, 2) = "-"
FOR eachLine
= 1 TO maxLineNumber
LOCATE 13 + eachLine
, leftPositions
(eachLine
) FOR eachLetter
= 1 TO LEN(workingLines$
(eachLine
)) f$
= MID$(workingLines$
(eachLine
), eachLetter
, 1) icl$
= MID$(initiallyCodedLines$
(eachLine
), eachLetter
, 1) correct$
= MID$(answerLines$
(eachLine
), eachLetter
, 1) IF highlightedLetter
= ac
THEN
spaces = 2
spaces = spaces + 3
a$ = "Push 1 to access the hint menu"
a$
= "Push 2 to save the game and quit":
COLOR 14, 1:
LOCATE 45, Center
(a$
):
PRINT a$
PRINT #1, "Tomorrow, and tomorrow, and tomorrow, Creeps in this petty pace from day to day, To the last syllable of recorded time; And all our yesterdays have lighted fools The way to dusty death. Out, out, brief candle! Life's but a walking shadow, a poor player, That struts and frets his hour upon the stage, And then is heard no more. It is a tale Told by an idiot, full of sound and fury, Signifying nothing." PRINT #1, "To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep; To sleep: perchance to dream" PRINT #1, "If someone is able to show me that what I think or do is not right, I will happily change. For I seek the truth, by which no oe ever was truly harmed. Harmed is the person who continues in his self-deception and ignorance." PRINT #1, "Funny lines: Before you marry a person, you should first make them use a computer with slow internet to see who they really are. -- Someone asked me, if I were stranded on a desert island what book would I bring... " + CHR$(34) + "How to Build a Boat." + CHR$(34) PRINT #1, "Funny lines: I finally realized that people are prisoners of their own phones... that's why it's called a " + CHR$(34) + "cell" + CHR$(34) + " phone. -- Be decisive. Right or wrong, make a decision. The road is paved with flat squirrels who couldn't make a decision." PRINT #1, "Funny lines: If at first you don't succeed, then skydiving definitely isn't for you. -- My cell phone is acting up. I keep pressing the Home button but every time I look around, I'm still at work." PRINT #1, "Pangrams: Pack my box with five dozen liquor jugs. -- The quick brown fox jumps over the lazy dog. -- My girl wove six dozen plaid jackets before she quit." numberOfPhrases = 7
numberOfPhrases = 0
numberOfPhrases = numberOfPhrases + 1
numberOfPhrases = numberOfPhrases - 1
FileStatus = numberOfPhrases
Center
= INT((80 - LEN(text$
)) / 2)
P$ = pause$