Bulls and cows: Difference between revisions
Content added Content deleted
No edit summary |
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header, added other whitespace and highlighting to the task's preamble, used article name for link instead of "This".) |
||
Line 1:
{{task|Games}}
[[wp:Bulls and Cows|This]] is an old game played with pencil and paper that was later implemented on computer.▼
▲[[wp:Bulls and Cows|
The task is for the program to create a four digit random number from the digits 1 to 9, without duplication.▼
;Task:
▲
The program should:
::::::* ask for guesses to this number
::::::* reject guesses that are malformed
::::::* print the score for the guess
The score is computed as:
Line 10 ⟶ 18:
# A score of one '''cow''' is accumulated for each digit in the guess that also appears in the randomly chosen number, but in the wrong position.
;C.f.:
* [[Bulls and cows/Player]]
* [[Guess the number]]
* [[Guess the number/With Feedback]]
<br><br>
=={{header|Ada}}==
|