Stair-climbing puzzle: Difference between revisions

m
(→‎{{header|J}}: add alternative formulation)
m (→‎{{header|J}}: simplify)
Line 165:
isNotUpOne =: -.@(+/@])
 
step_up=: ((] , attemptClimb) ^: isNotUpOne ^:_) &'' NB. no variables or numbers</lang>
Note that J's verbs (functions) must always take an argument i.e. there is no such thing as a niladic verb. Verbs that ignore their arguments (e.g. <code>step</code>) achieve the same effect.
 
892

edits