Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 EXTREME GUESSING GAME!!!!!!(The Largest Guessing Game Ever!)
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dann_west




PostPosted: Tue Oct 04, 2005 12:29 pm   Post subject: EXTREME GUESSING GAME!!!!!!(The Largest Guessing Game Ever!)

Most people give up before they beet this game! tell me if you beet it!
Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil


i had trouble attaching so heres the code. I know some will say keep it simple stupid,but o well i was bored and i just typyed a lot.


%By Dann Westman
%Guessing Game
%September 21 2005

%display settings
setscreen ("graphics:300,300")
colourback (black)
colour (yellow)
cls

%variables
var num, num2, num3, num4, num5, num6, num7, num8, num9, num0, pick : int
var font, font2, points : int
num := Rand.Int (1, 50)
num2 := Rand.Int (1, 100)
num3 := Rand.Int (1, 500)
num4 := Rand.Int (1, 1000)
num5 := Rand.Int (1, 2000)
num6 := Rand.Int (1, 5000)
num7 := Rand.Int (1, 10000)
num8 := Rand.Int (1, 20000)
num9 := Rand.Int (1, 50000)
num0 := Rand.Int (1, 100000)
font := Font.New ("Arial:18:Bold")
font2 := Font.New ("Arial:10:Bold")
points := 100

%title
for title : 1 .. 50
Font.Draw ("Extreme Guessing Game! ", 10, 150, font, title)
delay (100)
cls
end for
delay (1000)

