This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Carrots084's profile picture

Help with a codebreaking game

Started by Carrots084, 24 June 2014 - 06:11 PM
Carrots084 #1
Posted 24 June 2014 - 08:11 PM
So I have created a basic codebreaking game. 4 letters, if you guess them right then you win. If you don't you lose. Simple. not simple actually. It works fine, but the only code it ever gives is ccce and when you type in the code is displays as CCCC. Here is the code: http://pastebin.com/HZFLNCm4
And down beneath is a screenshot:
http://imgur.com/ndllcfS
Lyqyd #2
Posted 24 June 2014 - 08:49 PM
The first argument read takes is a character mask, like replacing characters with "*" for passwords. It only uses the first character of the mask string, so it won't type out your whole "Code: …" string. If you're trying to do something more complex, you may want to create a modified version of read() that does what you're looking for.