Questions tagged [rock-paper-scissors]

Rock Paper Scissors is a game where two (or more) players compete against each other, with each player picking rock, paper, or scissors.

Filter by
Sorted by
Tagged with
8
votes
3answers
187 views

RPSLS refactored to Object Oriented

I wrote a couple reviews for this CR post. In my most recent review, I refactored @Malachi 's code to fit OO design. I'm looking for any advice/hints/criticisms on it. A review is welcome for both ...
12
votes
3answers
473 views

RPSLS is less messy now, but is it clean?

This is a follow up to the following questions: RPSLS Game in C# Ensuring user input is an integer in a range I haven't made my way to DecideWinner() yet, but ...
10
votes
2answers
216 views

RPSLS yet again

I guess I'm a little late with my entry to this code challenge mentioned here, but I decided the world must need yet another RPSLS implementation to critique. ...
3
votes
1answer
11k views

Use if/else/elif conditionals to write a basic Rock Paper Scissors game

I have the following code for the Rock, Paper, Scissor game. The code works fine in Python 2.7. Are there other more concise, more readable, or more pythonic ways of solving this problem in Python? <...
7
votes
3answers
279 views

Directly accessing class attributes in Rock Paper Scissors

I am reading a beginning Python programming book and in it the author says that you want to avoid accessing a class' attributes directly, but instead to create methods that return attribute values. ...
17
votes
3answers
4k views

RPSLS Game in C#

I went with what I know and can use well, not what I know and can't figure the syntax out to make it look good. So please enjoy the code and prepare to school me (probably in the basics) in C# ...
14
votes
2answers
2k views

Rock Paper Scissors Lizard Spock Revisited

Continuing the spirit of the recent Weekend Challenge, here is a revised version of the RPSLS game. This is a follow up to my previous submission: Rock Paper Scissors Lizard Spock as a code-style ...
18
votes
2answers
3k views

Rock-Paper-Scissors-Lizard-Spock challenge in C++

Here's my take at the Rock-Paper-Scissors-Lizard-Spock challenge. The outcomes are as follows: Scissors cuts paper paper covers rock rock crushes lizard lizard poisons Spock Spock ...
11
votes
2answers
1k views

Rock-Paper-Scissors-Lizard-Spock Challenge, take 2

This post is following-up on Rock-Paper-Scissors-Lizard-Spock Challenge I had a gut feeling that I was somehow abusing IComparable<T>, @svick's answer ...
12
votes
2answers
845 views

Another Rock Paper Scissors Lizard Spock implementation

The Challenge Create an implementation of "Rock - Paper - Scissors - Lizard - Spock". The rules: Scissors cuts paper, paper covers rock, rock crushes lizard, lizard poisons Spock, Spock smashes ...
41
votes
4answers
5k views

Rock-Paper-Scissors-Lizard-Spock Challenge

"Scissors cuts paper, paper covers rock, rock crushes lizard, lizard poisons Spock, Spock smashes scissors, scissors decapitate lizard, lizard eats paper, paper ...
11
votes
2answers
3k views

Rock Paper Scissors Lizard Spock as a code-style and challenge

The following is a program that lets a Human play "Rock Paper Scissors Lizard Spock" against the computer... (almost playable at: http://ideone.com/EBDlga) Note I have posted a follow-up question ...
4
votes
4answers
2k views

Rock paper scissors

I've started learning Python recently and I wanted to test myself. So, can you tell me how many I would get out of 10 and how I could improve my future coding? ...
3
votes
1answer
4k views

How do I make my Rock-Paper-Scissor program more JavaScript-like?

I have implemented my first program in JavaScript, Rock-Paper-Scissors. I would like JavaScript developers to help me make this program more JavaScript-like by following the idioms of the language. I ...
4
votes
3answers
11k views

Rock, Paper, Scissors game assignment

This is an assignment that I have already turned in. It works great, but I was wondering if there are any flaws in the code, or how to write it in a more pythonic way. ...
5
votes
3answers
6k views

Simplification and efficiency suggestions for “Rock, Paper, Scissors” game

I wrote this program for an exercise in Bjarne Stroustrup's text Programming -- Principles and Practice Using C++. He recommended using a vector for pseudo ...
6
votes
2answers
1k views

Is there a way to make my Rock, Paper, Scissors game more concise?

I am learning JavaScript and I just wrote a Rock, Paper, Scissors game that will first prompt the two players for their choices and validate them. In the event of a tie, each player will choose their ...
12
votes
2answers
20k views

Rock Paper Scissors in one single method in Java - Good or bad?

I'm new to programming and have created a simple Rock, Paper, Scissors game. The entire program is under a single class and the main method. I hear that's probably not the best way to code. How ...
3
votes
3answers
358 views

Making my Rock, Paper, Scissors game shorter

I am looking for advice on making the following code shorter. Any help is appreciated. ...
7
votes
1answer
413 views

First attempt at writing Rock Paper Scissors game

I made this Rock Paper Scissors game and I would like for this to be critiqued. ...
2
votes
2answers
3k views

OOP in Rock, Paper, Scissors program

This is an OOP Rock, Paper, Scissors program I wrote in Python. I am just learning about using classes and I'd appreciate some advice on improving it. ...
12
votes
6answers
17k views

Does my Rock Paper Scissors game look good?

I'm doing some homework and am just curious if everything I've done looks good and/or if you'd suggest I modify something to keep with "javaese." ...
4
votes
2answers
10k views

Rock-Paper-Scissors game

This is the first piece of code I wrote on my own. I tried to use everything I know, like functions, loops and variables. Is it good or could it be simpler? Please be hard as you can be with me ...
2
votes
1answer
468 views

My first RSpec test - Rock Paper Scissors

I'm relatively familiar to Ruby, but I'm brand-new to testing code. I've decided to use RSpec because as it seems like a popular option. The game works perfectly, but the spec has a lot of repetition ...
11
votes
7answers
4k views

Rock Papers Scissors in Python

I am a newbie to Python and have started object-oriented programming recently. I have implemented a "Rock Paper Scissors" application in OOP. I would like for you to evaluate my code, and tell me ...