r/badcode • u/fnieidhfenmbvfekh • Mar 30 '23
python Another legendary code from high-school. This one was in Python though. This is for a rock-paper-scissors game.
357
Upvotes
r/badcode • u/fnieidhfenmbvfekh • Mar 30 '23
2
u/[deleted] Mar 30 '23 edited Jul 04 '23
fuck u/spez
115
u/GamesRevolution Mar 30 '23
While the code is bad, but the ideia of you and a friend playing a game of rock paper scissors on the same screen and inputting the choice is hilarious to me. That's why I always added a random option for the second player
81
u/thekwoka Mar 30 '23 edited Mar 30 '23
let's get stupid
Rock paper scissors doesn't need an if tree or switches. Just math.
14
u/dom25b Mar 30 '23
'''PLAYER_1 = player_1.upper()''' friggin killed me dude
39
u/mfb- Mar 30 '23
If you are player 1, just pick rock. Tell the other player you picked rock. What is your opponent going to do, pick paper? Congratulations, you win!
9
u/LordJac Mar 30 '23
I'd say this isn't bad for a beginner. Certainly has issues but for someone that only just learned how to use loops and conditionals, this is about what I'd expect. I've seen worse from my students.
5
u/gl1tch3t2 Mar 30 '23
I think the best thing is that not only do we get a return to the comment "printing an appropriate response" which we saw in the last post but also that the appropriate response is just "Error." if something failed.
3
u/sthedragon Mar 30 '23
I’m in love with this code. Why are there four options for each player? Why use elif instead of else? Why are the comments like that? I wrote a 5,000-line text-based video game in high school and I doubt it ever looked worse than this.
1
u/DarkRMajesty Apr 07 '23
The code isn't even that horrible for a beginner - It's the comment on every bloody line
1
u/Taksin77 Mar 30 '23 edited Jul 07 '23
Wer mit Ungeheuern kämpft, mag zusehn, dass er nicht dabei zum Ungeheuer wird. Und wenn du lange in einen Abgrund blickst, blickt der Abgrund auch in dich hinein. -- mass edited with redact.dev
1
u/Noslamah Mar 31 '23
Fucking lmao
1
u/SM_DEV depraved Mar 31 '23
Ouch!
0
u/Flimsy-Combination37 Mar 30 '23
Here is my take at making a rock paper scissors game that checks inputs to make sure they are valid and keeps track of the score.
0
u/[deleted] Mar 30 '23
[deleted] — view deleted comment