
-----------------------------------
Jesus
Mon Mar 06, 2006 10:32 am

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?

-----------------------------------
Jesus
Mon Mar 06, 2006 10:33 am


-----------------------------------
Well those are the instructions, the full thing is the 3rd assignment on this page, 

http://webhome.idirect.com/~mdevoy/TIKTEE2OI/programming/Repetition%20Uncounted%20Assignment.htm

-----------------------------------
codemage
Mon Mar 06, 2006 11:36 am


-----------------------------------
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
Mon Mar 06, 2006 2:11 pm


-----------------------------------
Also read up on variables. number = number is always true ;)

-----------------------------------
batman
Mon Mar 06, 2006 4:38 pm

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. :D

-----------------------------------
md
Mon Mar 06, 2006 5:04 pm

Re: Program
-----------------------------------
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. :D

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]
Mon Mar 06, 2006 5:11 pm


-----------------------------------
[url=http://www.compsci.ca/v2/viewtopic.php?t=11494]Argh!

Merge topics would be a useful feature...

-----------------------------------
batman
Mon Mar 06, 2006 5:55 pm

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!

-----------------------------------
MysticVegeta
Mon Mar 06, 2006 6:36 pm

Re: Code
-----------------------------------
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
Mon Mar 06, 2006 6:50 pm

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! :D

-----------------------------------
md
Mon Mar 06, 2006 6:58 pm


-----------------------------------
Umm... did you not see that it was a question in a course; and thus probably worth marks? It makes a HUGE difference.

-----------------------------------
[Gandalf]
Mon Mar 06, 2006 7:00 pm


-----------------------------------
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
Mon Mar 06, 2006 7:47 pm


-----------------------------------
*pulls out the code cutting scissors*

Hope I'm not too late.
