Stair-climbing puzzle: Difference between revisions
m
→{{header|Standard ML}}: add alternate SML version and fix syntax highlighting
m (→{{header|Wren}}: Minor tidy) |
m (→{{header|Standard ML}}: add alternate SML version and fix syntax highlighting) |
||
Line 1,479:
=={{header|Standard ML}}==
<syntaxhighlight lang="
(*
* val step : unit -> bool
Line 1,490 ⟶ 1,491:
*)
fun step_up() = step() orelse (step_up() andalso step_up())
</syntaxhighlight>
Alternate version:
<syntaxhighlight lang="sml">fun step() = true
fun step_up() = while step() = false do step_up()
</syntaxhighlight>
|