ForeverDev

shortest functioning rock, paper, scissors..?

Oct 8th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.15 KB | None | 0 0
  1. repeat;c=({'r','p','s'})[math.random(3)]i=io.read()print(c==i and'tie'or(c=='r'and i=='s'or c=='p'and i=='r'or c=='s'and i=='p')and'lose'or'win')until nil
Advertisement
Add Comment
Please, Sign In to add comment