[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> "Advanced" logo



We use microworlds with great success with kids aged 6 upwards. I have avoided 
more complicated routines because it would be beyond most of my students. 
However I have one student (12 years old) who is way ahead of others and is 
very keen on programming in 3D virtual reality - similar to some of the violent 
games such as Descent, etc.
Through his own research he has discovered that programming techniques such as 
array manipulation, rotation and 3D plotting are involved.

We are working in Microworlds Windows95 Logo. He has produced the following 
routines:

ARRAY HANDLING ROUTINE

to array_index :array :index
local "bdist
make "a_index :array
make "bdist (count :array) - :index - 1
repeat :index [make "a_index butfirst :a_index]
repeat :bdist [make "a_index butlast :a_index]
end

3D PLOTTING ROUTINE

to draw :x :y :z
setpos list (:x * 256) / :z (:y * -256) / :z
end

to cube
ht
cg
line -10 10 20 -10 10 40
line -10 10 20 -10 -10 20

line 10 10 20 -10 10 20
line 10 10 20 10 10 40
line 10 10 20 10 -10 20

line 10 -10 20 10 10 20
line 10 -10 20 -10 -10 20
line 10 -10 20 10 -10 40

line -10 -10 20 10 -10 20
line -10 -10 20 -10 10 20
line -10 -10 20 -10 -10 40

line -10 -10 40 10 -10 40
line -10 -10 40 -10 10 40
line -10 -10 40 -10 -10 20

line -10 10 40 -10 -10 40
line -10 10 40 10 10 40
line -10 10 40 -10 10 20

line 10 -10 40 -10 -10 40
line 10 -10 40 10 10 40
line 10 -10 40 10 -10 20

line 10 10 40 10 -10 40
line 10 10 40 -10 10 40
line 10 10 40 10 10 20
end

to line :x :y :z :x2 :y2 :z2
pu
draw :x :y :z
pd
draw :x2 :y2 :z2
pu
end

ROTATION ROUTINE

to rot
cg
pu
setpos [1 200]
pd

forever [
make "x xcor
make "y ycor
setx  ((sin 89.9) * :x)  - ((cos 89.9) * :y)
sety  ((cos 89.9) * :x)  + ((sin 89.9) * :y)
]

end

I am sure that he has picked up some of these techniques from other programming 
languages. Could you please comment on these programming techniques and how 
they might be better coded in Logo.

Thank you.

Ray Catzel
President  ComputerPals
Email:  learn@computerpals.on.ca
Internet:  http://www.computerpals.on.ca/~pals

---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home