# Do Pass Go

Example 129

★"Do Pass Go"

Go is a room. "A giant square area, where you and your other pewter ornament friends gather before setting out to purchase London."

The pair of dice is carried by the player.

The pair of dice has a number called first die. The pair of dice has a number called second die. The first die of the pair is 6. The second die of the pair is 6. Rule for printing the name of the pair of dice while taking inventory: say "pair of dice".

Rule for printing the name of the pair of dice: say "pair of dice showing [first die of the pair plus second die of the pair]".

To say detailed state of the dice:

if the first die of the pair is the second die of the pair, say "double [first die of the pair]";

otherwise say "[first die of the pair] and [second die of the pair]".

The description of the pair of dice is "The pair of dice are [if the dice are carried]itching to be rolled[otherwise]showing [detailed state of the dice][end if]."

Rolling is an action applying to one carried thing. Understand "roll [something preferably held]" as rolling.

Check rolling when the noun is not the pair of dice: say "Not something you can roll." instead.

Carry out rolling:

now the pair of dice is in the holder of the actor;

now the first die of the pair of dice is a random number from 1 to 6;

now the second die of the pair of dice is a random number from 1 to 6.

Report rolling:

say "You roll [detailed state of the dice]."

Test me with "i / roll dice / look / x dice / get dice / x dice / roll dice / roll dice / roll dice / roll dice / roll dice / roll dice / roll dice".

Because we remember the states of the individual dice, not just a total, we can make use of the combination rolled.

The doubles count is a number that varies.

After rolling:

if the first die of the pair is the second die of the pair, increment the doubles count;

otherwise now the doubles count is 0;

continue the action.

Jail is a room. "This is Jail, and not the Just Visiting periphery, either."

Every turn when the doubles count is 3:

say "The blue-uniformed policemen blows his whistle and beckons you sternly...";

now the player carries the pair of dice;

now the player is in Jail;

now the doubles count is 0.

Every turn when the doubles count is 1 and the player is in Jail:

say "The warden gruffly releases you.";

now the player carries the pair of dice;

now the player is in Go.

## Test me with "i / roll dice / look / x dice / get dice / x dice / roll dice / roll dice / roll dice / roll dice / roll dice / roll dice / roll dice".

Go

A giant square area, where you and your other pewter ornament friends gather before setting out to purchase London.

>(Testing.)

>[1] i

You are carrying:

a pair of dice

>[2] roll dice

You roll 2 and 3.

>[3] look

Go

A giant square area, where you and your other pewter ornament friends gather before setting out to purchase London.

You can see a pair of dice showing 5 here.

>[4] x dice

The pair of dice are showing 2 and 3.

>[5] get dice

Taken.

>[6] x dice

The pair of dice are itching to be rolled.

>[7] roll dice

You roll 4 and 3.

>[8] roll dice

(first taking the pair of dice showing 7)

You roll 2 and 6.

>[9] roll dice

(first taking the pair of dice showing 8)

You roll 2 and 5.

>[10] roll dice

(first taking the pair of dice showing 7)

You roll 6 and 5.

>[11] roll dice

(first taking the pair of dice showing 11)

You roll double 6.

>[12] roll dice

(first taking the pair of dice showing 12)

You roll 5 and 3.

>[13] roll dice

(first taking the pair of dice showing 8)

You roll 2 and 3.

A giant square area, where you and your other pewter ornament friends gather before setting out to purchase London.

>(Testing.)

>[1] i

You are carrying:

a pair of dice

>[2] roll dice

You roll 2 and 3.

>[3] look

Go

A giant square area, where you and your other pewter ornament friends gather before setting out to purchase London.

You can see a pair of dice showing 5 here.

>[4] x dice

The pair of dice are showing 2 and 3.

>[5] get dice

Taken.

>[6] x dice

The pair of dice are itching to be rolled.

>[7] roll dice

You roll 4 and 3.

>[8] roll dice

(first taking the pair of dice showing 7)

You roll 2 and 6.

>[9] roll dice

(first taking the pair of dice showing 8)

You roll 2 and 5.

>[10] roll dice

(first taking the pair of dice showing 7)

You roll 6 and 5.

>[11] roll dice

(first taking the pair of dice showing 11)

You roll double 6.

>[12] roll dice

(first taking the pair of dice showing 12)

You roll 5 and 3.

>[13] roll dice

(first taking the pair of dice showing 8)

You roll 2 and 3.