Lines Matching full:code
29 The <code>score</code> type stores the scores of the current and opposing
38 The <code>action</code> type is a function that takes a <code>score</code>
39 and returns the resulting <code>score</code> and whether the current turn is
43 If the turn is over, the <code>player</code> and <code>opponent</code> fields
44 in the resulting <code>score</code> should be swapped, as it is now the other player's
52 The functions <code>roll</code> and <code>stay</code> each return a pair of
53 values. They also match the <code>action</code> type signature. These
54 <code>action</code> functions define the rules of Pig.
61 A <code>strategy</code> is a function that takes a <code>score</code> as input
62 and returns an <code>action</code> to perform. <br/>
63 (Remember, an <code>action</code> is itself a function.)
73 least k points in a turn, and then stay. The argument <code>k</code> is
74 enclosed by this function literal, which matches the <code>strategy</code> type
79 We simulate a game of Pig by calling an <code>action</code> to update the
80 <code>score</code> until one player reaches 100 points. Each
81 <code>action</code> is selected by calling the <code>strategy</code> function
86 The <code>roundRobin</code> function simulates a tournament and tallies wins.
87 Each strategy plays each other strategy <code>gamesPerSeries</code> times.
91 Variadic functions like <code>ratioString</code> take a variable number of
96 The <code>main</code> function defines 100 basic strategies, simulates a round