Implementing Caching into the Rock, Paper, Scissors Game

After reviewing the Rock, Paper, Scissors game code, I realized that there was a bug with the computer guessing mechanism. In this guide we’re going to walk through how to implement caching in order to correct the issue.

Summary

Refactor the Rock, Paper, Scissors class by implementing caching for the computer guessing method.

Exercise File

Code File

Exercise Description

There’s currently a subtle bug with the Rock, Paper, Scissors game we built a few days ago. Work through the implementation code provided in order to see how caching can correct the issue.

Real World Usage

After reviewing the Rock, Paper, Scissors game I realized that there was an issue with the computer guessing component of the class. This is a great example of how subtle bugs can make their way in programs and, more importantly, how to fix them. Additionally, in order to correctly fix this bug you’ll need to integrate caching, which is a critical feature in a large number of applications and algorithms.

Solution

Can be found on the solutions branch on github.

Jordan Hudgens

view all post
Leave a comment

Please be polite. We appreciate that.

By Daniele Zedda • 18 February

← PREV POST

By Daniele Zedda • 18 February

NEXT POST → 34
Share on