abhinayaa1787 / Psychic-Game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Psychic-Game

This is a page where user inputs a letter and checks whether it is matched with the letter guessed by the computer. to design this page used

  • HTML
  • CSS
  • Javascript

HTML page

This has all the contents the users needs to see. This is the layout that appears on screen.

CSS

This has the styles that are applied to the page

Javascript behind the page explained:

  • The user inputs a letter and it is stored as a variable.
  • The computer guesses a random letter from an array of 26 alphabets using Random() and is stored as a variable.
  • Then both the variables are compared to see if they are equal.
  • If yes, the user wins and the win counter increments else the loss counter increments.
  • The letters that are typed in by the user will be listed as an array of guesses.
  • The results are injected to the page on runtime.
  • The user input is restricted to certain times and when the user inputs greater than that number then the page reloads.

Happy Playing/Coding!

About


Languages

Language:JavaScript 77.4%Language:HTML 22.6%