Challenge Suggestion: Mastermind / Moo

Add a reply

Posted by Mark Byers 690 days ago:
I think something could be done in the style of Mastermind / Moo.

See http://en.wikipedia.org/wiki/Mastermind_%28board_game%29 for the rules.

I will post some more info about what I think the challenge could be later...
Posted by Mark Byers 689 days ago:
I have been considering a solver for Mastermind / Moo that can take a list of a player's guesses and the scores he received for each guess, and calculate the unique solution that satisfies all the guesses.

Each line on the input contains the player's guess, followed by the number of correct guesses (bulls), then the number of numbers that are correct but in the incorrect position (cows).

Example Input:

1122 2 0
3344 1 1
1234 1 2
3411 0 4

Example Output:
1143

(Warning: Example done without the help of a computer, so it could be incorrect).

A simpler challenge could be to calculate the score (number of bulls and cows) given a solution and a guess, but if you can do this, I think it is not much more effort to create a complete solver.
Posted by Sartak 682 days ago:
I think something could be done in the style of Mastermind / Moo.

See http://en.wikipedia.org/wiki/Mastermind_%28board_game%29 for the rules.

I will post some more info about what I think the challenge could be later...

I'd also like to see this challenge. The only problem is that it has to be interactive (solution provides a guess, server provides the answer, until the correct answer is found or a maximum number of guesses is reached). Alternatively, the input could be a list of guesses and how they were scored, and it's up to the solution to figure out what the answer is.

I much prefer the interactive version, but that might require some (extensive?) reworking of the judging script.
Posted by Mark Byers 677 days ago:
I was thinking of doing it non-interactive, where the list of all the incorrect guesses and the score for each guess is provided in the input.

I'm not sure if it is possible to make an interactive challenge on Code Golf.
Posted by carldr 677 days ago:
Hi,

No, it's not possible to make the challenge interactive. Of course, we could make it possible!

I like the idea of giving it a set of moves and having to deduce the correct solution from that, although I have a feeling that generating the test cases might be difficult. What do you think?

Carl.
Posted by flagitious 677 days ago:
Ah I was browsing the list of old perl golf problems and saw that they have done this already.

http://terje2.frox25.no-ip.org/~pgas/score.pl?func=rules&hole=65&season=1

I still like the idea. But it might not not be fun for perl users since it would be identical.

BTW tybalt89 won that one.

Add a reply