Skip to content

Instantly share code, notes, and snippets.

@mrnovalles
Created October 16, 2011 17:54
Show Gist options
  • Save mrnovalles/1291190 to your computer and use it in GitHub Desktop.
Save mrnovalles/1291190 to your computer and use it in GitHub Desktop.
Getting to know who peer reviews a Sci-Writing assignment
-module(peer).
-export ([draw/0]).
draw()->
R = random:uniform(100),
io:format ("~w",[r]),
if
R < 33 ->
io:format ("Vasia peer reviews Erisa's S. Writing");
true ->
if
R < 66 ->
io:format ("Lalith peer reviews Erisa's S. Writing");
true ->
io:format ("Mariano peer reviews Erisa's S. Writing")
end
end.
@nruth
Copy link

nruth commented Nov 1, 2011

What about using eval:

-module(peer).
-export ([draw/0]).

draw() -> os:cmd("ruby -e 'print %w(Vasia Lalith Mariano).choice'").

@archie
Copy link

archie commented Nov 2, 2011

Hahah! That's avoiding the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment