Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Incorrections!

Author
Message
Kolotation
14
Years of Service
User Offline
Joined: 31st Dec 2009
Location:
Posted: 31st Dec 2009 18:56
After seeing a few number guessing games, and how simple they are to make, I decided to try my hand at creating one.

I made this in the form of a scoring game, though, and called it Incorrections! Since it was catchy.

Scoring is simple. You lose points for wrong answers based on how far off you were from the correct answer, and correct answers give 10 points.

It's my first game, so it may be a little glitchy, but it's a good, challenging game.

(I also don't know how to do the source code drop-down at this point, so the code might end up on the post, here.)



score = 25


start:
Set Cursor 0,0
Print "Lets play 'Incorrections'"
print "Guess the number! Between 1 and 6."
print "Current score: ", score
Input "- I choose the number: ", guessed$

number = rnd (6)

If val(guessed$) = number
Cls
Print "Correct! 10 points!"
score = score + 10
Wait (3000)
cls

If score > 39
Print "You win! Congradulations!"
Print "Want to play again? Press any key!"
wait key
score = 25
cls
Goto start

Else
Goto start

Endif

Else
Cls
Print "Wrong!. The correct number was ", number

difference = val(guessed$) - number

If difference < 0
score = score + difference
Print difference, " points"
Wait (3000)
cls

Else

score = score - difference
Print "-", difference
Wait (3000)
cls

Endif


If score < -1
Print "Game over. 'Incorrections' beat you. Better luck next time."
Print "Press any key to try again, or Esc to exit."
Wait key
score = 25
cls
Goto start

Else
Goto start

Endif

Endif

Awesomness comes easy.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Jan 2010 02:04
Click the "code" button, paste your source code, click the "code" button again to close the tag.




> SELECT * FROM users WHERE clue > 0
> 0 rows returned

Login to post a reply

Server time is: 2024-04-25 18:23:43
Your offset time is: 2024-04-25 18:23:43