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: | Line 1: | ||
{{task|Games}} |
{{task|Games}} |
||
⚫ | |||
⚫ | |||
⚫ | |||
The program should ask for guesses to this number, reject guesses that are malformed, then print the score for the guess. |
|||
;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: |
The score is computed as: |
||
Line 10: | Line 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. |
# 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. |
||
;Cf, |
|||
;C.f.: |
|||
* [[Bulls and cows/Player]] |
* [[Bulls and cows/Player]] |
||
* [[Guess the number]] |
* [[Guess the number]] |
||
* [[Guess the number/With Feedback]] |
* [[Guess the number/With Feedback]] |
||
<br><br> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |