Author |
Message |
Jesus
|
Posted: Mon Mar 06, 2006 10:32 am Post subject: A question about a Questioning program.. |
|
|
var number : int
randomize
randint(number, 1, 10)
loop
put "This program is a guessing game with numbers 1-10."
put " "
put "Try and guess what number I have chosen?"
get number
exit when number = number
end loop
well i know im missing a bunch, but the gest of it is, this...
*Write a program that starts with those three lines, then lets the user try to guess the value of 'number'. Do not let them exit the program until the guess the number. *
Im ahead of my class so im not asking for you guys to write the program, just a general direction if you could? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Jesus
|
|
|
|
|
codemage
|
Posted: Mon Mar 06, 2006 11:36 am Post subject: (No subject) |
|
|
Try not to respond to your own posts; put everything you need in the first one.
A counter variable is easy to add:
Make a new int variable.
Set it to zero before your loop starts.
Add one to it every time your loop runs.
If you havent' taken IF statements at all yet, check out the excellent tutorials in the Turing Walkthrough. |
|
|
|
|
|
md
|
Posted: Mon Mar 06, 2006 2:11 pm Post subject: (No subject) |
|
|
Also read up on variables. number = number is always true |
|
|
|
|
|
batman
|
Posted: Mon Mar 06, 2006 4:38 pm Post subject: Program |
|
|
Code Snip!
I fixed up your program for you. You were on the right track you just needed to add a if statement and another variable for number or else it wouldn't work. |
|
|
|
|
|
md
|
Posted: Mon Mar 06, 2006 5:04 pm Post subject: Re: Program |
|
|
batman wrote: I fixed up your program for you. You were on the right track you just needed to add a if statement and another variable for number or else it wouldn't work.
The goal is to help, not give the answer. By pointing out things to read, giving hints at what is wrong, and sometimes by giving examples you help the person askinghte question figure thigns out on their own so that they learn what they are doing wrong. Though usually what they want is just hte correct code. |
|
|
|
|
|
[Gandalf]
|
Posted: Mon Mar 06, 2006 5:11 pm Post subject: (No subject) |
|
|
Argh!
Merge topics would be a useful feature... |
|
|
|
|
|
batman
|
Posted: Mon Mar 06, 2006 5:55 pm Post subject: Code |
|
|
I know we shouldn't give the answer but this is a pretty simple code and it doesn't really matter if Jesus gets the asnwer or not. I believe if the person has tryed and as done some work like jesus did but needed help figuring the rest out then we should help him out! If he did absolutly nothing, didn't even start writing a code then asked for help, logically I wouldn't have given him the answer! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
MysticVegeta
|
Posted: Mon Mar 06, 2006 6:36 pm Post subject: Re: Code |
|
|
batman wrote: but this is a pretty simple code and it doesn't really matter if Jesus gets the asnwer or not.
Wow. You must be a genius! Different people have different level of difficulty. Saying whether he gets the answer or not is just wrong. That question was hard for me, does that entitle me to not deserve to get how people got that to work? Please teach me master. |
|
|
|
|
|
batman
|
Posted: Mon Mar 06, 2006 6:50 pm Post subject: Code |
|
|
Ok My bad! But as long as he tried what does it matter! Its not like he didn't try to figure out the code himself and then asked us to do it for him! As long as he tried and showed us proof then what does it matter! HE showed us his code and I corrected it! |
|
|
|
|
|
md
|
Posted: Mon Mar 06, 2006 6:58 pm Post subject: (No subject) |
|
|
Umm... did you not see that it was a question in a course; and thus probably worth marks? It makes a HUGE difference. |
|
|
|
|
|
[Gandalf]
|
Posted: Mon Mar 06, 2006 7:00 pm Post subject: (No subject) |
|
|
The point is that he should have gotten the answer on his own, not be given it, no matter the difficulty. Help is always good, but people learn much better when they have to solve a problem on their own.
Now, I suggest you forget about it and make an effort to change your ways. |
|
|
|
|
|
Cervantes
|
Posted: Mon Mar 06, 2006 7:47 pm Post subject: (No subject) |
|
|
*pulls out the code cutting scissors*
Hope I'm not too late. |
|
|
|
|
|
|