Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Activities/Turtle Art-0.86
(view source)
Revision as of 08:38, 21 March 2009
97 bytes removed
,
08:38, 21 March 2009
→myblock.py
Line 279:
Line 279:
Examples:
Examples:
−
from taturtle import *
def myblock(lc,x):
def myblock(lc,x):
# draw a dotted line of length x
# draw a dotted line of length x
Line 303:
Line 302:
[[Image:TA-dotted-line.png]]
[[Image:TA-dotted-line.png]]
−
from taturtle import *
def myblock(lc,x):
def myblock(lc,x):
# push an uppercase version of a string onto the heap
# push an uppercase version of a string onto the heap
Line 314:
Line 312:
return
return
−
from taturtle import *
def myblock(lc,x):
def myblock(lc,x):
# push hours, minutes, seconds onto the heap
# push hours, minutes, seconds onto the heap
Line 325:
Line 322:
return
return
−
from taturtle import *
def myblock(lc,x):
def myblock(lc,x):
# add a third dimension (gray) to the color model
# add a third dimension (gray) to the color model
Line 340:
Line 336:
lc.tw.fgcolor = lc.tw.cm.alloc_color(r<<8,g<<8,b<<8)
lc.tw.fgcolor = lc.tw.cm.alloc_color(r<<8,g<<8,b<<8)
return
return
−
===From the field===
===From the field===
Walter
Bureaucrats
,
Administrators
10,509
edits