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
2
votes
3answers
3k views

Rock, Paper, Scissors game in JavaScript

I built this as part of completing the Codecademy JavaScript lesson. I wanted to perfect it, make it readable and functional, and as efficient as possible. As far as I can tell it can't be any more ...
2
votes
2answers
52 views

OOP, FP and IMP condensed in Rock, Paper and Scissors

Rock Paper and Scissors is a pretty basic program. The reason I wrote this program is because I wanted to see what a small script that used all of the main programming paradigms looked like. My code ...
6
votes
2answers
235 views

Python rock paper scissors

My code implementing rock, paper and scissors in Python, using dicts to hold choices. ...
1
vote
1answer
127 views

RockPaperScissorsV2 follow-up Advanced

I have posted my first version of RockPaperScissors a while back. It was on an old version of python with improper use of some functions. This version was updated to a more recent version of python ...
6
votes
3answers
1k views

Rock Paper Scissors with scores and save file

I've implemented the classic game Rock Paper Scissors with scores, and a save file implementation. I'm looking particularly for ways to get rid of all the self.'s. ...
1
vote
4answers
2k views

Java Rock/Paper/Scissors Game

For my computer science class I am tasked with writing a rock/paper/scissors game. I understand how to write the game, but I was wondering if someone more experienced than I could give me some ...
6
votes
2answers
4k views

Rock, Paper, Scissors 3-part

Write a program that lets a user play "Rock, Paper, Scissors" against the computer. The program should ask the user to choose one of the three choices, and then the computer randomly picks one (...
7
votes
2answers
1k views

Rock Paper Scissors game in Python

I'm new to programming and I'm trying to teach myself Python through some online books. One of the exercises has me making a Rock Paper Scissors game. The one I have written works well enough I think,...
3
votes
1answer
218 views

Rock, Paper, Scissors, Lizard and Spock - Relational Paradigm

I found a few question about the game and IMHO it's a relational problem and better addressed by set logic. Thus I created this solution in SQL to get away from ugly JavaScript, elegant java and ...
6
votes
2answers
343 views

Rock, Paper, Scissors, Lizard and Spock with OOP

Today I saw an extremely interesting question on the Rock, Paper, Scissors, Lizard and Spock game. I've decided to take my swing at it and I've written the following OOP implementation: ...
22
votes
6answers
4k views

Rock, Paper, Scissors, Lizard and Spock

I am currently done with this little Rock, Paper, Scissors, Lizard, Spock game in JavaScript. The game is working fine, but I am not pleased with the code. Is there a way to refactor these ...
-1
votes
1answer
3k views

Console-based Rock-Paper-Scissors game

I just began my C# debut and was just wondering if this Rock-Paper-Scissor console app is good and flexible. ...
2
votes
2answers
239 views

Python Command Line Rock Paper Scissors

I'm looking for tips on how to clean up this code and/or make it more efficient. Keep in mind I am a seriously new programmer and if it is too advanced it's likely to go over my head. ...
7
votes
2answers
3k views

Rock-paper-scissors Game in C++

Below you will find my first attempt at a C++ implementation of the classic game Rock-paper-scissors. If someone could look it over and point out or suggest any things that I could change to improve ...
5
votes
3answers
3k views

Object-oriented rock-paper-scissors game

This is my code for a simple rock-paper-scissors game. Users have the choice between playing against a computer or watching a "computer player" play another "computer player". The code for the ...
22
votes
4answers
3k views

Rock-Paper-Scissors

I was given this exercise: Build a game in which two players compete in a game of Rock-Paper-Scissors with different strategies. Who will win more rounds? The rules: Scissors beats ...
5
votes
2answers
770 views

Rock Paper Scissors game

This is a very simple rock paper scissors game implemented in Haskell. ...
3
votes
3answers
217 views

RockPaperScissor in Python

This is a simple Rock - Paper - Scissor game. I'm trying to find a better way to write the algorithm and keeping the scoreboard. ...
4
votes
1answer
213 views

Interactive Rock Paper Scissors

I am a beginner in programming and this is the third program I've written. This is an interactive game of rock, paper, scissors, capable of being modified to any number of turns. I would love to see ...
9
votes
5answers
43k views

Simple Rock, Paper, Scissors in Python

I have looked at many different approaches to this game online, but as someone who isn't very experienced with Python, I may not be aware of what others are doing right. ...
8
votes
3answers
5k views

Rocks, Paper Scissors game

I wrote a Rock Paper Scissors game and was hoping to get some feedback on issues like: Am I utilizing object oriented techniques correctly? What can I do better? Am I using ...
2
votes
1answer
647 views

Another Rock Paper Scissors in plain JavaScript

Outside of the jQuery DSL I've hardly ever written any JavaScript. I never bothered learning JavaScript until a couple of months ago. After a slow start I got stuck in and created this game today. I ...
8
votes
2answers
2k views

Rock-Paper-Scissors-Lizard-Spock game

There was a fairly strangely written RPSLS game on Stack Overflow here. That inspired me (read: I was bored and figured it would be fun) to write a better one. But I'm not sure what else there is ...
9
votes
4answers
1k views

Scissors, Paper, Rock in Python

The game works, but I was wondering if anyone could help me with better structure for the code, simplification, or just any other improvements. ...
4
votes
2answers
1k views

Rock-Paper-Scissors in procedural and object-oriented

I am comfortable with the procedural style, and learning the object oriented, so I have done a small Rock Paper Scissors game in both styles. This script is in procedural style and this one is in ...
15
votes
1answer
668 views

Cheese-Burger-Waffles (aka Rock-Paper-Scissors)

FizzBuzz was fun, and I got great feedback and learned a few things (which I hope I put in practice here), but only scratched the surface. I wanted to explore the LOLCODE language a bit more, so I ...
7
votes
1answer
622 views

Trying to grasp OOP Rock, Paper, Scissors program

I'm trying to wrap my head around OOP but so far I feel like I'm just moving functions into classes and calling them methods. I am trying to create a "Rock Paper Scissors" game using OOP best ...
7
votes
4answers
847 views

Index mechanics for Rock Paper Scissors

I just went through a very easy online example creating a Rock-Paper-Scissors game, but it seemed like it was not a great use of computing power. It seemed like I was writing out results for every ...
10
votes
3answers
12k views

Rock, Paper, Scissors Game in Java

I made a Rock, Paper, Scissors game and would like the code to be reviewed. Main class: ...
8
votes
1answer
5k views

Rock Paper Scissors in JavaScript

In a few weeks I need to give a workshop about JavaScript to colleagues. They do not have much experience with JavaScript so I will explain the basics of JavaScript. At the end of the day I want them ...
2
votes
2answers
5k views

Rock, Paper, Scissors game

I am very new to Ruby and building my first game. To be honest I did it this way because I was lazy to type so much. My friend told me that the correct way was to do this with case statement i.e. for ...
11
votes
2answers
920 views

Rock, paper, scissors

This is something I wrote as a reply to a deleted "Rock/paper/scissors [updated]" question. Since I can't post it as an answer (and the line-by-line analysis is gone as well), it might be nice to get ...
5
votes
1answer
5k views

Rock, Paper, Scissors in Python

I was eventually going to add another computer and more options to this (i.e., Rock-paper-scissors-lizard-Spock) but I wanted to make sure I was using the best practice for this type of game. Any help ...
15
votes
3answers
1k views

Basic Rock-Paper-Scissors implementation

I decided to try to make a simple RPS implementation in Java 8, the following notes should be said first: At a later point it should support RPSLS aswell, as any other Gesture-game variant. At a ...
12
votes
1answer
139 views

RPSLSMB OOP Version 2

Rock Paper Lizard Spock Monkey Banana My original post Based off of Malachi's post I've changed the way rules work in this version to allow ties to result in double loss or double win. While ...
7
votes
3answers
394 views

RPSLS game revisited. Is my design better than previous attempts?

This question is a follow up to these questions: RPSLS Game in C# Ensuring user input is an integer in a range RPSLS is less messy now, but is it clean? Right now I have a couple of ideas in the ...
8
votes
3answers
173 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
456 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
213 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
10k 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
276 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 ...
17
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
788 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 ...
40
votes
4answers
4k 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
1k 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 ...