daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -module(pinging).
  2. -export([run/1]).
  3.  
  4. run(Kissa) ->
  5.         Pid = spawn(fun ping/0),                
  6.         case Kissa of
  7.                 miau -> Pid ! self(),
  8.                                         receive
  9.                                                 pong -> okkissa
  10.                                         end;
  11.                 mau  -> Pid ! {kissa, self()},
  12.                                         receive
  13.                                                 "moi kissa täällä!" -> "kissa vastas!"
  14.                                         end
  15.         end.
  16.  
  17. ping() ->
  18.         receive
  19.                 {kissa, From} -> From ! "moi kissa täällä!";
  20.                 From -> From ! pong
  21.         end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top