Bulls and cows: Difference between revisions

Added link to a Scratch solution
m (→‎version 1: changed comments and whitespace.)
(Added link to a Scratch solution)
Line 5,227:
You win!
</pre>
 
=={{header|Scratch}}==
Scratch is a graphical programming language. Follow the link to see an example solution for Bulls and Cows<br>
[https://scratch.mit.edu/projects/370296926/ '''Scratch - Bulls and Cows''']<br>
<br>
The program "says" the score of the current guess and uses a list to display previous guesses.<br>
Malformed guesses are rejected for the following reasons:
* Guess is longer or shorter than 4 characters
* Guess contains character other than the digits 1 - 9
* Guess contains a digit more than once (i.e. 3484 - this would be rejected because "4" appears in the guess two times)
<br>
Since Scratch is an educational language, I've included comments in the code to explain what the program is doing.<br>
 
=={{header|Seed7}}==