Anonymous user
Intersecting number wheels: Difference between revisions
m
→{{header|REXX}}: simplified some code, added/changed whitespace and comments, made functions more idiomatic.
m (→Python: Functional composition: Updated primitives, tidied.) |
m (→{{header|REXX}}: simplified some code, added/changed whitespace and comments, made functions more idiomatic.) |
||
Line 1,953:
@.4= ' A: 1 B C, B: 3 4, C: 5 B '
end
do i=1 while @.i\=''; call
call run /*execute " " " " " */▼
end /*i*/
exit
/*──────────────────────────────────────────────────────────────────────────────────────*/
error: procedure; say;
isLet: procedure; parse arg y; return datatype(
isNum: procedure; parse arg y; return datatype(
/*──────────────────────────────────────────────────────────────────────────────────────*/
say; say center(' running the wheel named ' first" ", 79, '─'); $=
gear.n.0= z; if gear.n.z=='' then gear.n.0= 1
if isNum(x) then do;
xx= x /*different gear, keep switching
do forever; nn= xx
if gear.nn.0=='' then call error "a gear is using an unknown gear name:"
zz= gear.nn.0; xx= gear.nn.zz
zz= zz + 1; gear.nn.0= zz; if gear.nn.zz=='' then gear.nn.0= 1
if isNum(xx) then do; $= $ xx; iterate
end
say '('lim "results): " strip($);
{{out|output|text= when using the default inputs:}}
<pre>
|