Galton box animation: Difference between revisions
Content added Content deleted
m (Comments and cleanup) |
m (→{{header|REXX}}: elided two separator lines for two one-line subroutines.) |
||
Line 3,218: | Line 3,218: | ||
@.r= center( strip($, 'T'), sw) /*an easy method to build a triangle. */ |
@.r= center( strip($, 'T'), sw) /*an easy method to build a triangle. */ |
||
end /*r*/; #= 0; return /*#: is the number of balls dropped. */ |
end /*r*/; #= 0; return /*#: is the number of balls dropped. */ |
||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
|||
⚫ | |||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
|||
⚫ | |||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
||
drop: static= 1 /*used to indicate all balls are static*/ |
drop: static= 1 /*used to indicate all balls are static*/ |
||
Line 3,256: | Line 3,252: | ||
end /*r*/; if step==freeze then do; say 'press ENTER ···'; pull; end |
end /*r*/; if step==freeze then do; say 'press ENTER ···'; pull; end |
||
return |
return |
||
/*══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════*/ |
|||
/*════════════════════════════════════════════════════════════════──────════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════*/ |
|||
⚫ | |||
⚫ | |||
!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 |
!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 |
!cal: if symbol('!CALL')\=="VAR" then !call=; return !call |