World Cup group stage: Difference between revisions

m
→‎version 2, generated game sets: added capability to simulate A Cricket World Cup.
(Added Go)
m (→‎version 2, generated game sets: added capability to simulate A Cricket World Cup.)
Line 799:
the   ''list of games''   to be played   (game sets).
 
It's also capable of running a simulation of the Cricket World Cup.
<!-- ........................................................................................................
Programming notes: these are some of the changes from REXX version 1:
Line 829 ⟶ 830:
parse arg teams . /*obtain optional argument from the CL.*/
if teams=='' | teams=="," then teams= 4 /*Not specified? Then use the default.*/
sets=0; win=3; gs= /*the number of sets (so far). */
do j=1 for teams
do k=j+1 to teams; sets= sets+1 /*bump the number of game sets. */
Line 842 ⟶ 843:
do j=1 for sets; r= substr(results, j, 1)
parse var games.j A +1 B /*get the A and B teams*/
if r==0 then @.B= @.B + 3 win /*win for right─most team.*/
if r==1 then do; @.A= @.A + 1; @.B= @.B + 1; end /*draw for both teams*/
if r==2 then @.A= @.A + 3 win /*win for left─most team. */
end /*j*/
call sort 4