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

LOGO-L> Another Word scuplturing



Hello,

Here's another sample of word-sculpturing. It takes a word and shapes it
in the form of a diamond. Try it with word of even and odd length.

=================================
to main
ts ct
type[Give me a word ==>\ ]
diamond rw
end

to diamond :wrd
expand bf bl :wrd 1
pr :wrd
shrink bf bl :wrd 1
end

to expand :wrd :spc
if 2>count :wrd[print_it stop]
expand bf bl :wrd :spc+1 print_it
end

to shrink :wrd :spc
print_it
if 2>count :wrd[stop]
shrink bf bl :wrd :spc+1
end

to spaces :spc
if 0=:spc[op "]
op word "\  spaces :spc-1
end

to print_it
pr word spaces :spc :wrd
end
=================================

Please note that the backslash in SPACES is followed by *2* spaces.
If your flavor of Logo doesn't support the backslash, replace "\  by
CHAR 32 in SPACES, and simply ignore it at MAIN.

Enjoy it,

[[Yehuda]]

---------------------------------------------------------------
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