World Cup group stage: Difference between revisions
Content added Content deleted
m (→version 2, generated game sets: added comments, changed a literal definition style.) |
|||
Line 946: | Line 946: | ||
This REXX version can also simulate a Cricket World Cup (by specifying '''2''' for the '''win''' variable). |
This REXX version can also simulate a Cricket World Cup (by specifying '''2''' for the '''win''' variable). |
||
<!-- ........................................................................................................ |
|||
Programming notes: these are some of the changes from REXX version 1: |
Programming notes: these are some of the changes from REXX version 1: |
||
:::* the number of teams that are playing can be specified from the command line. |
:::* the number of teams that are playing can be specified from the command line. |
||
Line 976: | Line 976: | ||
:::* used an idiomatic method to show the place winners. |
:::* used an idiomatic method to show the place winners. |
||
:::* added the capability to simulate a Cricket World Cup. |
:::* added the capability to simulate a Cricket World Cup. |
||
............................................................................................................. !--> |
|||
<lang rexx>/*REXX pgm calculates world cup standings based on the number of games won by the teams.*/ |
<lang rexx>/*REXX pgm calculates world cup standings based on the number of games won by the teams.*/ |
||
parse arg teams win . /*obtain optional argument from the CL.*/ |
parse arg teams win . /*obtain optional argument from the CL.*/ |
||
Line 1,009: | Line 1,008: | ||
say /* [↓] build grid line for the box*/ |
say /* [↓] build grid line for the box*/ |
||
L= length($.1) -2; $$= translate( translate( left($.1, L), , 0123456789), '─', " ") |
L= length($.1) -2; $$= translate( translate( left($.1, L), , 0123456789), '─', " ") |
||
say left('', 15) center( |
say left('', 15) center("points", L) /*display the boxed title. */ |
||
say left('', 15) "╔"translate($$, '═╤', "─│")'╗' /*display the bottom sep for title.*/ |
say left('', 15) "╔"translate($$, '═╤', "─│")'╗' /*display the bottom sep for title.*/ |
||
p= 0 |
p= 0 |