Fundamentals (Paid)
  • 🚀Course Overview
  • Course Logistics
    • 🏫Course Methodology
      • 🧩Course Components
      • 💬Community Channels
      • 🎲Course Projects
    • 💻Required Hardware and Software
      • ☝️Required Software 1
      • ✌️Required Software 2
      • 👍Recommended Setup
    • 🗓️Schedule
    • 💡Tips and Tricks
      • 📒Coding Strategies
      • 🛠️Tooling Pro Tips
    • 🎓Post-Course
      • 🎓LinkedIn Certificates
      • 🚂Bootcamp Admission Criteria
  • 1: Introduction
    • 1.1: What is Coding?
    • 1.2: Web Browsers
    • 1.3: Command Line
    • Additional Resources 1
  • 2: Basic Data Manipulation
    • 2: Operators and Expressions
      • 2.1: Arithmetic Operators | Mathematical Expressions
      • 2.2: Assignment Operators | Variables
    • 2.3: Our First Program
    • Additional Resources 2
  • 3: Structuring and Debugging Code
    • 3.1: Functions
    • 3.2: Errors
    • Additional Resources 3
  • 4: Conditional Logic
    • 4.1: Intro to Logic
    • 4.2: Pseudo-Code, Boolean Or
    • 4.3: Boolean AND, NOT
    • 4.4: Input Validation
    • Additional Resources 4
  • 5: Managing State and Input Validation
    • 5.1: Program Lifecycle and State
    • 5.2: Program State for Game Modes
    • Additional Resources 5
  • 6: Arrays and Iteration
    • 6.1: Arrays
    • 6.2: Loops
    • 6.3: Loops with Arrays
    • Additional Resources 6
  • 7: Version Control
    • 7.1: Git
    • Additional Resources 7
  • 8: GitHub
    • 8.1: Intro to GitHub
    • 8.2: GitHub Fork and Clone
    • 8.3: GitHub Pull Request
    • 8.4: GitHub Repo Browsing
    • 8.5: Deployment
    • Additional Resources 8
  • 9: JavaScript Objects
    • 9.1: JavaScript Objects
    • 9.2: Card Deck Generation with Loops
  • 10: Advanced
    • 10.1 HTML
    • 10.2: CSS
    • 10.3: The Document Object Model
    • 10.4: DOM Manipulation
    • 10.5: Advanced Debugging with Sources Tab
  • 11: POST COURSE EXERCISES
    • DOM
    • Further Readings
  • In-Class Exercises
    • Day 2: Basic File and Data Manipulation
    • Day 3: Functions
    • Day 4: If Statements, Boolean Or, Boolean And
    • Day 5: Program State
    • Day 6: Scissors Paper Stone Redux
    • Day 7: Loops
    • Day 8: Arrays and Loops
    • Day 9: Beat That Redux
    • Day 10: Moar Cards / Chat Bot
    • Day 11: Blackjack Redux, DOM
  • Projects
    • Project 1: Scissors Paper Stone
      • Project 1: Scissors Paper Stone (Part 1)
      • Project 1: Scissors Paper Stone (Part 2)
    • Project 2: Beat That!
    • Project 3: Blackjack
  • Past Projects
    • Drawing With Emojis
    • Guess the Word
Powered by GitBook
On this page
  • Introduction
  • Past Projects
  • Base
  • Win-Loss Record
  • User Name
  • Formatting
  • More Comfortable
  • Reverse Game Mode
  • Korean Scissors Paper Stone
  • Versions
  • Computer vs. Computer
  • Further Variations
  • Submit
  • Reference Solution
  1. Projects
  2. Project 1: Scissors Paper Stone

Project 1: Scissors Paper Stone (Part 2)

✂️📃💎🤩

PreviousProject 1: Scissors Paper Stone (Part 1)NextProject 2: Beat That!

Last updated 8 months ago

Introduction

Part 2 assumes we have learned about global variables, and the More Comfortable section assumes we know how to use as game modes. We'll now update our SPS Part 1 to support .

If you completed the but didn't finish the More Comfortable section, please complete Base for SPS Part 2 before going back to attempting More Comfortable for both parts.

Past Projects

Take a look at past projects by previous Fundamentals students to visualise how the full game can look like.

Base

Win-Loss Record

Add to your program such that it keeps track of the number of times the user has won and the number of times the computer has won. Output this win-loss record in a format you like in the program output. You can also output the number of draws and/or each party's winning percentage if you'd like.

User Name

To make this game more personal, add a feature to collect the user's name as the first input after the page loads. We can prompt the user to enter their name first by adding to the page's HTML. Once the user submits their name, the program can return output to prompt the user to start playing Scissors Paper Stone by entering one of the 3 objects. Use the user's name to personalise win-loss record and other relevant output.

Formatting

The computer chose scissors ✂️.
You chose paper 🗒.

You lose! Bummer.

So far Kai, you've been winning 5/7 turns. Pretty good!

More Comfortable

There is no need to implement all the different features sequentially in one version of your game. Feel free to choose what you find interesting and appropriately challenging and implement only that.

Reverse Game Mode

You decide to prank your friends and create an SPS game mode where the rules are reversed: scissors beat stone, stone beats paper, and paper beats scissors. Create a game mode where if a user types in "reverse", it reverses the SPS rules.

Korean Scissors Paper Stone

Update your program state such that it can keep track of the most recent winner, and update the program logic to declare the most recent winner the ultimate winner when there is a draw.

Versions

Allow the player to select if they want to play normal or Korean versions of the game.

Computer vs. Computer

Add a mode that lets the computer choose for you on each turn.

Further Variations

Submit

Share your work with your Section mates for peer-learning, and with your SLs for review.

  1. Copy code from script.js into a new gist.

    1. Title the Gist and the file as you wish

    2. Share your Gist on your community channel!

  2. Include the following questions, along with your answers, at the top of your gist:

/*
How many hours did you spend on this assignment?:

What part of the assignment did you spend the most time on?:

How comfortable did you feel with this assignment? (1-5):

Is there anything in this code that you feel pleased about?:

What's one aspect of your code you would like specific, elaborate feedback on?:

*/

Share the link to your gist with your Section in your community channel!

Reference Solution

The reference solution implements the Base functionality for both SPS Parts 1 and 2. Please only refer to the reference solution after you have attempted the project. Note that there are many ways to implement the project and the reference solution is only 1 way.

Make the output of your game look nice. You can use the string '<br>' to create in the output. Add the user name and the win/loss record. Format a message depending on how well the player is doing:

The following is adapted from :

In Korea, a two-player upgraded version exists by the name . After showing their hands, the player with the winning throw shouts "muk-jji-ppa!" upon which both players throw again. If they throw differently (for example, rock and paper, or paper and scissors), whoever wins this second round shouts "muk-jji-ppa!" and thus the play continues until both players throw the same item (for example, rock and rock), at which point whoever was the last winner becomes the actual winner.

Implement other variations to the game as described . The user can select which variation they would like to play.

Go to and login with your GitHub account.

for SPS-Part2 (up till More Comfortable).

new lines
Wikipedia
muk-jji-ppa
here
gist.github.com
View the reference solution
Muk-jji-ppa
Regular and Reverse
state
GitHub gist
global varaibles
Base features of SPS Part 1
game states