Computer Science Canada

Moving ARROW program

Author:  @DRI@N [ Tue May 25, 2004 5:01 pm ]
Post subject:  Moving ARROW program

This arrow moves to the right with the arrow pointing right and goes off the screen and comes back going left, with the arrow pointing left
(you might have to do it in Chapter 8 so here it is)
code:

%Broken Arrow
%Adrian Todorov
%Created on April 7,2004
%Modified on April 14,2004
%An arrow moving left to right changing directions
%Question #5

setscreen ("graphics")
View.Set ("offscreenonly")

loop            %Loop to keep repeating each For loop

for x : 1 .. maxx+40   %Counted loop for the movement of left-to-right
cls   
delay(5)
    drawline (x+20, 50, x+40, 30, black)
    drawline (x, 30, x+40, 30, black)
    drawline (x+40, 30, x+20, 10, black)
   

View.Update   
end for
delay(5)
for decreasing x : maxx .. 1-40   %Counted loop for the movement of right-to-left
cls
delay(5)   
   

    drawline (x-20, 50, x-40, 30, black)
    drawline (x, 30, x-40, 30, black)
    drawline (x-40, 30, x-20, 10, black)

View.Update   
end for

end loop



Author:  Cervantes [ Tue May 25, 2004 5:27 pm ]
Post subject: 

the program works fine, so I'm assuming you don't have any questions related to this program. In that case, this belongs in Turing Source Code, not Turing Help. Rolling Eyes

EDIT: same with all of your other posts, except for the question about shooting a puck

Author:  guruguru [ Tue May 25, 2004 6:07 pm ]
Post subject: 

Source code. #5 Razz Whopee no more :p


: