Number reversal game: Difference between revisions

Content added Content deleted
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header, added other whitespace to the task's preamble.)
Line 1: Line 1:
{{task|Games}}
{{task|Games}}

Given a jumbled list of the numbers 1 to 9 that are definitely ''not'' in ascending order, show the list then
;Task:
ask the player how many digits from the left to reverse.
Given a jumbled list of the numbers '''1''' to '''9''' that are definitely ''not'' in
Reverse those digits, then ask again, until all the
ascending order,   show the list then ask the player how many digits from the
left to reverse.   Reverse those digits, then ask again, until all the
digits end up in ascending order.
digits end up in ascending order.


Line 8: Line 10:


Note: Assume the player's input does not need extra validation.
Note: Assume the player's input does not need extra validation.



;Cf.
;Cf.
* [[Sorting algorithms/Pancake sort]], [[wp:Pancake sorting|Pancake sorting]].
*   [[Sorting algorithms/Pancake sort]]
*   [[wp:Pancake sorting|Pancake sorting]].
* [[Topswops]]
*   [[Topswops]]
<br><br>


=={{header|Ada}}==
=={{header|Ada}}==