%Author
Font.Draw ("By Dann Westman", 20, 150, font, 12)
delay (2000)
cls
%program loop(all the main components)
put "Welcome to EXTREME GUESSING GAME EXTREME!"
delay (2000)
cls
put
"You will be given 100 points to start. Each in correct answer will loose you a point. If your points reach zero,you loose."
delay (5000)
cls
Font.Draw ("Level One: Very Easy", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 50:" ..
get pick
cls
if pick = num then
put "yes thats it!"
elsif pick > num then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"
end if
delay (2000)
cls
exit when (pick = num or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was ", num
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls

Font.Draw ("Level Two: Easy", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 100:" ..
get pick
cls
if pick = num2 then
put "yes thats it!"
elsif pick > num2 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num2 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num2 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was ", num2
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls

Font.Draw ("Level Three: Medium", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 500:" ..
get pick
cls
if pick = num3 then
put "yes thats it!"
elsif pick > num3 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num3 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num3 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was ", num3
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls

Font.Draw ("Level Four: Medium/Hard", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 1000:" ..
get pick
cls
if pick = num4 then
put "yes thats it!"
elsif pick > num4 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num4 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num4 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was ", num4
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls

Font.Draw ("Level Five:Hard", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 2000:" ..
get pick
cls
if pick = num5 then
put "yes thats it!"
elsif pick > num5 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num5 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num5 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was ", num5
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls

Font.Draw ("Level Six:Super Hard", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 5000:" ..
get pick
cls
if pick = num6 then
put "yes thats it!"
elsif pick > num6 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num6 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num6 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number happened to be ", num6
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls

Font.Draw ("Level Seven: Super Duper Hard", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 10 000:" ..
get pick
cls
if pick = num7 then
put "yes thats it!"
elsif pick > num7 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num7 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num7 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was the crazy number ", num7
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls


Font.Draw ("Level Eight: Very Super Duper Hard", 20, 150, font2, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 20000:" ..
get pick
cls
if pick = num8 then
put "yes thats it!"
elsif pick > num8 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num8 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num8 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was the unthinkable number ", num8
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (4000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls


Font.Draw ("Level Nine:Nearly Impossible", 20, 150, font, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 50000:" ..
get pick
cls
if pick = num9 then
put "yes thats it!"
elsif pick > num9 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num9 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num9 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was ", num9
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls


Font.Draw ("Level Ten:So Hard The Fonz", 20, 150, font2, 12)
Font.Draw ("himself would have trouble!", 20, 100, font2, 12)
delay (2000)
cls
loop
put "Pick a number between 1 and 100000:" ..
get pick
cls
if pick = num0 then
put "yes thats it!"
elsif pick > num0 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "This time,Try a lower number."
elsif pick < num0 then
points := points - 1
put "No!"
put "You have ", points, " points left!"
delay (1100)
put "Try a higher number."
else
put "Try typing a real number dumby!"

end if
delay (2000)
cls
exit when (pick = num0 or points = 0)
end loop
if points = 0 then
put "HAHA sucker,you lose!"
put "The number was ", num0
Draw.FillOval (150, 150, 60, 60, yellow)
Draw.Line (120, 150, 140, 160, black)
Draw.Line (140, 150, 120, 160, black)
Draw.Line (180, 150, 160, 160, black)
Draw.Line (160, 150, 180, 160, black)
Draw.Line (110, 120, 180, 120, black)

delay (3000)
else
put "You Win!"
put "You are a real winner you crazy guy!"
Pic.ScreenLoad ("fonzie.jpg", 50, 50, picCopy)
delay (3000)
end if
cls

put "The End"
Sponsor
Sponsor
Sponsor
sponsor
beard0




PostPosted: Tue Oct 04, 2005 12:31 pm   Post subject: (No subject)

I guess that you forgot to actually post it.
[Edit]: He didn't have code there when i posted, I swear!
codemage




PostPosted: Tue Oct 04, 2005 12:45 pm   Post subject: (No subject)

That's some very... uh... linear code you've got there.

You should invest some time in reading about Loops, here:
http://www.compsci.ca/v2/viewtopic.php?t=3678

You'll gain the time back by not having to type so much. (Loops would make the majority of your code below unecessary, since you're basically doing the same thing 10 times.)[/url]
Tony




PostPosted: Tue Oct 04, 2005 12:52 pm   Post subject: (No subject)

loops and functions.

you're repeating way to much code.
Mazer




PostPosted: Tue Oct 04, 2005 2:42 pm   Post subject: (No subject)

And you're assuming we'll have a picture of the Fonz on our computer. I assure you that I do not.
Darkshining




PostPosted: Tue Oct 04, 2005 7:20 pm   Post subject: (No subject)

Yeah, too much unessasary repetition.
Use loops.
But, yeah, good effort, must have been very time consuming.
Darkshining




PostPosted: Tue Oct 04, 2005 7:41 pm   Post subject: (No subject)

And may i add, i am the first oe to beat this guessing game.
[Gandalf]




PostPosted: Tue Oct 04, 2005 10:31 pm   Post subject: (No subject)

For your next game, if you want more people to play it (and beat it), make sure to get rid of the delays (delay()). It may seem like a good 'presentation' idea, but it is definately not neccessary and it takes away from the usability of your program.
Sponsor
Sponsor
Sponsor
sponsor
beard0




PostPosted: Tue Oct 04, 2005 10:44 pm   Post subject: (No subject)

[Gandalf] wrote:
For your next game, if you want more people to play it (and beat it), make sure to get rid of the delays (delay()). It may seem like a good 'presentation' idea, but it is definately not neccessary and it takes away from the usability of your program.


I'll second that! My feeling is that Darkshining shouldn't really be proud of having sat through all those delays... Laughing
dann_west




PostPosted: Wed Oct 05, 2005 1:09 pm   Post subject: (No subject)

If you can try to tell me how to make the picture to appear on my program....i had som trouble with it.
Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil Twisted Evil
codemage




PostPosted: Wed Oct 05, 2005 1:14 pm   Post subject: (No subject)

You would have to have the picture file, "fonzie.jpg", in this case, in the same directory of your turing file (or give a more specific reference to the file in the program.)

You also need to include the picture in any non-compiled package of the code if you want anyone else to be able to see it.
beard0




PostPosted: Wed Oct 05, 2005 1:21 pm   Post subject: (No subject)

codemage wrote:
You also need to include the picture in any non-compiled package of the code if you want anyone else to be able to see it.

You need to include it for any package, compiled or not.
nmr123321




PostPosted: Wed Oct 05, 2005 4:09 pm   Post subject: (No subject)

for a noob like me everything seems to be excellent
Darkshining




PostPosted: Wed Oct 05, 2005 4:21 pm   Post subject: (No subject)

Quote:
I'll second that! My feeling is that Darkshining shouldn't really be proud of having sat through all those delays... Laughing


Don't feel sorry for me, i got rid of the delays before i played. I always read the code before i run it. Laughing 8)

i did run it with the delays once though. Mad WAY to time consuming.[/quote]
StarGateSG-1




PostPosted: Wed Oct 05, 2005 9:05 pm   Post subject: (No subject)

Not to be a bum, but he is making false claims.

Try this out.

+20 bits to the person who beats this, I want a screenshot.

Edit, not working, give me a minute Confused

Well I guess i will have to give the source code, this is wierd it can't upload the file Confused

code:
var Num_Answer : int
var Num_Guess : int
loop
Num_Answer := Rand.Int(1,999999999)
put "Please enter any number between 1 and 999999999"
get Num_Guess
if Num_Guess = Num_Answer then
put "Congradulations, you beat the longest guessing game ever"
exit when Num_Guess = Num_Answer
else
put "Nope try again"
end if
end loop


Good luck with this.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 30 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: