Stair-climbing puzzle: Difference between revisions

m
no edit summary
(→‎{{header|zkl}}: added test code)
mNo edit summary
Line 677:
The simulation can then be started as follows:
<lang jq>[0,1] | tco_step_up</lang>
 
=={{header|Julia}}==
As specified, shorter and fewer numbers preferred.
<lang julia>
step_up() = while !step() step_up() end
</lang>
Here is an example to test the code with a step that has a 1/3 failure rate:
<lang julia>
step() = (b = rand([true,true,false]); println(b); b)
step_up()
</lang>
{{output}}
<pre>
julia> step_up()
true
 
julia> step_up()
true
 
julia> step_up()
false
true
true
</pre>
 
=={{header|Liberty BASIC}}==
4,107

edits