Problem: give the smallest possible complete program that, when run, plays a
game of Mastermind in the following way: it accepts any number of guesses on
standard input in the form of 4 digits followed by a newline. The digits must
be between 1 and 6. If your guess is incorrect, it will print 0 or more *s,
signifying the number of digits that are correct and in the proper position,
followed immediately by 0 or more +s, indicating the number of digits which are
correct but in the wrong position, followed by a newline. If all digits are
correct, the program prints "Tries: n\n" where n is the number of tries, then
exits. All output is done to standard output.
perl: 164
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters