Coder Social home page Coder Social logo

number-guesser's Introduction

Tiffany B and Jon K Number Guesser Project

This is the third project assigned to the students of Turing Front End Mod-1. We were asked to create a functional number guessing game and each project was delegated to a two person team.

Goals

Starting range of numbers is between 1 - 100, with the ability for the user to add a custom range.

A random number is generated as the winning number.

Two players are able to enter numbers as a guess.

Buttons available for clearing input fields, resetting game, and displaying error messages.

Return on the guess should indicate whether the guess was too high, too low, or correct.

Display the final results of each match in UI.

Site must be functional.

Example Code

function updateResponseOne() { if (guessOne === ranNum) { responseOne.innerText = "BOOM!; increaseRange(); getTheNumber(low, high); makeCard(); clearGame(); } else if (guessOne < ranNum) { responseOne.innerText = "that's too low"; } else if (guessOne > ranNum) { responseOne.innerText = 'that's too high"; } else { responseOne.innerText = "Try to guess!"; }

function setRange(event) { event.preventDefault(); low = parseInt(minInput.value); high = parseInt(maxInput.value); if (low > high) { disableChallengerField(); errMessage.style.display = 'inline'; alert("Please enter a valid range"); } else { errMessage.style.display = 'none'; }; if (minInput.value === '' || maxInput.value === '') { disableChallengerField(); errMessage.style.display = 'inline'; alert("Please enter a valid range"); }; if (low < high) { enableChallengerField(); minInput.value = ''; maxInput.value = ''; }; getTheNumber(low, high); }

Media Queries

A media query was set when screen size hits 768px to adjust size.

Screenshots

Our Project

image

Turing Comp

image

number-guesser's People

Contributors

tiffanybacher avatar jmkeever070 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.