The assignment called for making a game of rock paper scissors that was played via the console. The user could input their choice into the console, the computer would randomly select its own choice, then a winner is declared.
The Odin Project does a good job of giving you a good place to start building your code without holding your hand through it. They instruct you on what functions would be best to create, then suggest that you can/should rework any functions to be more useful for you.
A few days after completing it, I came across a few creative coding inspirations and had the idea to give my game a UI to make it playable with just a few clicks.
- I tried setting a variable of computerDisplay to be document.getElementById(“computer-turn”) but was getting console errors.
Uncaught TypeError: Cannot read property 'value' of null
- The game scales down for smaller browser sizes, but not quite in the way that I want it to. One downside to using CodePen to develop is that it becomes very tempting and easy to develop specifically for the browser you’re using. It looked great as I resized my browser to smaller and smaller sizes. Not as great when I actually loaded it on my phone. Next update to this will also include a true mobile stylesheet.
One thing that I wish I had done differently was to code more of this in a text editor instead of Code Pen. I love seeing instant results on screen (I am a millennial), but it also would have been cool to see the revision history as this project evolved.
As always, I am learning.