Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--TurtleArt/tabasics.py10
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py1
-rw-r--r--samples/graphics-bubbles.ta76
-rw-r--r--samples/graphics-city.ta294
-rw-r--r--samples/graphics-csquiral.ta30
-rw-r--r--samples/graphics-dots.ta68
-rw-r--r--samples/graphics-jonny-emerson.ta74
-rw-r--r--samples/graphics-redwisp.ta83
-rw-r--r--samples/math-dice.ta223
-rw-r--r--samples/math-snowflake.ta (renamed from samples/graphics-snowflake.ta)0
-rw-r--r--samples/math-tree.ta (renamed from samples/graphics-tree.ta)0
-rw-r--r--samples/sensors-record.tb113
13 files changed, 520 insertions, 454 deletions
diff --git a/NEWS b/NEWS
index 9f18b82..73cbe42 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@
ENHANCEMENTS:
* New translations
* More sample graphics from turtleart.org
+* Added pen state boolean
+* Added new sensor-record example (generates turtle art program from mouse movements)
184
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py
index 04a74d1..05ff16a 100644
--- a/TurtleArt/tabasics.py
+++ b/TurtleArt/tabasics.py
@@ -438,6 +438,16 @@ used in place of a number block)'),
lambda self:
self.tw.turtles.get_active_turtle().set_pen_state(True))
+ palette.add_block('penstate',
+ style='boolean-block-style',
+ label=_('pen down?'),
+ prim_name='penstate',
+ help_string=_('returns True if pen is down'))
+ self.tw.lc.def_prim(
+ 'penstate',
+ 0,
+ lambda self: self.tw.turtles.get_active_turtle().get_pen_state())
+
palette.add_block('setpensize',
style='basic-style-1arg',
label=_('set pen size'),
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index a272ec8..0d31ced 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -1519,6 +1519,7 @@ Journal objects'))
(1) translate the label name into the internal block name;
(2) 'dock' the block onto a stack where appropriate; and
(3) disassociate the new block from the mouse. """
+ x, y = self.tw.turtles.turtle_to_screen_coordinates((x, y))
for name in block_names:
# Translate label name into block/prim name.
if blkname in block_names[name]:
diff --git a/samples/graphics-bubbles.ta b/samples/graphics-bubbles.ta
index 0d3c680..37002c1 100644
--- a/samples/graphics-bubbles.ta
+++ b/samples/graphics-bubbles.ta
@@ -1,36 +1,40 @@
-[[0, "setcolor", 159, 215, [11, 1, 2]],
-[1, ["number", 60], 240, 215, [0, null]],
-[2, "repeat", 159, 257, [0, 3, 23, null]],
-[3, ["number", 5000], 210, 257, [2, null]],
-[4, ["setxy2", 20.0], 224, 359, [23, 5, 6, 20]],
-[5, ["random", 0], 285, 359, [4, 32, 33, null]],
-[6, ["random", 0], 285, 441, [4, 34, 35, null]],
-[7, "setpensize", 224, 693, [31, 18, 21]],
-[8, "setshade", 224, 777, [21, 16, 22]],
-[9, "forward", 224, 861, [22, 10, null]],
-[10, ["number", 1], 298, 861, [9, null]],
-[11, "clean", 159, 173, [12, 0]],
-[12, ["start", 2.0], 159, 131, [null, 11]],
-[13, ["plus2", 0], 319, 609, [30, 14, 15]],
-[14, "ycor", 373, 609, [13, null]],
-[15, ["number", 900], 373, 651, [13, null]],
-[16, ["division2", 0], 302, 777, [8, 28, 17]],
-[17, ["number", 12], 380, 819, [16, null]],
-[18, ["division2", 0], 325, 693, [7, 26, 19]],
-[19, ["number", 9], 403, 735, [18, null]],
-[20, ["vspace", 0], 224, 483, [4, 24]],
-[21, ["vspace", 0], 224, 735, [7, 8]],
-[22, ["vspace", 0], 224, 819, [8, 9]],
-[23, "penup", 224, 317, [2, 4]],
-[24, "pendown", 224, 525, [20, 30]],
-[25, ["string", "my box"], 319, 567, [30, null]],
-[26, "box", 379, 693, [18, 27, null]],
-[27, ["string", "my box"], 434, 693, [26, null]],
-[28, "box", 356, 777, [16, 29, null]],
-[29, ["string", "my box"], 411, 777, [28, null]],
-[30, ["storein", 0], 224, 567, [24, 25, 13, 31]],
-[31, ["vspace", 0], 224, 651, [30, 7]],
-[32, ["number", -600.0], 344, 359, [5, null]],
-[33, ["number", 600.0], 344, 401, [5, null]],
-[34, ["number", -450.0], 344, 441, [6, null]],
-[35, ["number", 450.0], 344, 483, [6, null]]]
+[[0, "setcolor", 560, 168, [11, 1, 2]],
+[1, ["number", 60], 637, 168, [0, null]],
+[2, ["repeat", 168], 560, 210, [0, 3, 38, null]],
+[3, ["number", 5000], 619, 210, [2, null]],
+[4, ["setxy2", 20.0], 848, 176, [23, 5, 6, 20]],
+[5, ["random", 0], 906, 176, [4, 32, 33, null]],
+[6, ["random", 0], 906, 258, [4, 34, 35, null]],
+[7, "setpensize", 578, 420, [31, 18, 21]],
+[8, "setshade", 578, 504, [21, 16, 22]],
+[9, "forward", 578, 588, [22, 10, null]],
+[10, ["number", 1], 649, 588, [9, null]],
+[11, "clean", 560, 126, [12, 0]],
+[12, ["start", 2.0], 560, 80, [null, 11]],
+[13, ["plus2", 0], 646, 336, [30, 14, 15]],
+[14, "ycor", 700, 336, [13, null]],
+[15, ["number", 900], 700, 378, [13, null]],
+[16, ["division2", 0], 663, 504, [8, 28, 17]],
+[17, ["number", 12], 757, 546, [16, null]],
+[18, ["division2", 0], 680, 420, [7, 26, 19]],
+[19, ["number", 9], 774, 462, [18, null]],
+[20, ["vspace", 0], 848, 300, [4, 24]],
+[21, ["vspace", 0], 578, 462, [7, 8]],
+[22, ["vspace", 0], 578, 546, [8, 9]],
+[23, "penup", 848, 134, [36, 4]],
+[24, "pendown", 848, 342, [20, null]],
+[25, ["string", "my box"], 646, 294, [30, null]],
+[26, "box", 750, 420, [18, 27, null]],
+[27, ["string", "my box"], 805, 420, [26, null]],
+[28, "box", 733, 504, [16, 29, null]],
+[29, ["string", "my box"], 788, 504, [28, null]],
+[30, ["storein", 0], 578, 294, [38, 25, 13, 31]],
+[31, ["vspace", 0], 578, 378, [30, 7]],
+[32, ["number", -600], 992, 176, [5, null]],
+[33, ["number", 600], 992, 218, [5, null]],
+[34, ["number", -450], 992, 258, [6, null]],
+[35, ["number", 450], 992, 300, [6, null]],
+[36, "hat", 848, 80, [null, 37, 23]],
+[37, ["string", "random xy"], 906, 92, [36, null]],
+[38, "stack", 578, 252, [2, 39, 30]],
+[39, ["string", "random xy"], 636, 252, [38, null]]]
diff --git a/samples/graphics-city.ta b/samples/graphics-city.ta
index e501e16..a211e77 100644
--- a/samples/graphics-city.ta
+++ b/samples/graphics-city.ta
@@ -1,149 +1,145 @@
-[[0, ["start", 2.0], 401, 0, [null, 65]],
-[1, "forward", 784, 194, [4, 143, 2]],
-[2, "right", 784, 236, [1, 3, null]],
-[3, ["number", 90], 842, 236, [2, null]],
-[4, "repeat", 719, 134, [7, 5, 1, 8]],
-[5, ["number", 4], 770, 134, [4, null]],
-[6, ["vspace", 0], 719, 254, [8, 15]],
-[7, "startfill", 719, 92, [19, 4]],
-[8, "stopfill", 719, 212, [4, 6]],
-[9, "repeat", 719, 380, [11, 10, 12, 42]],
-[10, ["number", 4], 770, 380, [9, null]],
-[11, ["vspace", 0], 719, 338, [15, 9]],
-[12, "forward", 784, 440, [9, 145, 13]],
-[13, "right", 784, 482, [12, 14, null]],
-[14, ["number", 90], 842, 482, [13, null]],
-[15, "setshade", 719, 296, [6, 18, 11]],
-[16, ["number", 50], 858, 338, [18, null]],
-[17, "shade", 858, 296, [18, null]],
-[18, ["plus2", 0], 804, 296, [15, 17, 16]],
-[19, "seth", 719, 50, [141, 20, 7]],
-[20, ["number", 45], 777, 50, [19, null]],
-[21, "seth", 57, 191, [131, 22, 125]],
-[22, ["number", 180], 115, 191, [21, null]],
-[23, "ycor", 179, 275, [25, null]],
-[24, "bottompos", 203, 317, [25, null]],
-[25, ["minus2", 0], 125, 275, [125, 23, 24]],
-[26, "forward", 122, 419, [31, 133, 34]],
-[27, "forward", 122, 503, [34, 67, 30]],
-[28, ["number", 2], 301, 545, [29, null]],
-[29, "sqrt", 247, 545, [67, 28]],
-[30, ["vspace", 0], 122, 545, [27, 36]],
-[31, "repeat", 57, 359, [43, 32, 26, 44]],
-[32, ["number", 2], 108, 359, [31, null]],
-[33, ["vspace", 60], 57, 479, [44, 56]],
-[34, "left", 122, 461, [26, 35, 27]],
-[35, ["number", 90], 180, 461, [34, null]],
-[36, "left", 122, 587, [30, 37, null]],
-[37, ["number", 90], 180, 587, [36, null]],
-[38, "setshade", 719, 750, [78, 41, null]],
-[39, ["number", 50], 882, 792, [41, null]],
-[40, "shade", 858, 750, [41, null]],
-[41, ["minus2", 0], 804, 750, [38, 40, 39]],
-[42, ["vspace", 20], 719, 458, [9, 69]],
-[43, "startfill", 57, 317, [125, 31]],
-[44, "stopfill", 57, 437, [31, 33]],
-[45, "repeat", 57, 725, [63, 46, 47, 64]],
-[46, ["number", 2], 108, 725, [45, null]],
-[47, "forward", 122, 785, [45, 137, 48]],
-[48, "left", 122, 827, [47, 49, 50]],
-[49, ["number", 90], 180, 827, [48, null]],
-[50, "forward", 122, 869, [48, 68, 53]],
-[51, "sqrt", 247, 911, [68, 52]],
-[52, ["number", 2], 301, 911, [51, null]],
-[53, ["vspace", 0], 122, 911, [50, 54]],
-[54, "left", 122, 953, [53, 55, null]],
-[55, ["number", 90], 180, 953, [54, null]],
-[56, "setshade", 57, 641, [33, 62, 63]],
-[57, ["number", 50], 196, 683, [62, null]],
-[58, "shade", 196, 641, [62, null]],
-[59, "setshade", 57, 1005, [64, 66, null]],
-[60, ["number", 50], 220, 1047, [66, null]],
-[61, "shade", 196, 1005, [66, null]],
-[62, ["plus2", 0], 142, 641, [56, 58, 57]],
-[63, ["vspace", 0], 57, 683, [56, 45]],
-[64, ["vspace", 80], 57, 803, [45, 59]],
-[65, "clean", 401, 42, [0, 79]],
-[66, ["minus2", 0], 142, 1005, [59, 61, 60]],
-[67, ["product2", 0], 193, 503, [27, 135, 29]],
-[68, ["product2", 0], 193, 869, [50, 139, 51]],
-[69, "seth", 719, 540, [42, 70, 71]],
-[70, ["number", 135], 777, 540, [69, null]],
-[71, "forward", 719, 582, [69, 147, 72]],
-[72, "seth", 719, 624, [71, 73, 77]],
-[73, ["number", 180], 777, 624, [72, null]],
-[74, "ycor", 844, 666, [75, null]],
-[75, ["minus2", 0], 790, 666, [77, 74, 76]],
-[76, "bottompos", 868, 708, [75, null]],
-[77, "forward", 719, 666, [72, 75, 78]],
-[78, ["vspace", 0], 719, 708, [77, 38]],
-[79, ["fillscreen", 0], 401, 84, [65, 80, 120, 123]],
-[80, ["number", 60], 483, 84, [79, null]],
-[81, ["random", 0], 469, 210, [123, 82, 83, null]],
-[82, ["number", 75], 555, 210, [81, null]],
-[83, ["number", 125], 555, 252, [81, null]],
-[84, "repeat", 401, 420, [99, 85, 118, null]],
-[85, ["number", 100], 452, 420, [84, null]],
-[86, ["setxy2", 40], 466, 690, [91, 87, 97, 92]],
-[87, ["random", 20], 524, 690, [86, 121, 89, null]],
-[88, "leftpos", 664, 690, [121, null]],
-[89, "rightpos", 610, 772, [87, null]],
-[90, "toppos", 523, 336, [96, null]],
-[91, "penup", 466, 648, [114, 86]],
-[92, "pendown", 466, 854, [86, 127]],
-[93, ["storein", 0], 401, 294, [106, 94, 96, 99]],
-[94, ["string", "top"], 469, 294, [93, null]],
-[95, ["number", 100], 547, 378, [96, null]],
-[96, ["minus2", 0], 469, 336, [93, 90, 95]],
-[97, "box", 524, 812, [86, 98, null]],
-[98, ["string", "top"], 579, 812, [97, null]],
-[99, ["vspace", 0], 401, 378, [93, 84]],
-[100, ["storein", 0], 466, 980, [129, 101, 105, null]],
-[101, ["string", "top"], 534, 980, [100, null]],
-[102, ["number", 3], 612, 1064, [105, null]],
-[103, "box", 588, 1022, [105, 104, null]],
-[104, ["string", "top"], 643, 1022, [103, null]],
-[105, ["minus2", 0], 534, 1022, [100, 103, 102]],
-[106, ["vspace", 0], 401, 252, [123, 93]],
-[107, "setshade", 466, 564, [119, 113, 114]],
-[108, ["number", 8], 629, 646, [113, null]],
-[109, "box", 683, 606, [112, 110, null]],
-[110, ["string", "top"], 738, 606, [109, null]],
-[111, "toppos", 659, 564, [112, null]],
-[112, ["minus2", 0], 605, 564, [113, 111, 109]],
-[113, ["division2", 20], 551, 564, [107, 112, 108]],
-[114, ["vspace", 0], 466, 606, [107, 91]],
-[115, ["random", 0], 543, 480, [118, 116, 117, null]],
-[116, ["number", 0], 629, 480, [115, null]],
-[117, ["number", 10], 629, 522, [115, null]],
-[118, "setcolor", 466, 480, [84, 115, 119]],
-[119, ["vspace", 0], 466, 522, [118, 107]],
-[120, ["number", 0], 483, 126, [79, null]],
-[121, ["minus2", 0], 610, 690, [87, 88, 122]],
-[122, ["number", 50], 688, 732, [121, null]],
-[123, ["storein", 0], 401, 168, [79, 124, 81, 106]],
-[124, ["string", "my box 1"], 469, 168, [123, null]],
-[125, ["storein", 0], 57, 233, [21, 126, 25, 43]],
-[126, ["string", "my box 2"], 125, 233, [125, null]],
-[127, "stack", 466, 896, [92, 128, 129]],
-[128, ["string", "building"], 524, 896, [127, null]],
-[129, "stack", 466, 938, [127, 130, 100]],
-[130, ["string", "roof"], 524, 938, [129, null]],
-[131, "hat", 57, 141, [null, 132, 21]],
-[132, ["string", "building"], 115, 149, [131, null]],
-[133, "box", 193, 419, [26, 134, null]],
-[134, ["string", "my box 2"], 248, 419, [133, null]],
-[135, "box", 247, 503, [67, 136, null]],
-[136, ["string", "my box 1"], 302, 503, [135, null]],
-[137, "box", 193, 785, [47, 138, null]],
-[138, ["string", "my box 2"], 248, 785, [137, null]],
-[139, "box", 247, 869, [68, 140, null]],
-[140, ["string", "my box 1"], 302, 869, [139, null]],
-[141, "hat", 719, 0, [null, 142, 19]],
-[142, ["string", "roof"], 777, 8, [141, null]],
-[143, "box", 855, 194, [1, 144, null]],
-[144, ["string", "my box 1"], 910, 194, [143, null]],
-[145, "box", 855, 440, [12, 146, null]],
-[146, ["string", "my box 1"], 910, 440, [145, null]],
-[147, "box", 790, 582, [71, 148, null]],
-[148, ["string", "my box 1"], 845, 582, [147, null]]]
+[[0, ["start", 2.0], 580, 80, [null, 61]],
+[1, "forward", 978, 260, [4, 139, 2]],
+[2, "right", 978, 302, [1, 3, null]],
+[3, ["number", 90], 1036, 302, [2, null]],
+[4, ["repeat", 21], 960, 218, [6, 5, 1, 7]],
+[5, ["number", 4], 1019, 218, [4, null]],
+[6, "startfill", 960, 176, [18, 4]],
+[7, "stopfill", 960, 362, [4, 14]],
+[8, ["repeat", 21], 960, 488, [10, 9, 11, 65]],
+[9, ["number", 4], 1019, 488, [8, null]],
+[10, ["vspace", 0], 960, 446, [14, 8]],
+[11, "forward", 978, 530, [8, 141, 12]],
+[12, "right", 978, 572, [11, 13, null]],
+[13, ["number", 90], 1036, 572, [12, null]],
+[14, "setshade", 960, 404, [7, 17, 10]],
+[15, ["number", 50], 1099, 446, [17, null]],
+[16, "shade", 1099, 404, [17, null]],
+[17, ["plus2", 0], 1045, 404, [14, 16, 15]],
+[18, "seth", 960, 134, [137, 19, 6]],
+[19, ["number", 45], 1059, 134, [18, null]],
+[20, "seth", 220, 134, [127, 21, 121]],
+[21, ["number", 180], 319, 134, [20, null]],
+[22, "ycor", 361, 218, [24, null]],
+[23, "bottompos", 385, 260, [24, null]],
+[24, ["minus2", 0], 288, 218, [121, 22, 23]],
+[25, "forward", 238, 344, [30, 129, 32]],
+[26, "forward", 238, 428, [32, 63, 29]],
+[27, ["number", 2], 417, 470, [28, null]],
+[28, "sqrt", 363, 470, [63, 27]],
+[29, ["vspace", 0], 238, 470, [26, 34]],
+[30, ["repeat", 84], 220, 302, [40, 31, 25, 41]],
+[31, ["number", 2], 279, 302, [30, null]],
+[32, "left", 238, 386, [25, 33, 26]],
+[33, ["number", 90], 296, 386, [32, null]],
+[34, "left", 238, 512, [29, 35, null]],
+[35, ["number", 90], 296, 512, [34, null]],
+[36, "setshade", 960, 842, [74, 39, null]],
+[37, ["number", 50], 1142, 884, [39, null]],
+[38, "shade", 1118, 842, [39, null]],
+[39, ["minus2", 0], 1045, 842, [36, 38, 37]],
+[40, "startfill", 220, 260, [121, 30]],
+[41, "stopfill", 220, 572, [30, 53]],
+[42, ["repeat", 84], 220, 698, [60, 43, 44, 56]],
+[43, ["number", 2], 279, 698, [42, null]],
+[44, "forward", 238, 740, [42, 133, 45]],
+[45, "left", 238, 782, [44, 46, 47]],
+[46, ["number", 90], 296, 782, [45, null]],
+[47, "forward", 238, 824, [45, 64, 50]],
+[48, "sqrt", 363, 866, [64, 49]],
+[49, ["number", 2], 417, 866, [48, null]],
+[50, ["vspace", 0], 238, 866, [47, 51]],
+[51, "left", 238, 908, [50, 52, null]],
+[52, ["number", 90], 296, 908, [51, null]],
+[53, "setshade", 220, 614, [41, 59, 60]],
+[54, ["number", 50], 359, 656, [59, null]],
+[55, "shade", 359, 614, [59, null]],
+[56, "setshade", 220, 968, [42, 62, null]],
+[57, ["number", 50], 402, 1010, [62, null]],
+[58, "shade", 378, 968, [62, null]],
+[59, ["plus2", 0], 305, 614, [53, 55, 54]],
+[60, ["vspace", 0], 220, 656, [53, 42]],
+[61, "clean", 580, 126, [0, 75]],
+[62, ["minus2", 0], 305, 968, [56, 58, 57]],
+[63, ["product2", 0], 309, 428, [26, 131, 28]],
+[64, ["product2", 0], 309, 824, [47, 135, 48]],
+[65, "seth", 960, 632, [8, 66, 67]],
+[66, ["number", 135], 1059, 632, [65, null]],
+[67, "forward", 960, 674, [65, 143, 68]],
+[68, "seth", 960, 716, [67, 69, 73]],
+[69, ["number", 180], 1059, 716, [68, null]],
+[70, "ycor", 1104, 758, [71, null]],
+[71, ["minus2", 0], 1031, 758, [73, 70, 72]],
+[72, "bottompos", 1128, 800, [71, null]],
+[73, "forward", 960, 758, [68, 71, 74]],
+[74, ["vspace", 0], 960, 800, [73, 36]],
+[75, ["fillscreen", 0], 580, 168, [61, 76, 116, 119]],
+[76, ["number", 60], 662, 168, [75, null]],
+[77, ["random", 0], 648, 294, [119, 78, 79, null]],
+[78, ["number", 75], 734, 294, [77, null]],
+[79, ["number", 125], 734, 336, [77, null]],
+[80, ["repeat", 271], 580, 504, [95, 81, 114, null]],
+[81, ["number", 100], 639, 504, [80, null]],
+[82, ["setxy2", 40], 598, 756, [87, 83, 93, 88]],
+[83, ["random", 20], 656, 756, [82, 117, 85, null]],
+[84, "leftpos", 815, 756, [117, null]],
+[85, "rightpos", 742, 838, [83, null]],
+[86, "toppos", 721, 420, [92, null]],
+[87, "penup", 598, 714, [110, 82]],
+[88, "pendown", 598, 920, [82, 123]],
+[89, ["storein", 0], 580, 378, [102, 90, 92, 95]],
+[90, ["string", "top"], 648, 378, [89, null]],
+[91, ["number", 100], 745, 462, [92, null]],
+[92, ["minus2", 0], 648, 420, [89, 86, 91]],
+[93, "box", 656, 878, [82, 94, null]],
+[94, ["string", "top"], 711, 878, [93, null]],
+[95, ["vspace", 0], 580, 462, [89, 80]],
+[96, ["storein", 0], 598, 1046, [125, 97, 101, null]],
+[97, ["string", "top"], 666, 1046, [96, null]],
+[98, ["number", 3], 763, 1130, [101, null]],
+[99, "box", 739, 1088, [101, 100, null]],
+[100, ["string", "top"], 794, 1088, [99, null]],
+[101, ["minus2", 0], 666, 1088, [96, 99, 98]],
+[102, ["vspace", 0], 580, 336, [119, 89]],
+[103, "setshade", 598, 630, [115, 109, 110]],
+[104, ["number", 8], 777, 712, [109, null]],
+[105, "box", 850, 672, [108, 106, null]],
+[106, ["string", "top"], 905, 672, [105, null]],
+[107, "toppos", 826, 630, [108, null]],
+[108, ["minus2", 0], 753, 630, [109, 107, 105]],
+[109, ["division2", 20], 683, 630, [103, 108, 104]],
+[110, ["vspace", 0], 598, 672, [103, 87]],
+[111, ["random", 0], 675, 546, [114, 112, 113, null]],
+[112, ["number", 0], 761, 546, [111, null]],
+[113, ["number", 10], 761, 588, [111, null]],
+[114, "setcolor", 598, 546, [80, 111, 115]],
+[115, ["vspace", 0], 598, 588, [114, 103]],
+[116, ["number", 0], 662, 210, [75, null]],
+[117, ["minus2", 0], 742, 756, [83, 84, 118]],
+[118, ["number", 50], 839, 798, [117, null]],
+[119, ["storein", 0], 580, 252, [75, 120, 77, 102]],
+[120, ["string", "my box 1"], 648, 252, [119, null]],
+[121, ["storein", 0], 220, 176, [20, 122, 24, 40]],
+[122, ["string", "my box 2"], 288, 176, [121, null]],
+[123, "stack", 598, 962, [88, 124, 125]],
+[124, ["string", "building"], 656, 962, [123, null]],
+[125, "stack", 598, 1004, [123, 126, 96]],
+[126, ["string", "roof"], 656, 1004, [125, null]],
+[127, "hat", 220, 80, [null, 128, 20]],
+[128, ["string", "building"], 278, 92, [127, null]],
+[129, "box", 309, 344, [25, 130, null]],
+[130, ["string", "my box 2"], 364, 344, [129, null]],
+[131, "box", 363, 428, [63, 132, null]],
+[132, ["string", "my box 1"], 418, 428, [131, null]],
+[133, "box", 309, 740, [44, 134, null]],
+[134, ["string", "my box 2"], 364, 740, [133, null]],
+[135, "box", 363, 824, [64, 136, null]],
+[136, ["string", "my box 1"], 418, 824, [135, null]],
+[137, "hat", 960, 80, [null, 138, 18]],
+[138, ["string", "roof"], 1018, 92, [137, null]],
+[139, "box", 1049, 260, [1, 140, null]],
+[140, ["string", "my box 1"], 1104, 260, [139, null]],
+[141, "box", 1049, 530, [11, 142, null]],
+[142, ["string", "my box 1"], 1104, 530, [141, null]],
+[143, "box", 1031, 674, [67, 144, null]],
+[144, ["string", "my box 1"], 1086, 674, [143, null]]]
diff --git a/samples/graphics-csquiral.ta b/samples/graphics-csquiral.ta
index 9b77344..397b665 100644
--- a/samples/graphics-csquiral.ta
+++ b/samples/graphics-csquiral.ta
@@ -1,24 +1,24 @@
[[0, ["start", 2.0], 719, 108, [null, 1]],
[1, "clean", 719, 154, [0, 2]],
[2, "storeinbox1", 719, 196, [1, 3, 4]],
-[3, ["number", 1], 836, 196, [2, null]],
+[3, ["number", 1], 837, 196, [2, null]],
[4, "setpensize", 719, 238, [2, 5, 6]],
[5, ["number", 20], 821, 238, [4, null]],
-[6, ["repeat", 84], 719, 280, [4, 7, 8, null]],
-[7, ["number", 1300], 777, 280, [6, null]],
+[6, ["repeat", 105], 719, 280, [4, 7, 8, null]],
+[7, ["number", 1300], 778, 280, [6, null]],
[8, "forward", 737, 322, [6, 9, 10]],
-[9, "box1", 807, 322, [8, null]],
+[9, "box1", 808, 322, [8, null]],
[10, "right", 737, 364, [8, 11, 12]],
[11, ["number", 91], 795, 364, [10, null]],
-[12, "setcolor", 737, 406, [10, 22, 16]],
-[13, ["division2", 0], 948, 406, [22, 14, 15]],
-[14, "xcor", 1018, 406, [13, null]],
-[15, ["number", 6], 1042, 448, [13, null]],
-[16, "setshade", 737, 448, [12, 17, 18]],
-[17, "heading", 822, 448, [16, null]],
-[18, "storeinbox1", 737, 490, [16, 19, null]],
-[19, ["plus2", 0], 854, 490, [18, 20, 21]],
-[20, "box1", 908, 490, [19, null]],
-[21, ["number", 1], 908, 532, [19, null]],
-[22, ["identity2", 40], 814, 406, [12, 13]],
+[12, "setcolor", 737, 406, [10, 13, 22]],
+[13, ["division2", 0], 814, 406, [12, 14, 15]],
+[14, "xcor", 884, 406, [13, null]],
+[15, ["number", 6], 908, 448, [13, null]],
+[16, "setshade", 737, 490, [22, 17, 18]],
+[17, "heading", 822, 490, [16, null]],
+[18, "storeinbox1", 737, 532, [16, 19, null]],
+[19, ["plus2", 0], 855, 532, [18, 20, 21]],
+[20, "box1", 909, 532, [19, null]],
+[21, ["number", 1], 909, 574, [19, null]],
+[22, ["vspace", 0], 737, 448, [12, 16]],
[-1, ["turtle", "Yertle"], 907.9985581895907, 87.04554561204145, 220.0, 151.33309303159845, 220.0, 20.0]] \ No newline at end of file
diff --git a/samples/graphics-dots.ta b/samples/graphics-dots.ta
index 5f12daa..01c0f0f 100644
--- a/samples/graphics-dots.ta
+++ b/samples/graphics-dots.ta
@@ -1,30 +1,38 @@
-[[0, "clean", 338, 42, [1, 2]],
-[1, ["start", 2.0], 338, 0, [null, 0]],
-[2, "setcolor", 338, 84, [0, 3, 4]],
-[3, ["number", 0], 415, 84, [2, null]],
-[4, "setpensize", 338, 126, [2, 5, 19]],
-[5, ["number", 20], 440, 126, [4, null]],
-[6, "repeat", 338, 252, [19, 7, 8, null]],
-[7, ["number", 1000], 389, 252, [6, null]],
-[8, "pendown", 403, 312, [6, 9]],
-[9, "forward", 403, 354, [8, 10, 11]],
-[10, ["number", 1], 474, 354, [9, null]],
-[11, "penup", 403, 396, [9, 12]],
-[12, "forward", 403, 438, [11, 22, 13]],
-[13, "right", 403, 480, [12, 14, 26]],
-[14, ["number", 93], 461, 480, [13, null]],
-[15, ["plus2", 0], 471, 564, [26, 28, 16]],
-[16, ["number", 1], 525, 606, [15, null]],
-[17, "setcolor", 403, 648, [18, 24, null]],
-[18, ["vspace", 0], 403, 606, [26, 17]],
-[19, ["storein", 0], 338, 168, [4, 20, 21, 6]],
-[20, ["string", "my box"], 406, 168, [19, null]],
-[21, ["number", 0.0], 406, 210, [19, null]],
-[22, "box", 474, 438, [12, 23, null]],
-[23, ["string", "my box"], 529, 438, [22, null]],
-[24, "box", 480, 648, [17, 25, null]],
-[25, ["string", "my box"], 535, 648, [24, null]],
-[26, ["storein", 0], 403, 522, [13, 27, 15, 18]],
-[27, ["string", "my box"], 471, 522, [26, null]],
-[28, "box", 525, 564, [15, 29, null]],
-[29, ["string", "my box"], 580, 564, [28, null]]]
+[[0, "clean", 760, 186, [1, 34]],
+[1, ["start", 2.0], 760, 140, [null, 0]],
+[2, "setcolor", 760, 354, [34, 3, 4]],
+[3, ["number", 0], 837, 354, [2, null]],
+[4, "setpensize", 760, 396, [2, 5, 19]],
+[5, ["number", 20], 862, 396, [4, null]],
+[6, ["repeat", 0], 760, 522, [19, 7, 32, null]],
+[7, ["number", 1000], 819, 522, [6, null]],
+[8, "pendown", 1020, 254, [30, 9]],
+[9, "forward", 1020, 296, [8, 10, 11]],
+[10, ["number", 1], 1091, 296, [9, null]],
+[11, "penup", 1020, 338, [9, 12]],
+[12, "forward", 1020, 380, [11, 22, 13]],
+[13, "right", 1020, 422, [12, 14, 26]],
+[14, ["number", 93], 1078, 422, [13, null]],
+[15, ["plus2", 0], 1088, 506, [26, 28, 16]],
+[16, ["number", 1], 1142, 548, [15, null]],
+[17, "setcolor", 1020, 590, [18, 24, null]],
+[18, ["vspace", 0], 1020, 548, [26, 17]],
+[19, ["storein", 0], 760, 438, [4, 20, 21, 6]],
+[20, ["string", "my box"], 828, 438, [19, null]],
+[21, ["number", 0], 828, 480, [19, null]],
+[22, "box", 1091, 380, [12, 23, null]],
+[23, ["string", "my box"], 1146, 380, [22, null]],
+[24, "box", 1097, 590, [17, 25, null]],
+[25, ["string", "my box"], 1152, 590, [24, null]],
+[26, ["storein", 0], 1020, 464, [13, 27, 15, 18]],
+[27, ["string", "my box"], 1088, 464, [26, null]],
+[28, "box", 1142, 506, [15, 29, null]],
+[29, ["string", "my box"], 1197, 506, [28, null]],
+[30, "hat", 1020, 200, [null, 31, 8]],
+[31, ["string", "dot"], 1078, 212, [30, null]],
+[32, "stack", 778, 564, [6, 33, null]],
+[33, ["string", "dot"], 836, 564, [32, null]],
+[34, "fillscreen2", 760, 228, [0, 35, 37, 36, 2]],
+[35, ["number", 60], 842, 228, [34, null]],
+[36, ["number", 100], 842, 312, [34, null]],
+[37, "white", 842, 270, [34, null]]]
diff --git a/samples/graphics-jonny-emerson.ta b/samples/graphics-jonny-emerson.ta
deleted file mode 100644
index da6bec8..0000000
--- a/samples/graphics-jonny-emerson.ta
+++ /dev/null
@@ -1,74 +0,0 @@
-[[0, ["start", 2.0], 47, 205, [null, 1]],
-[1, "fillscreen2", 47, 251, [0, 2, 4, 3, 5]],
-[2, ["number", 0.0], 129, 251, [1, null]],
-[3, ["number", 0.0], 129, 335, [1, null]],
-[4, ["number", 0.0], 129, 293, [1, null]],
-[5, "setcolor", 47, 377, [1, 6, 7]],
-[6, ["number", 75.0], 124, 377, [5, null]],
-[7, "setpensize", 47, 419, [5, 8, 9]],
-[8, ["number", 7.0], 149, 419, [7, null]],
-[9, "stack", 47, 461, [7, 10, null]],
-[10, ["string", "action 1"], 105, 461, [9, null]],
-[11, "hat", 308, 192, [null, 12, 13]],
-[12, ["string", "action 1"], 366, 204, [11, null]],
-[13, ["storein", 0], 308, 246, [11, 14, 15, 19]],
-[14, ["string", "my box 3"], 376, 246, [13, null]],
-[15, ["number", 100], 376, 288, [13, null]],
-[16, "setshade", 326, 414, [21, 17, 25]],
-[17, "box", 411, 414, [16, 18, null]],
-[18, ["string", "my box 3"], 466, 414, [17, null]],
-[19, ["repeat", 126], 308, 330, [13, 20, 21, null]],
-[20, ["number", 70.0], 367, 330, [19, null]],
-[21, "seth", 326, 372, [19, 22, 16]],
-[22, ["number", 0], 425, 372, [21, null]],
-[23, "hat", 784, 76, [null, 24, 38]],
-[24, ["string", "action 2"], 842, 88, [23, null]],
-[25, "stack", 326, 456, [16, 26, 27]],
-[26, ["string", "action 2"], 384, 456, [25, null]],
-[27, "seth", 326, 498, [25, 28, 29]],
-[28, ["number", 180.0], 425, 498, [27, null]],
-[29, "stack", 326, 540, [27, 30, 31]],
-[30, ["string", "action 2"], 384, 540, [29, null]],
-[31, ["storein", 0], 326, 582, [29, 32, 36, null]],
-[32, ["string", "my box 3"], 394, 582, [31, null]],
-[33, ["number", 1.0], 448, 666, [36, null]],
-[34, "box", 448, 624, [36, 35, null]],
-[35, ["string", "my box 3"], 503, 624, [34, null]],
-[36, ["plus2", 0], 394, 624, [31, 34, 33]],
-[37, "right", 784, 298, [41, 44, 46]],
-[38, ["storein", 0], 784, 130, [23, 39, 40, 41]],
-[39, ["string", "my box 1"], 852, 130, [38, null]],
-[40, ["number", 10.0], 852, 172, [38, null]],
-[41, ["storein", 0], 784, 214, [38, 42, 43, 37]],
-[42, ["string", "my box 2"], 852, 214, [41, null]],
-[43, ["number", 200.0], 852, 256, [41, null]],
-[44, "box", 842, 298, [37, 45, null]],
-[45, ["string", "my box 3"], 897, 298, [44, null]],
-[46, "penup", 784, 340, [37, 48]],
-[47, "pendown", 784, 466, [48, 51]],
-[48, ["setxy2", 0], 784, 382, [46, 49, 50, 47]],
-[49, ["number", 0], 842, 382, [48, null]],
-[50, ["number", 0], 842, 424, [48, null]],
-[51, ["repeat", 147], 784, 508, [47, 52, 53, null]],
-[52, ["number", 40.0], 843, 508, [51, null]],
-[53, ["arc", 0], 802, 550, [51, 56, 54, 58]],
-[54, "box", 860, 592, [53, 55, null]],
-[55, ["string", "my box 1"], 915, 592, [54, null]],
-[56, "box", 860, 550, [53, 57, null]],
-[57, ["string", "my box 2"], 915, 550, [56, null]],
-[58, "left", 802, 634, [53, 59, 70]],
-[59, ["number", 100.0], 860, 634, [58, null]],
-[60, ["plus2", 0], 870, 718, [70, 68, 63]],
-[61, ["minus2", 0], 870, 844, [64, 66, 62]],
-[62, ["number", 10.0], 948, 886, [61, null]],
-[63, ["number", 10.0], 924, 760, [60, null]],
-[64, ["storein", 0], 802, 802, [72, 65, 61, null]],
-[65, ["string", "my box 2"], 870, 802, [64, null]],
-[66, "box", 924, 844, [61, 67, null]],
-[67, ["string", "my box 2"], 979, 844, [66, null]],
-[68, "box", 924, 718, [60, 69, null]],
-[69, ["string", "my box 1"], 979, 718, [68, null]],
-[70, ["storein", 0], 802, 676, [58, 71, 60, 72]],
-[71, ["string", "my box 1"], 870, 676, [70, null]],
-[72, ["vspace", 0], 802, 760, [70, 64]]]
-
diff --git a/samples/graphics-redwisp.ta b/samples/graphics-redwisp.ta
index f0eb998..4f3fcee 100644
--- a/samples/graphics-redwisp.ta
+++ b/samples/graphics-redwisp.ta
@@ -1,42 +1,41 @@
-[[0, "setpensize", 140, 224, [2, 1, 3]],
-[1, ["number", 15], 242, 224, [0, null]],
-[2, "clean", 140, 182, [6, 0]],
-[3, "repeat", 140, 266, [0, 4, 37, null]],
-[4, ["number", 360], 191, 266, [3, null]],
-[5, "setshade", 205, 452, [32, 10, 41]],
-[6, ["start", 2.0], 140, 140, [null, 2]],
-[7, ["product2", 0], 273, 368, [37, 8, 9]],
-[8, "heading", 327, 368, [7, null]],
-[9, ["number", 600], 327, 410, [7, null]],
-[10, ["division2", 0], 290, 452, [5, 39, 11]],
-[11, ["number", 360], 368, 494, [10, null]],
-[12, "repeat", 560, 190, [33, 13, 14, 20]],
-[13, ["number", 4], 611, 190, [12, null]],
-[14, ["arc", 0], 625, 250, [12, 15, 16, 17]],
-[15, ["number", 180], 683, 250, [14, null]],
-[16, ["number", 75], 683, 292, [14, null]],
-[17, ["arc", 0], 625, 334, [14, 18, 19, null]],
-[18, ["number", -180], 683, 334, [17, null]],
-[19, ["number", 75], 683, 376, [17, null]],
-[20, ["vspace", 60.0], 560, 268, [12, 21]],
-[21, "repeat", 560, 430, [20, 22, 23, 29]],
-[22, ["number", 4], 611, 430, [21, null]],
-[23, ["arc", 0], 625, 490, [21, 24, 25, 26]],
-[24, ["number", -180], 683, 490, [23, null]],
-[25, ["number", -75], 683, 532, [23, null]],
-[26, ["arc", 0], 625, 574, [23, 27, 28, null]],
-[27, ["number", 180], 683, 574, [26, null]],
-[28, ["number", -75], 683, 616, [26, null]],
-[29, ["vspace", 60.0], 560, 508, [21, 30]],
-[30, "right", 560, 670, [29, 31, null]],
-[31, ["number", 1], 618, 670, [30, null]],
-[32, ["vspace", 0], 205, 410, [37, 5]],
-[33, "hat", 560, 140, [null, 34, 12]],
-[34, ["string", "action"], 618, 148, [33, null]],
-[35, "stack", 205, 536, [41, 36, null]],
-[36, ["string", "action"], 263, 536, [35, null]],
-[37, ["storein", 0], 205, 326, [3, 38, 7, 32]],
-[38, ["string", "my box"], 273, 326, [37, null]],
-[39, "box", 344, 452, [10, 40, null]],
-[40, ["string", "my box"], 399, 452, [39, null]],
-[41, ["vspace", 0], 205, 494, [5, 35]]]
+[[0, "setpensize", 500, 168, [2, 1, 3]],
+[1, ["number", 15], 602, 168, [0, null]],
+[2, "clean", 500, 126, [6, 0]],
+[3, ["repeat", 105], 500, 210, [0, 4, 35, null]],
+[4, ["number", 360], 559, 210, [3, null]],
+[5, "setshade", 518, 378, [30, 10, 39]],
+[6, ["start", 2.0], 500, 80, [null, 2]],
+[7, ["product2", 0], 586, 294, [35, 8, 9]],
+[8, "heading", 640, 294, [7, null]],
+[9, ["number", 600], 640, 336, [7, null]],
+[10, ["division2", 0], 603, 378, [5, 37, 11]],
+[11, ["number", 360], 697, 420, [10, null]],
+[12, ["repeat", 63], 860, 134, [31, 13, 14, 20]],
+[13, ["number", 4], 919, 134, [12, null]],
+[14, ["arc", 0], 878, 176, [12, 15, 16, 17]],
+[15, ["number", 180], 936, 176, [14, null]],
+[16, ["number", 75], 936, 218, [14, null]],
+[17, ["arc", 0], 878, 260, [14, 18, 19, null]],
+[18, ["number", -180], 936, 260, [17, null]],
+[19, ["number", 75], 936, 302, [17, null]],
+[20, ["repeat", 63], 860, 362, [12, 21, 22, 28]],
+[21, ["number", 4], 919, 362, [20, null]],
+[22, ["arc", 0], 878, 404, [20, 23, 24, 25]],
+[23, ["number", -180], 936, 404, [22, null]],
+[24, ["number", -75], 936, 446, [22, null]],
+[25, ["arc", 0], 878, 488, [22, 26, 27, null]],
+[26, ["number", 180], 936, 488, [25, null]],
+[27, ["number", -75], 936, 530, [25, null]],
+[28, "right", 860, 590, [20, 29, null]],
+[29, ["number", 1], 918, 590, [28, null]],
+[30, ["vspace", 0], 518, 336, [35, 5]],
+[31, "hat", 860, 80, [null, 32, 12]],
+[32, ["string", "action"], 918, 92, [31, null]],
+[33, "stack", 518, 462, [39, 34, null]],
+[34, ["string", "action"], 576, 462, [33, null]],
+[35, ["storein", 0], 518, 252, [3, 36, 7, 30]],
+[36, ["string", "my box"], 586, 252, [35, null]],
+[37, "box", 673, 378, [10, 38, null]],
+[38, ["string", "my box"], 728, 378, [37, null]],
+[39, ["vspace", 0], 518, 420, [5, 33]],
+[-1, ["turtle", "Yertle"], 0.0, 0.0, 0.0, 99.72222222222223, 50, 15.0]] \ No newline at end of file
diff --git a/samples/math-dice.ta b/samples/math-dice.ta
index 4e1592a..ee1f310 100644
--- a/samples/math-dice.ta
+++ b/samples/math-dice.ta
@@ -1,108 +1,115 @@
-[[0, ["start", 2.0], 743, 65, [null, 20]],
-[1, ["random", 0], 168, 418, [7, 2, 3, null]],
-[2, ["number", 1], 254, 418, [1, null]],
-[3, ["number", 6], 254, 460, [1, null]],
-[4, ["random", 0], 168, 336, [7, 5, 6, null]],
-[5, ["number", 1], 254, 336, [4, null]],
-[6, ["number", 6], 254, 378, [4, null]],
-[7, ["plus2", 20], 114, 336, [78, 4, 1]],
-[8, ["storein", 0], 46, 500, [12, 96, 11, null]],
-[9, ["number", 1], 168, 584, [11, null]],
-[10, "box", 168, 542, [11, 98, null]],
-[11, ["plus2", 0], 114, 542, [8, 10, 9]],
-[12, ["vspace", 40], 46, 378, [78, 8]],
-[13, ["repeat", 124], 28, 252, [14, 23, 78, null]],
-[14, "hat", 28, 198, [null, 15, 13]],
-[15, ["string", "toss dice"], 86, 210, [14, null]],
-[16, "stack", 743, 237, [27, 17, 18]],
-[17, ["string", "toss dice"], 801, 237, [16, null]],
-[18, "stack", 743, 279, [16, 19, null]],
-[19, ["string", "plot results"], 801, 279, [18, null]],
-[20, ["storein", 0], 743, 111, [0, 21, 22, 27]],
-[21, ["string", "trials"], 811, 111, [20, null]],
-[22, ["number", 1600.0], 811, 153, [20, null]],
-[23, "box", 87, 252, [13, 24, null]],
-[24, ["string", "trials"], 142, 252, [23, null]],
-[25, "hat", 869, 333, [null, 26, 85]],
-[26, ["string", "clear bins"], 927, 345, [25, null]],
-[27, "stack", 743, 195, [20, 28, 16]],
-[28, ["string", "clear bins"], 801, 195, [27, null]],
-[29, ["storein", 0], 887, 513, [33, 88, 30, 83]],
-[30, ["number", 0], 955, 555, [29, null]],
-[31, ["number", 1], 1009, 681, [32, null]],
-[32, ["plus2", 0], 955, 639, [83, 90, 31]],
-[33, ["repeat", 63], 869, 471, [85, 34, 29, null]],
-[34, ["number", 11.0], 928, 471, [33, null]],
-[35, "hat", 475, 98, [null, 36, 64]],
-[36, ["string", "plot results"], 533, 110, [35, null]],
-[37, "penup", 493, 362, [45, 39]],
-[38, "pendown", 493, 694, [71, 61]],
-[39, ["setxy2", 40], 493, 404, [37, 41, 40, 68]],
-[40, ["number", 0], 551, 526, [39, null]],
-[41, ["product2", 0], 551, 404, [39, 44, 42]],
-[42, ["minus2", 0], 605, 446, [41, 92, 43]],
-[43, ["number", 6], 683, 488, [42, null]],
-[44, ["number", 50], 605, 404, [41, null]],
-[45, ["repeat", 406], 475, 320, [80, 46, 37, 73]],
-[46, ["number", 11], 534, 320, [45, null]],
-[47, ["repeat", 63], 493, 862, [57, 48, 50, 58]],
-[48, ["number", 2], 552, 862, [47, null]],
-[49, ["vspace", 0], 493, 778, [61, 57]],
-[50, "forward", 511, 904, [47, 67, 51]],
-[51, "right", 511, 946, [50, 52, 53]],
-[52, ["number", 90], 569, 946, [51, null]],
-[53, "forward", 511, 988, [51, 54, 55]],
-[54, ["number", 40], 582, 988, [53, null]],
-[55, "right", 511, 1030, [53, 56, null]],
-[56, ["number", 90], 569, 1030, [55, null]],
-[57, "startfill", 493, 820, [49, 47]],
-[58, "stopfill", 493, 1090, [47, 100]],
-[59, ["number", 1], 615, 1216, [60, null]],
-[60, ["plus2", 0], 561, 1174, [100, 102, 59]],
-[61, "setcolor", 493, 736, [38, 63, 49]],
-[62, ["number", 10], 624, 778, [63, null]],
-[63, ["product2", 0], 570, 736, [61, 104, 62]],
-[64, "clean", 475, 152, [35, 65]],
-[65, "setshade", 475, 194, [64, 66, 80]],
-[66, ["number", 25], 560, 194, [65, null]],
-[67, "box", 582, 904, [50, 106, null]],
-[68, "back", 493, 568, [39, 69, 70]],
-[69, ["number", 50], 551, 568, [68, null]],
-[70, "show", 493, 610, [68, 94, 71]],
-[71, "forward", 493, 652, [70, 72, 38]],
-[72, ["number", 50], 564, 652, [71, null]],
-[73, "penup", 475, 1234, [45, 75]],
-[74, "pendown", 475, 1360, [75, null]],
-[75, ["setxy2", 0], 475, 1276, [73, 76, 77, 74]],
-[76, ["number", 0], 533, 1276, [75, null]],
-[77, ["number", -50], 533, 1318, [75, null]],
-[78, ["storein", 0], 46, 294, [13, 79, 7, 12]],
-[79, ["string", "box"], 114, 294, [78, null]],
-[80, ["storein", 0], 475, 236, [65, 81, 82, 45]],
-[81, ["string", "box"], 543, 236, [80, null]],
-[82, ["number", 2.0], 543, 278, [80, null]],
-[83, ["storein", 0], 887, 597, [29, 84, 32, null]],
-[84, ["string", "box"], 955, 597, [83, null]],
-[85, ["storein", 0], 869, 387, [25, 86, 87, 33]],
-[86, ["string", "box"], 937, 387, [85, null]],
-[87, ["number", 2.0], 937, 429, [85, null]],
-[88, "box", 955, 513, [29, 89, null]],
-[89, ["string", "box"], 1010, 513, [88, null]],
-[90, "box", 1009, 639, [32, 91, null]],
-[91, ["string", "box"], 1064, 639, [90, null]],
-[92, "box", 659, 446, [42, 93, null]],
-[93, ["string", "box"], 714, 446, [92, null]],
-[94, "box", 551, 610, [70, 95, null]],
-[95, ["string", "box"], 606, 610, [94, null]],
-[96, "box", 114, 500, [8, 97, null]],
-[97, ["string", "box"], 169, 500, [96, null]],
-[98, "box", 223, 542, [10, 99, null]],
-[99, ["string", "box"], 278, 542, [98, null]],
-[100, ["storein", 0], 493, 1132, [58, 101, 60, null]],
-[101, ["string", "box"], 561, 1132, [100, null]],
-[102, "box", 615, 1174, [60, 103, null]],
-[103, ["string", "box"], 670, 1174, [102, null]],
-[104, "box", 624, 736, [63, 105, null]],
-[105, ["string", "box"], 679, 736, [104, null]],
-[106, "box", 637, 904, [67, 107, null]],
-[107, ["string", "box"], 692, 904, [106, null]]]
+[[0, ["start", 1.334], 400, 120, [null, 20]],
+[1, ["random", 0], 293, 567, [7, 2, 3, null]],
+[2, ["number", 1], 350, 567, [1, null]],
+[3, ["number", 6], 350, 595, [1, null]],
+[4, ["random", 0], 293, 512, [7, 5, 6, null]],
+[5, ["number", 1], 350, 512, [4, null]],
+[6, ["number", 6], 350, 540, [4, null]],
+[7, ["plus2", 20], 257, 512, [75, 4, 1]],
+[8, ["storein", 0], 212, 622, [12, 93, 11, null]],
+[9, ["number", 1], 293, 678, [11, null]],
+[10, "box", 293, 650, [11, 95, null]],
+[11, ["plus2", 0], 257, 650, [8, 10, 9]],
+[12, ["vspace", 40], 212, 540, [75, 8]],
+[13, ["repeat", 124], 200, 456, [14, 23, 75, null]],
+[14, "hat", 200, 420, [null, 15, 13]],
+[15, ["string", "toss dice"], 239, 428, [14, null]],
+[16, "stack", 400, 235, [27, 17, 18]],
+[17, ["string", "toss dice"], 439, 235, [16, null]],
+[18, "stack", 400, 263, [16, 19, null]],
+[19, ["string", "plot results"], 439, 263, [18, null]],
+[20, ["storein", 0], 400, 151, [0, 21, 22, 27]],
+[21, ["string", "trials"], 445, 151, [20, null]],
+[22, ["number", 1600], 445, 179, [20, null]],
+[23, "box", 239, 456, [13, 24, null]],
+[24, ["string", "trials"], 276, 456, [23, null]],
+[25, "hat", 200, 180, [null, 26, 82]],
+[26, ["string", "clear bins"], 239, 188, [25, null]],
+[27, "stack", 400, 207, [20, 28, 16]],
+[28, ["string", "clear bins"], 439, 207, [27, null]],
+[29, ["storein", 0], 212, 300, [33, 85, 30, 107]],
+[30, ["number", 0], 257, 328, [29, null]],
+[31, ["number", 1], 1001, 252, [32, null]],
+[32, ["plus2", 0], 965, 224, [80, 87, 31]],
+[33, ["repeat", 42], 200, 272, [82, 34, 29, null]],
+[34, ["number", 11], 239, 272, [33, null]],
+[35, "hat", 480, 420, [null, 36, 61]],
+[36, ["string", "plot results"], 519, 428, [35, null]],
+[37, "penup", 700, 456, [101, 39]],
+[38, "pendown", 700, 678, [68, 113]],
+[39, ["setxy2", 40], 700, 484, [37, 41, 40, 65]],
+[40, ["number", 0], 739, 566, [39, null]],
+[41, ["product2", 0], 739, 484, [39, 44, 42]],
+[42, ["minus2", 0], 775, 512, [41, 89, 43]],
+[43, ["number", 6], 840, 540, [42, null]],
+[44, ["number", 50], 775, 484, [41, null]],
+[45, ["repeat", 0], 480, 568, [77, 46, 103, 70]],
+[46, ["number", 11], 519, 568, [45, null]],
+[47, ["repeat", 63], 960, 512, [56, 48, 49, 57]],
+[48, ["number", 2], 999, 512, [47, null]],
+[49, "forward", 972, 540, [47, 64, 50]],
+[50, "right", 972, 568, [49, 51, 52]],
+[51, ["number", 90], 1011, 568, [50, null]],
+[52, "forward", 972, 596, [50, 53, 54]],
+[53, ["number", 40], 1019, 596, [52, null]],
+[54, "right", 972, 624, [52, 55, null]],
+[55, ["number", 90], 1011, 624, [54, null]],
+[56, "startfill", 960, 484, [58, 47]],
+[57, "stopfill", 960, 664, [47, 109]],
+[58, "setcolor", 960, 456, [111, 60, 56]],
+[59, ["number", 10], 1047, 484, [60, null]],
+[60, ["product2", 0], 1011, 456, [58, 97, 59]],
+[61, "clean", 480, 456, [35, 62]],
+[62, "setshade", 480, 484, [61, 63, 77]],
+[63, ["number", 25], 537, 484, [62, null]],
+[64, "box", 1019, 540, [49, 99, null]],
+[65, "back", 700, 594, [39, 66, 67]],
+[66, ["number", 100.0], 739, 594, [65, null]],
+[67, "show", 700, 622, [65, 91, 68]],
+[68, "forward", 700, 650, [67, 69, 38]],
+[69, ["number", 100.0], 747, 650, [68, null]],
+[70, "penup", 480, 636, [45, 72]],
+[71, "pendown", 480, 720, [72, null]],
+[72, ["setxy2", 0], 480, 664, [70, 73, 74, 71]],
+[73, ["number", 0], 519, 664, [72, null]],
+[74, ["number", -50], 519, 692, [72, null]],
+[75, ["storein", 0], 212, 484, [13, 76, 7, 12]],
+[76, ["string", "box"], 257, 484, [75, null]],
+[77, ["storein", 0], 480, 512, [62, 78, 79, 45]],
+[78, ["string", "box"], 525, 512, [77, null]],
+[79, ["number", 2], 525, 540, [77, null]],
+[80, ["storein", 0], 920, 196, [105, 81, 32, null]],
+[81, ["string", "box"], 965, 196, [80, null]],
+[82, ["storein", 0], 200, 216, [25, 83, 84, 33]],
+[83, ["string", "box"], 245, 216, [82, null]],
+[84, ["number", 2], 245, 244, [82, null]],
+[85, "box", 257, 300, [29, 86, null]],
+[86, ["string", "box"], 294, 300, [85, null]],
+[87, "box", 1001, 224, [32, 88, null]],
+[88, ["string", "box"], 1038, 224, [87, null]],
+[89, "box", 824, 512, [42, 90, null]],
+[90, ["string", "box"], 861, 512, [89, null]],
+[91, "box", 739, 622, [67, 92, null]],
+[92, ["string", "box"], 776, 622, [91, null]],
+[93, "box", 257, 622, [8, 94, null]],
+[94, ["string", "box"], 294, 622, [93, null]],
+[95, "box", 330, 650, [10, 96, null]],
+[96, ["string", "box"], 367, 650, [95, null]],
+[97, "box", 1047, 456, [60, 98, null]],
+[98, ["string", "box"], 1084, 456, [97, null]],
+[99, "box", 1056, 540, [64, 100, null]],
+[100, ["string", "box"], 1093, 540, [99, null]],
+[101, "hat", 700, 420, [null, 102, 37]],
+[102, ["string", "bar graph"], 739, 428, [101, null]],
+[103, "stack", 492, 596, [45, 104, null]],
+[104, ["string", "bar graph"], 531, 596, [103, null]],
+[105, "hat", 920, 160, [null, 106, 80]],
+[106, ["string", "next bin"], 959, 168, [105, null]],
+[107, "stack", 212, 356, [29, 108, null]],
+[108, ["string", "next bin"], 251, 356, [107, null]],
+[109, "stack", 960, 692, [57, 110, null]],
+[110, ["string", "next bin"], 999, 692, [109, null]],
+[111, "hat", 960, 420, [null, 112, 58]],
+[112, ["string", "bar"], 999, 428, [111, null]],
+[113, "stack", 700, 706, [38, 114, null]],
+[114, ["string", "bar"], 739, 706, [113, null]]]
diff --git a/samples/graphics-snowflake.ta b/samples/math-snowflake.ta
index 90fa72c..90fa72c 100644
--- a/samples/graphics-snowflake.ta
+++ b/samples/math-snowflake.ta
diff --git a/samples/graphics-tree.ta b/samples/math-tree.ta
index 5993475..5993475 100644
--- a/samples/graphics-tree.ta
+++ b/samples/math-tree.ta
diff --git a/samples/sensors-record.tb b/samples/sensors-record.tb
new file mode 100644
index 0000000..746b677
--- /dev/null
+++ b/samples/sensors-record.tb
@@ -0,0 +1,113 @@
+[[0, ["start", 2.0], 620, 80, [null, 71]],
+[1, ["forever", 228], 620, 168, [71, 3, null]],
+[2, "mousebutton2", 694, 218, [3, null]],
+[3, ["ifelse", [135, 0]],
+638, 202, [1, 2, 111, 4, 72]],
+[4, "penup", 656, 598, [3, null]],
+[5, "pendown", 656, 538, [111, null]],
+[6, ["setxy2", 0], 621, 668, [72, 8, 7, 58]],
+[7, "mousey", 679, 710, [6, null]],
+[8, "mousex", 679, 668, [6, null]],
+[9, "hat", 940, 320, [null, 10, 68]],
+[10, ["string", "record point"], 998, 332, [9, null]],
+[11, "stack", 674, 334, [111, 12, null]],
+[12, ["string", "record point"], 732, 334, [11, null]],
+[13, ["loadblock3arg", 0], 923, 426, [88, 14, 15, 16, 80]],
+[14, ["string", "set xy"], 981, 426, [13, null]],
+[15, "mousex", 981, 468, [13, null]],
+[16, "mousey", 981, 510, [13, null]],
+[17, ["storein", 0], 638, 328, [55, 18, 92, 19]],
+[18, ["string", "x"], 706, 328, [17, null]],
+[19, ["storein", 0], 638, 412, [17, 20, 73, null]],
+[20, ["string", "y"], 706, 412, [19, null]],
+[21, ["number", 22], 520, -2636, [null, null]],
+[22, ["number", 99], 520, -2468, [null, null]],
+[23, "hat", 940, 80, [null, 24, 70]],
+[24, ["string", "record pendown"], 998, 92, [23, null]],
+[25, "penup", 923, 504, [108, 26]],
+[26, ["setxy2", 0], 923, 546, [25, 27, 29, null]],
+[27, "box", 981, 546, [26, 28, null]],
+[28, ["string", "x"], 1036, 546, [27, null]],
+[29, "box", 981, 588, [26, 30, null]],
+[30, ["string", "y"], 1036, 588, [29, null]],
+[31, ["storein", 0], 941, 960, [90, 32, 33, 34]],
+[32, ["string", "x"], 1009, 960, [31, null]],
+[33, "xcor", 1009, 1002, [31, null]],
+[34, ["storein", 0], 941, 1044, [31, 35, 36, null]],
+[35, ["string", "y"], 1009, 1044, [34, null]],
+[36, "ycor", 1009, 1086, [34, null]],
+[37, ["setxy2", 0], 923, 1146, [90, 64, 66, 38]],
+[38, "pendown", 923, 1230, [37, null]],
+[39, ["loadblock", 0], 923, 186, [84, 40, 76]],
+[40, ["string", "pen down"], 981, 186, [39, null]],
+[41, "hat", 940, 200, [null, 42, 69]],
+[42, ["string", "record penup"], 998, 212, [41, null]],
+[43, ["loadblock", 0], 923, 306, [86, 44, 78]],
+[44, ["string", "pen up"], 981, 306, [43, null]],
+[45, "stack", 674, 394, [111, 46, 51]],
+[46, ["string", "record penup"], 732, 394, [45, null]],
+[47, "stack", 674, 478, [51, 48, null]],
+[48, ["string", "record pendown"], 732, 478, [47, null]],
+[49, "wait", 621, 920, [60, 50, null]],
+[50, ["number", 0.25], 679, 920, [49, null]],
+[51, "stack", 674, 436, [45, 52, 47]],
+[52, ["string", "record point"], 732, 436, [51, null]],
+[53, ["storein", 0], 638, 160, [71, 54, 57, 55]],
+[54, ["string", "old mouse x"], 706, 160, [53, null]],
+[55, ["storein", 0], 638, 244, [53, 56, 91, 17]],
+[56, ["string", "old mouse y"], 706, 244, [55, null]],
+[57, "xcor", 706, 202, [53, null]],
+[58, ["storein", 0], 621, 752, [6, 59, 62, 60]],
+[59, ["string", "old mouse x"], 689, 752, [58, null]],
+[60, ["storein", 0], 621, 836, [58, 61, 63, 49]],
+[61, ["string", "old mouse y"], 689, 836, [60, null]],
+[62, "mousex", 689, 794, [58, null]],
+[63, "mousey", 689, 878, [60, null]],
+[64, "box", 981, 1146, [37, 65, null]],
+[65, ["string", "old mouse x"], 1036, 1146, [64, null]],
+[66, "box", 981, 1188, [37, 67, null]],
+[67, ["string", "old mouse y"], 1036, 1188, [66, null]],
+[68, "sandwichclampcollapsed", 940, 374, [9, 88, null]],
+[69, "sandwichclampcollapsed", 940, 254, [41, 86, null]],
+[70, "sandwichclampcollapsed", 940, 134, [23, 84, null]],
+[71, "sandwichclampcollapsed", 620, 126, [0, 53, 1]],
+[72, "sandwichclampcollapsed", 638, 658, [3, 6, null]],
+[73, "toppos", 706, 454, [19, null]],
+[74, "hat", 940, 560, [null, 75, 109]],
+[75, ["string", "after"], 998, 572, [74, null]],
+[76, "stack", 923, 228, [39, 77, null]],
+[77, ["string", "after"], 981, 228, [76, null]],
+[78, "stack", 923, 348, [43, 79, null]],
+[79, ["string", "after"], 981, 348, [78, null]],
+[80, "stack", 923, 552, [13, 81, null]],
+[81, ["string", "after"], 981, 552, [80, null]],
+[82, "hat", 940, 440, [null, 83, 108]],
+[83, ["string", "before"], 998, 452, [82, null]],
+[84, "stack", 923, 144, [70, 85, 39]],
+[85, ["string", "before"], 981, 144, [84, null]],
+[86, "stack", 923, 264, [69, 87, 43]],
+[87, ["string", "before"], 981, 264, [86, null]],
+[88, "stack", 923, 384, [68, 89, 13]],
+[89, ["string", "before"], 981, 384, [88, null]],
+[90, ["ifelse", [105, 63]], 923, 624, [109, 94, 107, 31, 37]],
+[91, "ycor", 706, 286, [55, null]],
+[92, "leftpos", 706, 370, [17, null]],
+[93, "ycor", 1035, 590, [94, null]],
+[94, ["less2", 0], 979, 590, [90, 93, 96, null]],
+[95, "bottompos", 1113, 632, [96, null]],
+[96, ["product2", 0], 1059, 632, [94, 95, 97]],
+[97, ["number", 2], 1113, 674, [96, null]],
+[98, ["storein", 0], 941, 732, [107, 99, 104, 106]],
+[99, ["string", "x"], 1009, 732, [98, null]],
+[100, ["storein", 0], 941, 858, [106, 101, 102, null]],
+[101, ["string", "y"], 1009, 858, [100, null]],
+[102, "toppos", 1009, 900, [100, null]],
+[103, "xcor", 1063, 774, [104, null]],
+[104, ["plus2", 0], 1009, 774, [98, 103, 105]],
+[105, ["number", 100], 1063, 816, [104, null]],
+[106, ["vspace", 0], 941, 816, [98, 100]],
+[107, ["vspace", 0], 941, 690, [90, 98]],
+[108, "sandwichclampcollapsed", 940, 494, [82, 25, null]],
+[109, "sandwichclampcollapsed", 940, 614, [74, 90, null]],
+[110, "penstate", 712, 284, [111, null]],
+[111, ["ifelse", [0, 42]], 656, 268, [3, 110, 11, 45, 5]]] \ No newline at end of file