0

Hey guys I need a bit of help with a project.

I need to make a program that when you click start game it generates a random number from 1-100.

then you pick difficulty, easy has 15 lives, medium has 10 and hard has 5.

Everytime you submit a number and its wrong you lose a life.
if the number you submit is within five numbers of the number needed then if will say you are within 5 numbers of it.

if you you get the right number it will say you won and all your able to do is press start game or x you exit program.

during the program you can reset by pressing start game.


would anyone be able to help me do this program with tips/code so I can have it done in time?

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Seten
1

It is quite simple to create, but the levels are not adequate. Also you have to think of the logic again.

How many numbers are in the set? (generates a random number from 1-100.)
I am thinking you meant 100 numbers in set and one of them is randomly picked.

Because if you have level (5), then you can quess only 5*(5up+5down) = 50 . With this it is basically more about the luck, because to find the number you can only "ask" and get reply about 50 numbers from 100? And even if you hit the near the correct number within 1. quess you still need at least 3 quess the get the correct number number.

To help you, there should be something like:
( abs(choosen_number - quess_number) <= 5 )

Edited by Seten: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.