No such thing as a small change | |
PerlMonks |
Mastermind in 2 linesby jsrn (Sexton) |
on Jul 21, 2003 at 17:15 UTC ( [id://276359]=obfuscated: print w/replies, xml ) | Need Help?? |
This one isn't so much about obfuscation, but more about brevity:
Game rules: The program generates a secret four-digit number, each digit ranging from 1 to 6. The object of the game is to guess this number. In order to achieve this, the player enters a four-digit number consisting of digits from 1 to 6. Now the program does its output: '*' for a digit that has correct value and position '+' for a digit that has correct value and wrong position If the correct number is entered, the game is over and the program quits. Entering '!' also quits the game. Enjoy!
Back to
Obfuscated Code
|
|