Skip to content

A simple AI game of rock, paper, scissors between the user and a bot

Notifications You must be signed in to change notification settings

blackgirlbytes/rock-paper-scissors-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Rock, Paper, Scissors with Node

rockpaperscissors

How It's Made: Tech used: HTML, CSS, Vanilla JS, and Node.js

I served a simple node sever with the http module. Following that, in the HTML, I made a script tag and made three click functions. One click function, declared the variable rock, which would generate random numbers between 0 and 1. If the random number generated was under .3 then, the user would win with the rock input. If not, the user would lose. I did the same thing for all the other choices, except that paper was between .3 and .66, and scissors was between .66 and 1. Optimizations (optional)

This was a for morning challenge in class. If I had more time, I would add a draw option and I would follow the rules for separation of concerns. Also at this time, I did not how to point the node server to a javascript file.

Lessons Learned: This was first node server set up. I learned about that, and I learned about quick logic.

About

A simple AI game of rock, paper, scissors between the user and a bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published