Giter Club home page Giter Club logo

game-guess-the-number's Introduction

Javascript: Let's play a game!

Guess the number

Β‘Hola mundo!

As a way to practice my Javascript skills I did a game: Guess the number - Humankind vs. Machine. It's a very simple game, the machine will pic a secret random number and you have to guess it. If you can't, no problem, there will be some hints. It's play time!✨

Initial Requirements πŸ“‹

  • Small and simple HTML
  • A random number between 1 to 100 must be generated only once
  • The user number guess must be between 1 to 100
  • In the clue box the user will find if his guess is too low or high
  • If the user guess is correct a congratulations message will appear.
  • There is a counter of how many times the user has tried to guess the number.

Extra features πŸ”₯

  • After 5 attempts a "give up" button is generated. This button will show the correct number and will also disable future attempts.
  • Winner animation.

Tech πŸ’»

Starring: Adalab Web Starter Kit - An amazing template that allowed me to use a local host, SASS, HTML Template Engines and gulp. For more information you may visit the Kit repository

Built with πŸ”¨

  • Visual Code Studio: as code editor
  • HTML
  • SASS
  • Javascript

Development ⌨️

At first, I started building a simply form HTML with some styles. After it I went all in with the functions and events.

First of all I wrote in a paper the user story so I could see the needed functions clearer. I started doing the random number event. I wanted it to be generated as the user loaded the page so it wouldn't generate again in the click event.

At last I went to the handler function that consist in a numberValidator function and the counter.

For the extra features I refactored my HTML to partials and added all the styles using SASS. After the page was looking kind of cute I started doing the new functions. First of all I did a "Give up" function, which after 5 failed attempts of guessing will appear. If this button is clicked it will be impossible to keep guessing and the correct number will be given to the user. This function is called from the main handler.

If you win then a "You won" animated message appears because we gotta celebrate πŸŽ†πŸŽ‡

Want to clone my repository? πŸ‘πŸ‘

Go for it! And if you make something pretty, please show me

Do you have any idea? ✏️

I'm an student and as I stated before am learning Javascript right now, so, if you have any idea that I could develope please tell me so and I will try to.

License

MIT

game-guess-the-number's People

Contributors

silviaespanagil avatar

Watchers

 avatar

game-guess-the-number's Issues

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.