% From section 5.2.2 of CTM \insert 'NewPortObject2.oz' declare fun {Player Others Me} {NewPortObject2 proc {$ Msg} {Browse got(Me Msg)} case Msg of ball then Ran={OS.rand} mod {Width Others} + 1 in {Delay 1000} {Send Others.Ran ball} end end} end P1 = {Player others(P2 P3) 1} P2 = {Player others(P1 P3) 2} P3 = {Player others(P1 P2) 3} {Browse P1} {Browse P2} {Browse P3} {Send P1 ball}