1 Requires [ simulation ]
7 num := SmallInt atRandom % 3 + 1.
8 'customer has ' print. num print. ' scoop' print.
9 num > 1 ifTrue: [ 's' print ].
16 Simulation subclass: IceCreamStore [
22 self in: obj var: #profit put: 0.0.
28 self addEvent: Customer new at: (self time + (SmallInt atRandom % 5 + 1))
32 'profits are ' print. profit print. '.' printNl.
36 'customer received at ' print. self time print. '.' printNl.
37 profit := profit + (event numberOfScoops asFloat * 0.17).
45 store := IceCreamStore new.
46 [ store time < 15 ] whileTrue: [ store proceed ].