Computer Science Canada can somone edit these |
Author: | a random person [ Fri Nov 25, 2005 5:53 pm ] | ||||
Post subject: | can somone edit these | ||||
i have a couple of eronious programs and i need somone to help
there is another one aswell
if some one can help me i will be great! |
Author: | md [ Fri Nov 25, 2005 7:07 pm ] |
Post subject: | |
you need to ask a question to get any help ![]() |
Author: | a random person [ Sat Nov 26, 2005 8:44 am ] |
Post subject: | |
sry about that, first post and all ![]() program where they have 1 second to respond with the answer and the other one is just a count up clock. with both of these I ran into some logic problems that i can't work around ![]() |
Author: | a random person [ Sat Nov 26, 2005 1:45 pm ] | ||
Post subject: | |||
guess what i have another one if anyone can curve this line it would be amasing
|
Author: | [Gandalf] [ Sat Nov 26, 2005 2:10 pm ] | ||
Post subject: | |||
Take a look at all the changes I have made in the last program, and see if you understand them.
1. iy is how much the y coordinate increases every iteration of the loop, that value increase after it is added to y. This causes the curve. 2. you must round y when you are passing it to Draw.Dot() (drawdot()), because that procedure needs an integer, not a decimal number. 3. x -= 1 is the same thing as x := x - 1 4. use Time.DelaySinceLast() instead of delay(), since it works the same on all computers. 5. Please indent your program, at least use "F2". As for your other programs, they seem to have logic errors in them, think them through and you should get the right answer. Thing step by step, try to follow what the program does. |
Author: | [Gandalf] [ Sat Nov 26, 2005 7:38 pm ] |
Post subject: | |
Yes, yes, please put replys in the topic which you posted in originally. Hacker Dan wrote: and has a poor subject name.
I don't know about a poor subject name though ![]() Well, think about it, for that program you have it so that if second = 60 then... do whatever needed for when the seconds are over a minute. The thing is, what happens when there are 61 seconds? It goes back since second > 60, you need to take that into consideration. Solve that problem on your own, and try to figure out what is wrong with the other program as well. I, or anyone else, won't give you the exact answers, we can only help occasionally.[/quote] |
Author: | milz [ Sun Nov 27, 2005 11:38 am ] |
Post subject: | |
Yo here is ur correct code. hav fun.. ![]() %flashcards var a, b, u, x : int x := 0 for t : 1 .. 10 put t delay (100) cls loop randint (a, 1, 9) randint (b, 1, 9) put a, "+", b get u if a + b < u then put "game over, your score is ", x elsif a + b > u then put "game over, your score is ", x else x := x + 1 exit when a + b < u or a + b > u end if end loop end for if b = 10 then put "you ran out of time, your score is", x else end if |