Computer Science Canada

Dont Know Why This is Wrong

Author:  Bleaych [ Sun Jan 18, 2009 3:10 pm ]
Post subject:  Dont Know Why This is Wrong

Hi, I am Attempting to make a Thick Line move from left to right to the midddle of the screen. I entered This code and it does not show the arm at all, can somebody offer any suggestions as to why it is doing this?

Turing:
var arm : int


process movingarm
arm:=160
for counte:160..400
arm:=arm+1
Draw.ThickLine (1, 200,arm, 200, 30, 49)
delay (50)
Draw.ThickLine (1, 200,arm, 200, 30, 0)
end for
end movingarm


Mod Edit: Fixed the syntax tags
code:
[syntax="turing"]Your code actually goes in here[/syntax]

Author:  DanielG [ Sun Jan 18, 2009 3:19 pm ]
Post subject:  RE:Dont Know Why This is Wrong

never use process, at least not in turing, For anything other then music.
for that process to work you need to call it by using
code:

fork movingarm

Author:  Bleaych [ Sun Jan 18, 2009 4:01 pm ]
Post subject:  RE:Dont Know Why This is Wrong

thank you for the help it is working now

Author:  andrew. [ Sun Jan 18, 2009 5:39 pm ]
Post subject:  RE:Dont Know Why This is Wrong

Don't use processes in Turing. Only use it for background music. Processes are extremely buggy and unreliable in Turing. Why not just put it in a procedure instead?

e.g.
Turing:
var arm : int

proc movingArm
arm:=160
for counte:160..400
arm:=arm+1
Draw.ThickLine (1, 200,arm, 200, 30, 49)
delay (50)
Draw.ThickLine (1, 200,arm, 200, 30, 0)
end for
end movingArm

movingArm


: