Created
October 16, 2011 17:54
-
-
Save mrnovalles/1291190 to your computer and use it in GitHub Desktop.
Getting to know who peer reviews a Sci-Writing assignment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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. |
What about using eval:
-module(peer).
-export ([draw/0]).
draw() -> os:cmd("ruby -e 'print %w(Vasia Lalith Mariano).choice'").
Hahah! That's avoiding the problem.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One way could be: