Coder Social home page Coder Social logo

daja_vu's Introduction

Exercise Deja Vu: Initialize an integer to represent a favorite number and assign a value with a number of your choosing or you can assign a random number to this variable:

OR

Use prompt() to ask the user to input a number, and store the result in a variable Create an if-statement that if the guessed number is below the initial value, print out “too low”. Create an else-if statement that if the number is higher than the initial value, print out “too high”. Create an else statement that prints out “Congratulations!!!”.

Wait.. We already did this. Yes! But this isn’t as good as it could be. We need to make this number guessing game playable until the user guesses the correct number.

You are required to use a selection statement, loop, and at least one function. After you reach the required functionality, think of ways you could improve the game.

BONUS: Refactor your guessing game to be playable until a correct answer, without using a loop. BONUS: Integers? Boring. Allow for decimals. Let’s say the limit is the one-hundredth decimal place. BONUS: It’s not just a number. The user is guessing an rgb value (0-255). If you’re feeling adventurous, refactor your code to change the game. Be creative, there are no additional requirements.

daja_vu's People

Watchers

 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.