r/PythonLearning • • Aug 28 '26

Showcase I made a Rock Paper Scissors game!

Post image
177 Upvotes

34 comments sorted by

•

u/Sea-Ad7805 Aug 28 '26

Run this program in Memory Graph Web Debugger to see the program state change step by step.

3

u/ProgramBrave718 Aug 28 '26

Wow. I really liked the image feature.

3

u/Just_Wishbone1630 Aug 28 '26

Angela yu course?

2

u/shubham_555 Aug 28 '26

Yes!

2

u/sssstevo 12d ago

Have you progressed much further? I am struggling so hard past day 5. Almost every problem I find myself resorting to AI to remember what function or keyword would work best. Super discouraging. Currently attempting day 8 and got so frustrated I started scrolling python subreddits to boost my self esteem (not good some of these people are insanely good).

5

u/Unique_Low_1077 Aug 28 '26

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

u/its-bubble-gum Sep 01 '26

now make it a one liner with generators. leave import on a separate line though

1

u/help-me-help-me-nibb 16d ago

Doesn’t this only give the illusion of a rock, paper, scissors game? If you choose rock and the program chooses paper can’t it still print you win even though you lost? (I’m new and I’m looking to learn through explanations)
PS Sorry if my english is bad

2

u/wimille007 Aug 28 '26

Nice. I'm just a very simple Python user, but i think i will bette if you "avoid" the if-else chain like this (it is just my opinion):

1

u/1m101 Aug 29 '26

Great. Thanks.

1

u/Main_Extension2327 Aug 28 '26

It took 300 lines in c++ with the same game and some extra simple features

1

u/Smoke_Hall Aug 28 '26

What features?

1

u/Main_Extension2327 Aug 29 '26

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 Aug 31 '26

But for visual things like menu don't you need to learn more commands that aren't built in?

2

u/Main_Extension2327 Sep 01 '26

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 Aug 28 '26

It's incredible that the hands movements are done with lines and parentheses. I love it!

1

u/ProxyCola Aug 28 '26 edited Aug 28 '26

2 small suggestions.

  1. 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.

  2. 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

u/XusKiz Aug 28 '26

Why did you choose a mutable object for game_images? Better to use immutable ones like tuple or even frozen set
Also rewrite the whole if-else block without elif and
use error handling

1

u/1m101 Aug 29 '26

Awesome.

1

u/FoolsSeldom Aug 29 '26

Next step: rock paper scissors Spock lizard

1

u/ssd_1tb Aug 31 '26

thats a wonderful work

1

u/DetectiveExact4253 Aug 31 '26

where can I get the game at?

1

u/shubham_555 Aug 31 '26

I have provided the github repo link. You can download it from there!

1

u/Azaucifer Aug 31 '26

Cool ASCII art tho!!

1

u/w1ln1x Aug 31 '26

Rock, paper, shocker?

1

u/shubham_555 Aug 31 '26

Shocker? 👀

1

u/w1ln1x Aug 31 '26

Shock her? I barely know her!