I made something like this a long time ago in C++, although there were a few bugs in it.
Really? It's quite a basic game.... How come you had a few bugs?
just a question: is there not a need to include else if before the subsequent comparing lines?
You could use else if. It probably would be better to use else if because as it currently is, if your guess is lower, the program is still going to assess if you have guessed higher (which you know you haven't). Thus your program would take slightly more time than it should.
Yes, the else if should save a few cpu cycles. Will not be noticeable but the difference is there.
It doesn't really matter too much in a small program like this but in bigger programs it could make a huge difference.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks