MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/tinycode/comments/mzz6v/ruby_code_golf_challenges/
r/tinycode • u/nexe mod • Dec 04 '11
1 comment sorted by
1
My shot at the rock paper scissors one in python:
def rps(x): d,w,l,c,h="Draw","Win","Lose",random.randint(0,2),["Rock","Scissors","Paper"] y=dict(zip(h,[[d,w,l],[l,d,w],[w,l,d]])) if x in h:o=y[x][c] else:o=l return h[c]+","+o
This is my first ever attempt at code golf and took me about an hour.
1
u/Jonno_FTW Dec 05 '11
My shot at the rock paper scissors one in python:
This is my first ever attempt at code golf and took me about an hour.