Day 6: Scissors Paper Stone Redux


  1. Play partner's game on your machine.

  2. Read partner's code.

  3. Edit and discuss code together.

  4. Improve each other's projects.

Code Review

On days when projects are due, we will review each others' code in groups of 2 or 3 during class. If there is a group of 3, the triplet will do individual code review together so that everyone gets to review someone else's code, then split into 2 groups for pairing.

1. Run Partner's Code

Open the code in the browser and test it. What does it do? If you're not sure what it does look inside script.js to see.

2. Read Partner's Code

Read the code:

  1. How does it work?

  2. Does it have any obvious errors?

  3. Does it implement something that you were trying to do?

  4. Does it implement a feature that you haven't started yet? How does the code work?

Code Review Reflection Questions

While you are reading, note down the answers to the following questions: No need to be comprehensive, but pick out parts of the code you found notable.

  1. Note a line of code (or multiple lines) that you think works well. This could be the logic of the code, or just a well-named variable. Explain why it works well.

  2. Note a line of code (or multiple lines) that you thought was unclear or you can't figure out. How would you explain why is it unclear or hard to figure out?

  3. Note a line of code (or multiple lines) where you found a bug. Why is it a bug? Do you have a solution?

3. Edit Partner's Code

It may be helpful to make changes to the code to help you understand it better. Write some console.log that would help you figure out what the code does. Break the code in a certain way to prove how it works or doesn't work.

4. Discuss

Once both partners are done with #1-4, discuss what you saw. Read out and review together the answers to the 3 questions you wrote down from above.

Improve Project Together

You'll be pair programming on one person's project at a time.

The driver will be the person who is _not_** working on their own code.**

Once done with one person's code, send the code to your pair (it's their project) via a Slack code snippet. Switch to work on the other person's code.

Work on the game in the following order:

1. Fix Errors

If there are any errors or bugs in a project, pair to fix those problems.

2. Add Features

If there were any features you wanted to implement but couldn't, use this time to pair-program your desired features, or anything else you'd like to see in your game.

If you have nothing else to add, here are some ideas:

A) Multi Game - Guess the Word

Your pair will turn the Scissors Paper Stone game into a Multi game app. Add a mode for a new "guess the secret word" game. The user will type in "word game" (or any secret phrase of your choice) to switch to this mode.

The game itself will be the same as the game in the code example in 4.1

B) Dice Game

Add a third mode to the super game, a guess the dice roll game. The user will enter "dice game" to switch to this mode. (The dice game is the same dice game as the original basic version in 4.1).

3. Comfortable

Continue to add to the Scissors Paper Stone game. Complete the version 1 more comfortable or version 2 more comfortable features that haven't been implemented yet.

Last updated