fork download
  1. declare fun {NewPortObject2 Proc}
  2. Sin in {Browse Sin}
  3. thread for Msg in Sin do {Proc Msg} end end
  4. {NewPort Sin}
  5. end
  6.  
  7. declare fun {Player Others}
  8. {NewPortObject2 proc {$ Msg}
  9. case Msg of ball(X) then
  10. Ran={OS.rand} mod {Width Others}+1
  11. in if X<50 then {Delay 3000} {Send Others.Ran ball(X+1)} end
  12. else skip
  13. end
  14. end}
  15. end
  16.  
  17. P1={Player others(P2 P3 P4 P5)}
  18. P2={Player others(P1 P3 P4 P5)}
  19. P3={Player others(P1 P2 P4 P5)}
  20. P4={Player others(P1 P2 P3 P5)}
  21. P5={Player others(P1 P2 P3 P4)}
  22. in
  23. {Send P1 'GraczA'}
  24. {Send P2 'GraczB'}
  25. {Send P3 'GraczC'}
  26. {Send P4 'GraczD'}
  27. {Send P5 'GraczE'}
  28. {Send P1 ball(1)}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Mozart Compiler 1.4.0 (20080704) playing Oz 3

%%% feeding file prog.oz

%********************* binding analysis error *******************
%**
%** variable Browse not introduced
%**
%** in file "./prog.oz", line 2, column 9
%** ------------------ rejected (1 error)
stdout
Standard output is empty