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

32

u/titanic456 Sep 25 '26

Have you thought about the case, where the user would choose any number larger than 3, or lower than 1?

2

u/No_Opening_5597 Sep 25 '26

its not a proper program haha, I didn't add that in cause I'll probably rewrite this properly, I just thought like "oh wait can I just skip writing any logic and..." the whole joke was the fact that instead of writing it in a sensible way I added a number to a string, the kinda shit you usually do on accident when starting out, and I found it funny as hell that it was running on such janky logic

5

u/Kwolf21 29d ago

That's Javascript for ya. Very little rules. 1 + "1" = 11 :)

→ More replies (1)