Rock, Paper, Scissors, Shoot!

 Making A Game

I've had the good fun of making a version of the classic game, "Rock, Paper, Scissors" (you can click on the link to give it a try). It's one of the projects from The Odin Project that they give you to practice on. Rock, Paper, Scissors, is one of the biggest projects I've worked on and I really enjoyed the process of putting it all together. It was fun to have the code come together to make everything work well.

Rebuilding

I actually made a very basic version of Rock, Paper, Scissors to start a few weeks ago. That means I was actually revisiting a project I had make before, with the challenge of making it a lot more user-friendly. I was pretty surprised to realize that I had to rewrite something like 80% to 90% of the code to make it work with a user interface (updating text, interactive buttons, etc.). It was interesting to have to re-solve a problem I had already solved--setting it up differently meant thinking about it completely differently.

The Code I Didn't Delete

One of the things I noticed was the code I didn't delete. That was the core code which ran the comparison to see if the option chosen by the user beat the computer (which chooses their option at random). I had to rewrite or delete almost everything else. This code was nearly untouched because I still had to do this basic process no matter how I got the user's option as an input. No matter what, I had to figure out who wins a round by seeing which object beats the other (e.g. rock beats scissors). The rest of the code--how I got the user input--needed to be completely rewritten to allow the user to choose their object in a completely new way (clicking a button vs typing in their choice). I'm looking forward to working on more projects and wrapping up the Foundations section on The Odin Project to dive even deeper into JavaScript!

 

Tim David

Comments

Popular posts from this blog

Confronting Busyness

My Coding Journey: Part 2

My Coding Journey: Part 1