r/programminghorror • • Sep 25 '26

Javascript Rock paper scissors

Post image

I'm way too proud of this solution haha

288 Upvotes

27 comments sorted by

View all comments

Show parent comment

1

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Sep 25 '26

3 also works if they are 1 indexed.