Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Oz 0.61 KB | None | 0 0
  1. declare
  2. fun {p1 L}
  3.    case L
  4.    of nil then nil
  5.    [] X|Xs then
  6.       if X=='ping' then
  7.      {Delay 500}
  8.      {Browse 'pong'}
  9.      1|{p1 Xs}
  10.       end
  11.       if X=='pong' then
  12.      {Delay 500}
  13.      {Browse 'ping'}
  14.      'ping'|{p1 Xs}
  15.       end
  16.    end
  17. end
  18.  
  19. declare
  20. fun {p2 L}
  21.    case L
  22.    of nil then nil
  23.    [] X|Xs then
  24.       if X=='ping' then
  25.      {Delay 500}
  26.      {Browse 'pong'}
  27.      'pong'|{p2 Xs}
  28.       end
  29.       if X=='pong' then
  30.      {Delay 500}
  31.      {Browse 'ping'}
  32.      'ping'|{p2 Xs}
  33.       end
  34.    end
  35. end
  36.  
  37.  
  38.    
  39.  
  40.  
  41. declare
  42. proc {gme p1 p2}
  43.    {p1 thread {p2 'ping'} end}
  44.    %{p2 thread {p1} end}
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement