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

LOGO-L> Move & recursion



I teach at Central Connecticut State Univeristy and this semester I am
teaching a course using PCLogo2.  We will start looking at fractals after
our spring break (next week, and not a moment too soon).  I was playing 
with the MOVE procedure, and think the following is a fun way to start
looking at random movements on the screen:
to move
	wrap fs
	fd 20
	make "go random 360   ; this selects a random integer from 1 to 360
	rt :go
	if :go > 100 setpc 12	; makes pen color red
	if :go > 200 setpc 14   ; makes pen color yellow
	if :go <= 100 setpc 0	; makes pen color black
	move
end

this is supposedly "random", i.e. patternless, but visually there seems to
be a pattern
Ginny Jones
---------------------------------------------------------------
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