Galton box animation: Difference between revisions

m
→‎{{header|REXX}}: elided two separator lines for two one-line subroutines.
m (Comments and cleanup)
m (→‎{{header|REXX}}: elided two separator lines for two one-line subroutines.)
Line 3,218:
@.r= center( strip($, 'T'), sw) /*an easy method to build a triangle. */
end /*r*/; #= 0; return /*#: is the number of balls dropped. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
run: do step=1; call drop; call show; end /*step*/ /*'til run out of balls.*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
halt: say '***warning*** REXX program' !fn "execution halted by user."; exit 1
/*──────────────────────────────────────────────────────────────────────────────────────*/
drop: static= 1 /*used to indicate all balls are static*/
Line 3,256 ⟶ 3,252:
end /*r*/; if step==freeze then do; say 'press ENTER ···'; pull; end
return
/*══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════*/
/*════════════════════════════════════════════════════════════════──────════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════*/
run: do step=1; call drop; call show; end /*step*/ /*'til run out of balls.*/
halt: say '***warning*** REXX program' !fn "execution halted by user."; exit 1
!all: !!=!;!=space(!);upper !;call !fid;!nt=right(!var('OS'),2)=='NT';!cls=word('CLS VMFCLEAR CLRSCREEN',1+!cms+!tso*2);if arg(1)\==1 then return 0;if wordpos(!,'? ?SAMPLES ?AUTHOR ?FLOW')==0 then return 0;!call=']$H';call '$H' !fn !;!call=;return 1
!cal: if symbol('!CALL')\=="VAR" then !call=; return !call