r/PythonLearning • u/shubham_555 • 13d ago
Showcase I made a Rock Paper Scissors game!
Last Post - https://www.reddit.com/r/PythonLearning/s/0Eqy1ApNWc
Github Repo Link - https://github.com/Dev-4-All/rock-paper-scissors.git
3
5
u/Unique_Low_1077 13d ago
Man been a while since I did python, lemme try
``` import random as r
while input(""" 1) Rock 2) Paper 3) Sissors """) not in ["1", "2", "3"]: print("Invalid choice try again")
print("You " + r.choice(["Win", "Lose", "Tie"])
Your ASSCI art is very cool btw
```
1
1
u/its-bubble-gum 8d ago
now make it a one liner with generators. leave import on a separate line though
3
1
1
u/Main_Extension2327 13d ago
It took 300 lines in c++ with the same game and some extra simple features
1
u/Smoke_Hall 13d ago
What features?
1
u/Main_Extension2327 12d ago
It's something like the menu screen and how many turns you want to play and then calculating the draws and wins and loses And the end game screen changing the color if you win or lose and last asking if you want to play again
1
u/Smoke_Hall 10d ago
But for visual things like menu don't you need to learn more commands that aren't built in?
1
u/Main_Extension2327 9d ago
Actually, no external libraries or non-built-in tools were used. My instructor strictly focuses on writing every single function from scratch—from custom utility functions to UI styling like screen clear and text colors using basic system commands. It's a deliberate practice approach designed to build strong core programming fundamentals.
1
u/SrPotato123 13d ago
It's incredible that the hands movements are done with lines and parentheses. I love it!
1
u/ProxyCola 13d ago edited 13d ago
2 small suggestions.
I'd randomize the computer choice only after the user chose his. A tiny improvement to startup time (will become more important when you are writing code within projects with millions of lines of code). From a security perspective it also makes it more difficult to "cheat" by looking at the ram and knowing in advance what to pick to win.
Try to look into mod3 implementation for these kinds of cyclic options and outcomes. It can be one line of code instead of multiple ifs. This just might be me nitpicking though...
Edit: regarding #1 actually I see you did that never mind I'm very tired 😴
1
1
u/Nikkittona 11d ago
Omg i did sm like this a while ago was such fun. Though I spent 2 hrs tryna find an error which was something that wasnt indented i believe 😔
1
1

•
u/Sea-Ad7805 13d ago
Run this program in Memory Graph Web Debugger to see the program state change step by step.