NickUkraine24 / guess_game

Guess a number from 1 to your input max number with 10 attempts.

Home Page:https://github.com/NickUkraine24/guess_game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guess game

Guess a number from 1 to your input max number with 10 attempts.

How to test?

  1. Clone repository:
    $ git clone https://github.com/NickUkraine24/guess_game.git
  2. Go to project directory:
    $ cd guess_game
  3. Run command:
     $ ruby guess_game.rb max_number

Examples

If a random number is equal 3 (user have 10 attempts):

  • If you guess a random number:

    • Input:
      $ ruby guess_game.rb 10
    • Output:
      Input please number from 1 to 10:
    • Input:
      $ 1
    • Output:
      Number is less.
      Input please number from 1 to 10:
    • Input:
      $ 5
    • Output:
      Number is greater.
      Input please number from 1 to 10:
    • Input:
      $ 3
    • Output:
      You won! 
  • If you do not guess a random number:

    • Input:

      $ ruby guess_game.rb 10
    • Output:

      Input please number from 1 to 10:
    • Input:

      $ 2
    • Output:

      Number is less.
      Input please number from 1 to 10:
    • ...

    • Input:

      $ 6
    • Output:

      Number is greater.
      Input please number from 1 to 10:
    • Input:

      $ 5
    • Output:

      Number is greater.
      Random number is 3.

About

Guess a number from 1 to your input max number with 10 attempts.

https://github.com/NickUkraine24/guess_game


Languages

Language:Ruby 100.0%