i made a selecting program for hockey but i messed up the loop part and i need help fixing it
Author |
Message |
h_g123
|
Posted: Sun Jan 06, 2008 8:27 pm Post subject: i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
so this is what i have so far
Declare variables
var answer: string
var command:int
var x:int
var y:int
var x1:int
var y1:int
var x2:int
var y2:int
Draw.Dot (80,70,blue)
var font1:int
font1 := Font.New ("Harrington:14:bold,italic")
loop
Font.Draw ("What's your favorite hockey team?", 160, 250, font1, brightblue)
locate (12,11)
put "Choose the number for your favorite hockey team from below:"
locate (13,1)
put "1-The Maple Leafs"
put "2-The senaters"
put "3-The Fames"
put "4- a different team"
put "5- the world junior canadian guys team"
put "6- i don't wanna to answer this question and i want to exit"
get command
case command of
label 1 : put "You picked one of the best teams GO LEAFS GO!!!"
label 2 : put "The senators huh well not a bad team but you are a traiter!"
label 3 : put "Better then being a senators fan, at least you picked a canadian team..."
label 4 : put "Not bad as long as it's not an american team...if it is wow you suck!!!"
label 5 : put "You picked a winning team, after all they just won a gold medal!!!"
label 6 : exit
label : put "I don't understand which team you picked"
end case
loop
Font.Draw ("Would you like to continue (y/n) ???", 152, 250, font1, blue)
color(blue)
get answer
cls
exit when answer="n"
end loop
put "LEAFS RULE, GO for the real canadian team or the world junior team!!!"
Draw.MapleLeaf (220,250,270,290,blue) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Zren
![](http://compsci.ca/v3/uploads/user_avatars/1110053965512db6185954b.png)
|
Posted: Sun Jan 06, 2008 10:42 pm Post subject: Re: i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
Add an end loop at the end...
Here's a tip...Use the ident button at the top. Not only will it sort your code, but if the last line is indented, that meen you forgot to close a loop/function etc.
You also might wanta consider clearing the screen after a few things. |
|
|
|
|
![](images/spacer.gif) |
h_g123
|
Posted: Mon Jan 07, 2008 12:04 am Post subject: Re: i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
[quote="Zren @ Sun Jan 06, 2008 10:42 pm"]Add an end loop at the end...
Here's a tip...Use the ident button at the top. Not only will it sort your code, but if the last line is indented, that meen you forgot to close a loop/function etc.
thanks that really did make it clearer |
|
|
|
|
![](images/spacer.gif) |
Gackt
![](http://compsci.ca/v3/uploads/user_avatars/692715419476846d0b1db8.gif)
|
Posted: Mon Jan 07, 2008 10:21 am Post subject: RE:i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
Heres your problem...
label 1 : put "You picked one of the best teams GO LEAFS GO!!!"
Thats all wrong. It should be.
label 1 : put "You picked the Worst teams Boo LEAFS!!!!
:p |
|
|
|
|
![](images/spacer.gif) |
h_g123
|
Posted: Mon Jan 07, 2008 1:21 pm Post subject: Re: i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
what ever
you know you love the leafs......=p
who couldn;t love that team |
|
|
|
|
![](images/spacer.gif) |
Gackt
![](http://compsci.ca/v3/uploads/user_avatars/692715419476846d0b1db8.gif)
|
Posted: Mon Jan 07, 2008 2:29 pm Post subject: RE:i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
Red Wings Pwn them so bad |
|
|
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: Mon Jan 07, 2008 3:58 pm Post subject: RE:i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
Let's get back on topic here, or I'm afraid I'll have to lock this thread. |
|
|
|
|
![](images/spacer.gif) |
Sean
![](http://compsci.ca/v3/uploads/user_avatars/47413941748406f441f83e.png)
|
Posted: Mon Jan 07, 2008 7:52 pm Post subject: Re: i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
Turing: |
var x : int
var y : int
var x1 : int
var y1 : int
var x2 : int
var y2 : int
|
You declared these variables, and did not use them once in your program and are un-needed, I suggest you read over your program and delete any un-needed variables. The Dot is also not required as it has no purpose in the program, and as we will all suggest, indenting is key, press F2 to do so.
Turing: |
Font.Draw ("What's your favorite hockey team?", 160, 250, font1, brightblue)
locate (12, 11)
put "Choose the number for your favorite hockey team from below:"
locate (13, 1)
put "1-The Maple Leafs"
put "2-The senaters"
put "3-The Fames"
put "4- a different team"
put "5- the world junior canadian guys team"
put "6- i don't wanna to answer this question and i want to exit"
get command
|
Also another suggestion, read over your work and spell everything correctly, Capitals like you used in the Maple Leafs should be used through out the entire program, not just once.
Also, Your user repsonse doesn't work properly, make sure it erases screen and reloads. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Euphoracle
![](http://compsci.ca/v3/uploads/user_avatars/11170373664bf5f25f636f1.png)
|
Posted: Mon Jan 07, 2008 8:52 pm Post subject: RE:i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
When you paste without syntax/code tags, it removes indentation. It might have been indented. |
|
|
|
|
![](images/spacer.gif) |
h_g123
|
Posted: Wed Jan 09, 2008 1:42 pm Post subject: Re: i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
thanks guy i got it working and your suggetions were all helpful.... ![Very Happy Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
Sean
![](http://compsci.ca/v3/uploads/user_avatars/47413941748406f441f83e.png)
|
Posted: Wed Jan 09, 2008 3:16 pm Post subject: Re: i made a selecting program for hockey but i messed up the loop part and i need help fixing it |
|
|
Your welcome, any other questions regarding this project, feel free to ask. |
|
|
|
|
![](images/spacer.gif) |
|
|