Python Forum
A CLI based Rock,Paper or Scissor game.
Poll: Did you like my program?
You do not have permission to vote in this poll.
Yassss
33.33%
1 33.33%
No.
66.67%
2 66.67%
Total 3 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A CLI based Rock,Paper or Scissor game.
#2
I only vaguely looked at your other thread, so forgive me if this is "mean" instead of a "good comment" but:
Line 6 evaluates to 'y', which is probably not what you intended.
Line 12 behaves as it appears you intended, but not for the reasons it looks like. If you change 'y' to 'yes' and play with it you might see why. (Line 64 has the same problem.)
On line 15 you can use random.choice() and skip using an index (I would consider that more elegant, since it skips the implementation detail of the index).
Lines 21 and 22 can be omitted. The other +=0 lines later can be as well.
Line 23 could be even more robust by using player.lower() == "rock".
Lines 25 and 30 can be consolidated into a single on between lines 23 and 24.
Your loop on line 56 could/should just be an if, since you break unconditionally within it. Same with the loop on line 64.
You have logic that looks like the game will restart if a player chooses to do so, but it doesn't actually.
Reply


Messages In This Thread
RE: A CLI based Rock,Paper or Scissor game. - by micseydel - Oct-26-2018, 04:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Another Rock, Paper, Scissors Yoriz 4 3,216 Jun-30-2020, 07:56 PM
Last Post: Yoriz
  The tkinter version of Rock Paper Scissors menator01 3 3,230 Jun-28-2020, 07:15 AM
Last Post: ndc85430
  My version of Rock Paper Scissors menator01 12 6,182 Jun-27-2020, 10:25 PM
Last Post: menator01
  PyQt5 Version of Rock, Paper, & Scissors menator01 8 3,708 Jun-06-2020, 12:15 PM
Last Post: pyzyx3qwerty
  Rock, Paper, Scissors foksikrasa 11 4,392 May-28-2020, 05:58 PM
Last Post: BitPythoner
  Rock Paper Scissor GAME inamullah9 3 3,298 Aug-11-2019, 12:17 PM
Last Post: ichabod801
  A basic Rock-paper-scissors game by me... Unlimiter 0 2,497 Dec-25-2017, 03:41 PM
Last Post: Unlimiter
  Basic Rock, Paper, Scissors CinnamonBeard 1 3,577 Dec-19-2017, 02:32 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020