GithubHelp home page GithubHelp logo

sauravhathi / hides-three-gifts Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 14 KB

This is a three level game. In the first level, 3x3 grid. In the second level, 4x4 grid. In the third level, 6x6 grid. In each level, 3 gift is hidden. You have to find the gift in the minimum number of clicks.

Home Page: https://sauravhathi.github.io/hides-three-gifts/

License: MIT License

HTML 49.88% JavaScript 50.12%
game grid hide-and-seek javascript lpu sauravhathi lovely-professional-university

hides-three-gifts's Introduction

Hides three gifts

This is a simple game where you have to find three gifts in a grid. There are three levels in this game. You can select the level and start playing. There are three types of boxes in the grid. One is gift box, one is danger box and one is miss box. If you click on the gift box then you will get one star. If you click on the danger box then you will lose the game. If you click on the miss box then you will get nothing. You have to find three gifts in the grid to win the game. If you find three gifts then you will get three stars.

Demo

image

Technologies

  • HTML
  • CSS
  • JavaScript

HTML is used to create the structure of the game. CSS is used to style the game. JavaScript is used to add the functionality to the game.

CSS is used to style the game. JavaScript is used to add the functionality to the game.

JavaScript is used to add the functionality to the game.

Functions

randomizeGrid(gridSize)

This function will return an array of random values. The length of the array will be the square of the gridSize. There will be three gift boxes, one danger box and the rest will be miss boxes.

changeGrid()

This function will change the grid according to the selected option in the select box. It will call the randomizeGrid function and then create the grid according to the array returned by the randomizeGrid function.

clrGrid()

This function will clear the grid.

Features

  • The user can select the grid size from the dropdown list
  • The user can click on each cell of the grid to find the gifts
  • If the user clicks on a cell which has a gift then the gift will be displayed in the cell
  • If the user clicks on a cell which has a danger then the game will be reset and the user will lose the game
  • If the user clicks on a cell which has a miss then nothing will be displayed in the cell
  • The user has to find all the gifts in the grid to win the game
  • The user will get 3 stars if he finds all the gifts in the first attempt
  • The user will get 2 stars if he finds all the gifts in the second attempt
  • The user will get 1 star if he finds all the gifts in the third attempt
  • The user will get 0 star if he finds all the gifts in the fourth attempt

How to run the project

  • Clone the project git clone https://github.com/sauravhathi/hides-three-gifts.git
  • Open the index.html file in the browser

hides-three-gifts's People

Contributors

sauravhathi avatar

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.