diff options
author | Brian Silverman <brians@playfulinvention.com> | 2007-05-30 13:28:45 (GMT) |
---|---|---|
committer | Brian Silverman <brians@playfulinvention.com> | 2007-05-30 13:28:45 (GMT) |
commit | e6c65d33e68fdfe3b28bff284c62ead374566504 (patch) | |
tree | 33e88fee67a21b0309835133a5945a9b6a0188f5 |
Initial import
-rwxr-xr-x | MANIFEST | 191 | ||||
-rwxr-xr-x | TurtleArtActivity.py | 25 | ||||
-rwxr-xr-x | activity/activity-turtleart.svg | 27 | ||||
-rwxr-xr-x | activity/activity.info | 7 | ||||
-rwxr-xr-x | activity/activity.info.bak | 7 | ||||
-rwxr-xr-x | arrow.gif | bin | 0 -> 1251 bytes | |||
-rwxr-xr-x | flow/flowgroup.gif | bin | 0 -> 24343 bytes | |||
-rwxr-xr-x | flow/flowmask.gif | bin | 0 -> 2537 bytes | |||
-rwxr-xr-x | flow/forever.gif | bin | 0 -> 3418 bytes | |||
-rwxr-xr-x | flow/hspace.gif | bin | 0 -> 3349 bytes | |||
-rwxr-xr-x | flow/if.gif | bin | 0 -> 7387 bytes | |||
-rwxr-xr-x | flow/ifelse.gif | bin | 0 -> 8050 bytes | |||
-rwxr-xr-x | flow/repeat.gif | bin | 0 -> 5882 bytes | |||
-rwxr-xr-x | flow/stopstack.gif | bin | 0 -> 2890 bytes | |||
-rwxr-xr-x | flow/vspace.gif | bin | 0 -> 3891 bytes | |||
-rwxr-xr-x | flow/wait.gif | bin | 0 -> 2896 bytes | |||
-rwxr-xr-x | logo.py | 361 | ||||
-rwxr-xr-x | masknumber.gif | bin | 0 -> 330 bytes | |||
-rwxr-xr-x | myblocks/1input.gif | bin | 0 -> 2517 bytes | |||
-rwxr-xr-x | myblocks/1inputmask.gif | bin | 0 -> 244 bytes | |||
-rwxr-xr-x | myblocks/2inputs.gif | bin | 0 -> 3565 bytes | |||
-rwxr-xr-x | myblocks/2inputsmask.gif | bin | 0 -> 322 bytes | |||
-rwxr-xr-x | myblocks/3inputs.gif | bin | 0 -> 3090 bytes | |||
-rwxr-xr-x | myblocks/3inputsmask.gif | bin | 0 -> 250 bytes | |||
-rwxr-xr-x | myblocks/boutput.gif | bin | 0 -> 2746 bytes | |||
-rwxr-xr-x | myblocks/boutputmask.gif | bin | 0 -> 209 bytes | |||
-rwxr-xr-x | myblocks/box1.gif | bin | 0 -> 2113 bytes | |||
-rwxr-xr-x | myblocks/box2.gif | bin | 0 -> 2130 bytes | |||
-rwxr-xr-x | myblocks/global.gif | bin | 0 -> 1951 bytes | |||
-rwxr-xr-x | myblocks/global1.gif | bin | 0 -> 1721 bytes | |||
-rwxr-xr-x | myblocks/global1mask.gif | bin | 0 -> 133 bytes | |||
-rwxr-xr-x | myblocks/globalmask.gif | bin | 0 -> 140 bytes | |||
-rwxr-xr-x | myblocks/hat1.gif | bin | 0 -> 2833 bytes | |||
-rwxr-xr-x | myblocks/hat2.gif | bin | 0 -> 2836 bytes | |||
-rwxr-xr-x | myblocks/line.gif | bin | 0 -> 264 bytes | |||
-rwxr-xr-x | myblocks/linemask.gif | bin | 0 -> 124 bytes | |||
-rwxr-xr-x | myblocks/myblocksgroup.gif | bin | 0 -> 17676 bytes | |||
-rwxr-xr-x | myblocks/myblocksmask.gif | bin | 0 -> 1760 bytes | |||
-rwxr-xr-x | myblocks/mystuffbg.gif | bin | 0 -> 1335 bytes | |||
-rwxr-xr-x | myblocks/mystuffgroup.gif | bin | 0 -> 5199 bytes | |||
-rwxr-xr-x | myblocks/mystuffmask.gif | bin | 0 -> 1091 bytes | |||
-rwxr-xr-x | myblocks/opwith1ip.gif | bin | 0 -> 1423 bytes | |||
-rwxr-xr-x | myblocks/opwith1ipb.gif | bin | 0 -> 1437 bytes | |||
-rwxr-xr-x | myblocks/opwith1ipbmask.gif | bin | 0 -> 154 bytes | |||
-rwxr-xr-x | myblocks/opwith1ipmask.gif | bin | 0 -> 161 bytes | |||
-rwxr-xr-x | myblocks/output.gif | bin | 0 -> 2060 bytes | |||
-rwxr-xr-x | myblocks/output1.gif | bin | 0 -> 1966 bytes | |||
-rwxr-xr-x | myblocks/output1mask.gif | bin | 0 -> 133 bytes | |||
-rwxr-xr-x | myblocks/outputmask.gif | bin | 0 -> 140 bytes | |||
-rwxr-xr-x | myblocks/procedure.gif | bin | 0 -> 2356 bytes | |||
-rwxr-xr-x | myblocks/proceduremask.gif | bin | 0 -> 232 bytes | |||
-rwxr-xr-x | myblocks/setglobal.gif | bin | 0 -> 3193 bytes | |||
-rwxr-xr-x | myblocks/setglobalmask.gif | bin | 0 -> 270 bytes | |||
-rwxr-xr-x | myblocks/stack1.gif | bin | 0 -> 2605 bytes | |||
-rwxr-xr-x | myblocks/stack2.gif | bin | 0 -> 2631 bytes | |||
-rwxr-xr-x | myblocks/start.gif | bin | 0 -> 2525 bytes | |||
-rwxr-xr-x | myblocks/startmask.gif | bin | 0 -> 276 bytes | |||
-rwxr-xr-x | myblocks/storeinbox1.gif | bin | 0 -> 3409 bytes | |||
-rwxr-xr-x | myblocks/storeinbox2.gif | bin | 0 -> 3421 bytes | |||
-rwxr-xr-x | numbers/and.gif | bin | 0 -> 2628 bytes | |||
-rwxr-xr-x | numbers/division.gif | bin | 0 -> 1800 bytes | |||
-rwxr-xr-x | numbers/equal.gif | bin | 0 -> 3680 bytes | |||
-rwxr-xr-x | numbers/greater.gif | bin | 0 -> 3728 bytes | |||
-rwxr-xr-x | numbers/less.gif | bin | 0 -> 3719 bytes | |||
-rwxr-xr-x | numbers/minus.gif | bin | 0 -> 1772 bytes | |||
-rwxr-xr-x | numbers/not.gif | bin | 0 -> 2625 bytes | |||
-rwxr-xr-x | numbers/number.gif | bin | 0 -> 2113 bytes | |||
-rwxr-xr-x | numbers/numbersgroup.gif | bin | 0 -> 24253 bytes | |||
-rwxr-xr-x | numbers/numbersmask.gif | bin | 0 -> 2974 bytes | |||
-rwxr-xr-x | numbers/or.gif | bin | 0 -> 2593 bytes | |||
-rwxr-xr-x | numbers/plus.gif | bin | 0 -> 1787 bytes | |||
-rwxr-xr-x | numbers/print.gif | bin | 0 -> 2919 bytes | |||
-rwxr-xr-x | numbers/product.gif | bin | 0 -> 1843 bytes | |||
-rwxr-xr-x | numbers/random.gif | bin | 0 -> 4328 bytes | |||
-rwxr-xr-x | numbers/remainder.gif | bin | 0 -> 2141 bytes | |||
-rwxr-xr-x | palette/flowoff.gif | bin | 0 -> 858 bytes | |||
-rwxr-xr-x | palette/flowon.gif | bin | 0 -> 1261 bytes | |||
-rwxr-xr-x | palette/myblocksoff.gif | bin | 0 -> 1246 bytes | |||
-rwxr-xr-x | palette/myblockson.gif | bin | 0 -> 1676 bytes | |||
-rwxr-xr-x | palette/numbersoff.gif | bin | 0 -> 1134 bytes | |||
-rwxr-xr-x | palette/numberson.gif | bin | 0 -> 1525 bytes | |||
-rwxr-xr-x | palette/penoff.gif | bin | 0 -> 820 bytes | |||
-rwxr-xr-x | palette/penon.gif | bin | 0 -> 821 bytes | |||
-rwxr-xr-x | palette/turtleoff.gif | bin | 0 -> 900 bytes | |||
-rwxr-xr-x | palette/turtleon.gif | bin | 0 -> 896 bytes | |||
-rwxr-xr-x | pen/color.gif | bin | 0 -> 2163 bytes | |||
-rwxr-xr-x | pen/fillscreen.gif | bin | 0 -> 4309 bytes | |||
-rwxr-xr-x | pen/pendown.gif | bin | 0 -> 2529 bytes | |||
-rwxr-xr-x | pen/pengroup.gif | bin | 0 -> 18808 bytes | |||
-rwxr-xr-x | pen/penmask.gif | bin | 0 -> 1948 bytes | |||
-rwxr-xr-x | pen/pensize.gif | bin | 0 -> 2247 bytes | |||
-rwxr-xr-x | pen/penup.gif | bin | 0 -> 2514 bytes | |||
-rwxr-xr-x | pen/setbg.gif | bin | 0 -> 3042 bytes | |||
-rwxr-xr-x | pen/setcolor.gif | bin | 0 -> 3110 bytes | |||
-rwxr-xr-x | pen/setpensize.gif | bin | 0 -> 3213 bytes | |||
-rwxr-xr-x | pen/setshade.gif | bin | 0 -> 3165 bytes | |||
-rwxr-xr-x | pen/shade.gif | bin | 0 -> 2174 bytes | |||
-rwxr-xr-x | samples/birds.png | bin | 0 -> 305016 bytes | |||
-rwxr-xr-x | samples/birds.ta | 319 | ||||
-rwxr-xr-x | samples/bubbles.png | bin | 0 -> 49299 bytes | |||
-rwxr-xr-x | samples/bubbles.ta | 253 | ||||
-rwxr-xr-x | samples/candyvortex.png | bin | 0 -> 98971 bytes | |||
-rwxr-xr-x | samples/candyvortex.ta | 143 | ||||
-rwxr-xr-x | samples/colors.png | bin | 0 -> 95221 bytes | |||
-rwxr-xr-x | samples/colors.ta | 125 | ||||
-rwxr-xr-x | samples/csquiral.png | bin | 0 -> 150314 bytes | |||
-rwxr-xr-x | samples/csquiral.ta | 201 | ||||
-rwxr-xr-x | samples/curlygates.png | bin | 0 -> 80552 bytes | |||
-rwxr-xr-x | samples/curlygates.ta | 469 | ||||
-rwxr-xr-x | samples/dots.png | bin | 0 -> 61626 bytes | |||
-rwxr-xr-x | samples/dots.ta | 225 | ||||
-rwxr-xr-x | samples/flower.png | bin | 0 -> 152107 bytes | |||
-rwxr-xr-x | samples/flower.ta | 288 | ||||
-rwxr-xr-x | samples/fountain.png | bin | 0 -> 230566 bytes | |||
-rwxr-xr-x | samples/fountain.ta | 419 | ||||
-rwxr-xr-x | samples/rainbow.png | bin | 0 -> 51398 bytes | |||
-rwxr-xr-x | samples/rainbow.ta | 194 | ||||
-rwxr-xr-x | samples/redwisp.png | bin | 0 -> 163064 bytes | |||
-rwxr-xr-x | samples/redwisp.ta | 354 | ||||
-rwxr-xr-x | samples/reflections.png | bin | 0 -> 182626 bytes | |||
-rwxr-xr-x | samples/reflections.ta | 298 | ||||
-rwxr-xr-x | samples/shades.png | bin | 0 -> 65541 bytes | |||
-rwxr-xr-x | samples/shades.ta | 194 | ||||
-rwxr-xr-x | samples/smoothcandy.png | bin | 0 -> 74117 bytes | |||
-rwxr-xr-x | samples/smoothcandy.ta | 243 | ||||
-rwxr-xr-x | samples/square.png | bin | 0 -> 5223 bytes | |||
-rwxr-xr-x | samples/square.ta | 68 | ||||
-rwxr-xr-x | samples/squares.png | bin | 0 -> 42674 bytes | |||
-rwxr-xr-x | samples/squares.ta | 114 | ||||
-rwxr-xr-x | samples/squiral.png | bin | 0 -> 84259 bytes | |||
-rwxr-xr-x | samples/squiral.ta | 131 | ||||
-rwxr-xr-x | setup.py | 3 | ||||
-rwxr-xr-x | shapes/t0.gif | bin | 0 -> 1687 bytes | |||
-rwxr-xr-x | shapes/t1.gif | bin | 0 -> 1704 bytes | |||
-rwxr-xr-x | shapes/t10.gif | bin | 0 -> 1698 bytes | |||
-rwxr-xr-x | shapes/t11.gif | bin | 0 -> 1703 bytes | |||
-rwxr-xr-x | shapes/t12.gif | bin | 0 -> 1697 bytes | |||
-rwxr-xr-x | shapes/t13.gif | bin | 0 -> 1702 bytes | |||
-rwxr-xr-x | shapes/t14.gif | bin | 0 -> 1689 bytes | |||
-rwxr-xr-x | shapes/t15.gif | bin | 0 -> 1689 bytes | |||
-rwxr-xr-x | shapes/t16.gif | bin | 0 -> 1688 bytes | |||
-rwxr-xr-x | shapes/t17.gif | bin | 0 -> 1684 bytes | |||
-rwxr-xr-x | shapes/t18.gif | bin | 0 -> 1684 bytes | |||
-rwxr-xr-x | shapes/t19.gif | bin | 0 -> 1696 bytes | |||
-rwxr-xr-x | shapes/t2.gif | bin | 0 -> 1707 bytes | |||
-rwxr-xr-x | shapes/t20.gif | bin | 0 -> 1699 bytes | |||
-rwxr-xr-x | shapes/t21.gif | bin | 0 -> 1694 bytes | |||
-rwxr-xr-x | shapes/t22.gif | bin | 0 -> 1701 bytes | |||
-rwxr-xr-x | shapes/t23.gif | bin | 0 -> 1702 bytes | |||
-rwxr-xr-x | shapes/t24.gif | bin | 0 -> 1704 bytes | |||
-rwxr-xr-x | shapes/t25.gif | bin | 0 -> 1699 bytes | |||
-rwxr-xr-x | shapes/t26.gif | bin | 0 -> 1696 bytes | |||
-rwxr-xr-x | shapes/t27.gif | bin | 0 -> 1678 bytes | |||
-rwxr-xr-x | shapes/t28.gif | bin | 0 -> 1711 bytes | |||
-rwxr-xr-x | shapes/t29.gif | bin | 0 -> 1703 bytes | |||
-rwxr-xr-x | shapes/t3.gif | bin | 0 -> 1708 bytes | |||
-rwxr-xr-x | shapes/t30.gif | bin | 0 -> 1696 bytes | |||
-rwxr-xr-x | shapes/t31.gif | bin | 0 -> 1702 bytes | |||
-rwxr-xr-x | shapes/t32.gif | bin | 0 -> 1686 bytes | |||
-rwxr-xr-x | shapes/t33.gif | bin | 0 -> 1698 bytes | |||
-rwxr-xr-x | shapes/t34.gif | bin | 0 -> 1691 bytes | |||
-rwxr-xr-x | shapes/t35.gif | bin | 0 -> 1692 bytes | |||
-rwxr-xr-x | shapes/t4.gif | bin | 0 -> 1708 bytes | |||
-rwxr-xr-x | shapes/t5.gif | bin | 0 -> 1707 bytes | |||
-rwxr-xr-x | shapes/t6.gif | bin | 0 -> 1706 bytes | |||
-rwxr-xr-x | shapes/t7.gif | bin | 0 -> 1709 bytes | |||
-rwxr-xr-x | shapes/t8.gif | bin | 0 -> 1694 bytes | |||
-rwxr-xr-x | shapes/t9.gif | bin | 0 -> 1677 bytes | |||
-rwxr-xr-x | sprites.py | 120 | ||||
-rwxr-xr-x | status.gif | bin | 0 -> 12776 bytes | |||
-rwxr-xr-x | ta.py | 554 | ||||
-rwxr-xr-x | toolbar/blocks-.gif | bin | 0 -> 3744 bytes | |||
-rwxr-xr-x | toolbar/eraseroff.gif | bin | 0 -> 1182 bytes | |||
-rwxr-xr-x | toolbar/eraseron.gif | bin | 0 -> 1236 bytes | |||
-rwxr-xr-x | toolbar/hideshowoff.gif | bin | 0 -> 1551 bytes | |||
-rwxr-xr-x | toolbar/hideshowon.gif | bin | 0 -> 1543 bytes | |||
-rwxr-xr-x | toolbar/project-.gif | bin | 0 -> 3497 bytes | |||
-rwxr-xr-x | toolbar/project.gif | bin | 0 -> 6629 bytes | |||
-rwxr-xr-x | toolbar/projectmask.gif | bin | 0 -> 589 bytes | |||
-rwxr-xr-x | toolbar/stopitoff.gif | bin | 0 -> 571 bytes | |||
-rwxr-xr-x | toolbar/stopiton.gif | bin | 0 -> 556 bytes | |||
-rwxr-xr-x | turtle.py | 195 | ||||
-rwxr-xr-x | turtle/arc.gif | bin | 0 -> 4467 bytes | |||
-rwxr-xr-x | turtle/back.gif | bin | 0 -> 2857 bytes | |||
-rwxr-xr-x | turtle/clean.gif | bin | 0 -> 2731 bytes | |||
-rwxr-xr-x | turtle/forward.gif | bin | 0 -> 2903 bytes | |||
-rwxr-xr-x | turtle/heading.gif | bin | 0 -> 2299 bytes | |||
-rwxr-xr-x | turtle/left.gif | bin | 0 -> 2819 bytes | |||
-rwxr-xr-x | turtle/right.gif | bin | 0 -> 2853 bytes | |||
-rwxr-xr-x | turtle/seth.gif | bin | 0 -> 2818 bytes | |||
-rwxr-xr-x | turtle/setxy.gif | bin | 0 -> 4401 bytes | |||
-rwxr-xr-x | turtle/turtlegroup.gif | bin | 0 -> 23139 bytes | |||
-rwxr-xr-x | turtle/turtlemask.gif | bin | 0 -> 2268 bytes | |||
-rwxr-xr-x | turtle/xcor.gif | bin | 0 -> 2237 bytes | |||
-rwxr-xr-x | turtle/ycor.gif | bin | 0 -> 2238 bytes | |||
-rwxr-xr-x | turtlesetup.py | 179 |
196 files changed, 5707 insertions, 0 deletions
diff --git a/MANIFEST b/MANIFEST new file mode 100755 index 0000000..d18f090 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,191 @@ +arrow.gif +logo.py +masknumber.gif +sprites.py +status.gif +ta.py +TurtleArtActivity.py +turtle.py +turtlesetup.py +flow/flowgroup.gif +flow/flowmask.gif +flow/forever.gif +flow/hspace.gif +flow/ifelse.gif +flow/if.gif +flow/repeat.gif +flow/stopstack.gif +flow/vspace.gif +flow/wait.gif +myblocks/1input.gif +myblocks/1inputmask.gif +myblocks/2inputs.gif +myblocks/2inputsmask.gif +myblocks/3inputs.gif +myblocks/3inputsmask.gif +myblocks/boutput.gif +myblocks/boutputmask.gif +myblocks/box1.gif +myblocks/box2.gif +myblocks/global1.gif +myblocks/global1mask.gif +myblocks/global.gif +myblocks/globalmask.gif +myblocks/hat1.gif +myblocks/hat2.gif +myblocks/line.gif +myblocks/linemask.gif +myblocks/myblocksgroup.gif +myblocks/myblocksmask.gif +myblocks/mystuffbg.gif +myblocks/mystuffgroup.gif +myblocks/mystuffmask.gif +myblocks/opwith1ipb.gif +myblocks/opwith1ipbmask.gif +myblocks/opwith1ip.gif +myblocks/opwith1ipmask.gif +myblocks/output1.gif +myblocks/output1mask.gif +myblocks/output.gif +myblocks/outputmask.gif +myblocks/procedure.gif +myblocks/proceduremask.gif +myblocks/setglobal.gif +myblocks/setglobalmask.gif +myblocks/stack1.gif +myblocks/stack2.gif +myblocks/start.gif +myblocks/startmask.gif +myblocks/storeinbox1.gif +myblocks/storeinbox2.gif +numbers/and.gif +numbers/division.gif +numbers/equal.gif +numbers/greater.gif +numbers/less.gif +numbers/minus.gif +numbers/not.gif +numbers/number.gif +numbers/numbersgroup.gif +numbers/numbersmask.gif +numbers/or.gif +numbers/plus.gif +numbers/print.gif +numbers/product.gif +numbers/random.gif +numbers/remainder.gif +palette/flowoff.gif +palette/flowon.gif +palette/myblocksoff.gif +palette/myblockson.gif +palette/numbersoff.gif +palette/numberson.gif +palette/penoff.gif +palette/penon.gif +palette/turtleoff.gif +palette/turtleon.gif +pen/color.gif +pen/fillscreen.gif +pen/pendown.gif +pen/pengroup.gif +pen/penmask.gif +pen/pensize.gif +pen/penup.gif +pen/setbg.gif +pen/setcolor.gif +pen/setpensize.gif +pen/setshade.gif +pen/shade.gif +shapes/t0.gif +shapes/t10.gif +shapes/t11.gif +shapes/t12.gif +shapes/t13.gif +shapes/t14.gif +shapes/t15.gif +shapes/t16.gif +shapes/t17.gif +shapes/t18.gif +shapes/t19.gif +shapes/t1.gif +shapes/t20.gif +shapes/t21.gif +shapes/t22.gif +shapes/t23.gif +shapes/t24.gif +shapes/t25.gif +shapes/t26.gif +shapes/t27.gif +shapes/t28.gif +shapes/t29.gif +shapes/t2.gif +shapes/t30.gif +shapes/t31.gif +shapes/t32.gif +shapes/t33.gif +shapes/t34.gif +shapes/t35.gif +shapes/t3.gif +shapes/t4.gif +shapes/t5.gif +shapes/t6.gif +shapes/t7.gif +shapes/t8.gif +shapes/t9.gif +toolbar/blocks-.gif +toolbar/eraseroff.gif +toolbar/eraseron.gif +toolbar/hideshowoff.gif +toolbar/hideshowon.gif +toolbar/project-.gif +toolbar/project.gif +toolbar/projectmask.gif +toolbar/stopitoff.gif +toolbar/stopiton.gif +turtle/arc.gif +turtle/back.gif +turtle/clean.gif +turtle/forward.gif +turtle/heading.gif +turtle/left.gif +turtle/right.gif +turtle/seth.gif +turtle/setxy.gif +turtle/turtlegroup.gif +turtle/turtlemask.gif +turtle/xcor.gif +turtle/ycor.gif +samples/birds.png +samples/birds.ta +samples/bubbles.png +samples/bubbles.ta +samples/candyvortex.png +samples/candyvortex.ta +samples/colors.png +samples/colors.ta +samples/csquiral.png +samples/csquiral.ta +samples/curlygates.png +samples/curlygates.ta +samples/dots.png +samples/dots.ta +samples/flower.png +samples/flower.ta +samples/fountain.png +samples/fountain.ta +samples/rainbow.png +samples/rainbow.ta +samples/redwisp.png +samples/redwisp.ta +samples/reflections.png +samples/reflections.ta +samples/shades.png +samples/shades.ta +samples/smoothcandy.png +samples/smoothcandy.ta +samples/square.png +samples/square.ta +samples/squares.png +samples/squares.ta +samples/squiral.png +samples/squiral.ta diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py new file mode 100755 index 0000000..7869e4a --- /dev/null +++ b/TurtleArtActivity.py @@ -0,0 +1,25 @@ +import ta + +from sugar.activity import activity + +class TurtleArtActivity(activity.Activity): + def __init__(self, handle): + activity.Activity.__init__(self, handle) + self.connect('destroy', self._cleanup_cb) + + self.gamename = 'turtleart' + self.set_title("TurtleArt") + + self.connect('focus_in_event', self._focus_in) + self.connect('focus_out_event', self._focus_out) + ta.init(self, activity.get_bundle_path()) + + + def _cleanup_cb(self, data=None): + return + + def _focus_in(self, event, data=None): + return + + def _focus_out(self, event, data=None): + return diff --git a/activity/activity-turtleart.svg b/activity/activity-turtleart.svg new file mode 100755 index 0000000..8ad1dc7 --- /dev/null +++ b/activity/activity-turtleart.svg @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_svg "http://www.w3.org/2000/svg">
+ <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
+ <!ENTITY stroke_color "#000000">
+ <!ENTITY fill_color "#FFFFFF">
+]>
+<svg version="1.1" id="Layer_2" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="47.585" height="49.326"
+ viewBox="0 0 47.585 49.326" overflow="visible" enable-background="new 0 0 47.585 49.326" xml:space="preserve">
+<path fill="&fill_color;" stroke="&stroke_color;" stroke-width="3" d="M23.979,46.828c0.059,0,0.514,0.025,0.573,0.025
+ c1.807-0.056,0.16-0.952,1.697-1.369c0.63-0.172,1.534,0.273,2.629-0.328c1.012-0.557,1.248-1.217,1.74-1.64
+ c1.599-1.372,3.851,1.236,6.09,2.789c3.119,2.164,6.976,2.102,7.775-0.164c0.656-1.861-0.404-3.754-2.565-4.732
+ c-2.901-1.313-5.649-0.688-6.142-3.098c-0.275-1.344,1.524-3.023,2.178-4.149c0.95-1.64,1.235-2.564,1.217-4.448
+ c-0.03-2.845-2.534-4.193-1.698-7.117c0.658-2.296,3.829-2.752,5.831-3.765c3.447-1.746,3.321-5.09,1.914-6.708
+ c-1.551-1.784-4.449-2.597-6.885,0.47c-0.882,1.111-1.532,2.501-2.521,3.271c-1.055,0.819-3.176,1.803-4.498,1.84
+ c-2.063,0.057-4.414-0.174-3.477-2.863c0.799-2.29,4.771-2.112,4.907-7.088c0.108-3.951-3.187-5.627-5.403-6.089
+ C26.26,1.44,25.205,1.484,23.74,1.44h0.106c-1.465,0.044-2.521,0-3.602,0.225c-2.215,0.461-5.511,2.138-5.403,6.089
+ c0.136,4.976,4.109,4.798,4.907,7.088c0.938,2.688-1.414,2.92-3.476,2.863c-1.323-0.038-3.443-1.021-4.498-1.84
+ c-0.989-0.771-1.64-2.161-2.522-3.271c-2.436-3.067-5.333-2.254-6.885-0.47c-1.407,1.618-1.534,4.962,1.914,6.708
+ c2.003,1.013,5.173,1.469,5.83,3.765c0.837,2.924-1.667,4.272-1.697,7.117c-0.018,1.884,0.267,2.809,1.217,4.448
+ c0.654,1.126,2.452,2.806,2.178,4.149c-0.493,2.409-3.241,1.784-6.142,3.098c-2.162,0.979-3.221,2.871-2.564,4.732
+ c0.799,2.266,4.655,2.328,7.775,0.164c2.238-1.553,4.49-4.161,6.088-2.789c0.493,0.423,0.73,1.083,1.742,1.64
+ c1.095,0.602,1.999,0.156,2.628,0.328c1.536,0.417-0.11,1.313,1.697,1.369c0.059,0,0.515-0.025,0.574-0.025H23.979z"/>
+<circle fill="&stroke_color;" cx="20.667" cy="5.899" r="1.927"/>
+<circle fill="&stroke_color;" cx="27.322" cy="5.899" r="1.926"/>
+</svg>
diff --git a/activity/activity.info b/activity/activity.info new file mode 100755 index 0000000..060bc97 --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,7 @@ +[Activity] +name = TurtleArt +service_name = org.laptop.TurtleArtActivity +class = TurtleArtActivity.TurtleArtActivity +icon = activity-turtleart +activity_version = 1 +show_launcher = yes diff --git a/activity/activity.info.bak b/activity/activity.info.bak new file mode 100755 index 0000000..20d7863 --- /dev/null +++ b/activity/activity.info.bak @@ -0,0 +1,7 @@ +[Activity] +name = BlockParty +service_name = org.laptop.BlockPartyActivity +class = BlockPartyActivity.BlockPartyActivity +icon = activity-blockparty +activity_version = 7 +show_launcher = yes diff --git a/arrow.gif b/arrow.gif Binary files differnew file mode 100755 index 0000000..37640dc --- /dev/null +++ b/arrow.gif diff --git a/flow/flowgroup.gif b/flow/flowgroup.gif Binary files differnew file mode 100755 index 0000000..caeb659 --- /dev/null +++ b/flow/flowgroup.gif diff --git a/flow/flowmask.gif b/flow/flowmask.gif Binary files differnew file mode 100755 index 0000000..3369f1d --- /dev/null +++ b/flow/flowmask.gif diff --git a/flow/forever.gif b/flow/forever.gif Binary files differnew file mode 100755 index 0000000..e722b52 --- /dev/null +++ b/flow/forever.gif diff --git a/flow/hspace.gif b/flow/hspace.gif Binary files differnew file mode 100755 index 0000000..f396a80 --- /dev/null +++ b/flow/hspace.gif diff --git a/flow/if.gif b/flow/if.gif Binary files differnew file mode 100755 index 0000000..d12e66d --- /dev/null +++ b/flow/if.gif diff --git a/flow/ifelse.gif b/flow/ifelse.gif Binary files differnew file mode 100755 index 0000000..9fd70e6 --- /dev/null +++ b/flow/ifelse.gif diff --git a/flow/repeat.gif b/flow/repeat.gif Binary files differnew file mode 100755 index 0000000..469ccdd --- /dev/null +++ b/flow/repeat.gif diff --git a/flow/stopstack.gif b/flow/stopstack.gif Binary files differnew file mode 100755 index 0000000..2a6cdd8 --- /dev/null +++ b/flow/stopstack.gif diff --git a/flow/vspace.gif b/flow/vspace.gif Binary files differnew file mode 100755 index 0000000..6f63c80 --- /dev/null +++ b/flow/vspace.gif diff --git a/flow/wait.gif b/flow/wait.gif Binary files differnew file mode 100755 index 0000000..0cf6ad6 --- /dev/null +++ b/flow/wait.gif @@ -0,0 +1,361 @@ +import re
+from time import clock
+from operator import isNumberType
+import random
+
+oblist = {}
+
+iline = None
+cfun = None
+arglist = None
+
+istack = []
+iresult = None
+step = None
+procstop = False
+
+boxes = {'box1': 0, 'box2': 0}
+stacks = {}
+
+utime_start = 0
+
+class symbol:
+
+ def __init__(self, name):
+ self.name = name
+ self.nargs = None
+ self.fcn = None
+
+ def __str__(self): return self.name
+ def __repr__(self): return '#'+self.name
+
+class logoerror(Exception):
+ def __init__(self, value):
+ self.value = value
+ def __str__(self):
+ return repr(self.value)
+
+
+def run_blocks(spr, blocks):
+ stacks['stack1'] = None
+ stacks['stack2'] = None
+ for i in blocks:
+ if i.proto.name=='hat1': stacks['stack1']= readline(blocks_to_code(i))
+ if i.proto.name=='hat2': stacks['stack2']= readline(blocks_to_code(i))
+ code = blocks_to_code(spr)
+ print code
+ setup_cmd(code)
+
+def blocks_to_code(spr):
+ if spr==None: return ['%nothing%']
+ code = []
+ dock = spr.proto.docks[0]
+ if len(dock)>4: code.append(dock[4])
+ if spr.proto.primname != '': code.append(spr.proto.primname)
+ else: code.append(float(spr.label))
+ for i in range(1,len(spr.connections)):
+ b = spr.connections[i]
+ dock = spr.proto.docks[i]
+ if len(dock)>4:
+ for c in dock[4]: code.append(c)
+ if b!=None: code.extend(blocks_to_code(b))
+ elif spr.proto.docks[i][0] not in ['flow','numend','unavailable','logi-']:
+ code.append('%nothing%')
+ return code
+
+def intern(str):
+ if str in oblist: return oblist[str]
+ sym = symbol(str)
+ oblist[str] = sym
+ return sym
+
+
+def parseline(str):
+ split = re.split(r"\s|([\[\]()])", str)
+ return [x for x in split if x and x != ""]
+
+def readline(line):
+ res = []
+ while line:
+ token = line.pop(0)
+ if isNumberType(token): res.append(token)
+ elif token.isdigit(): res.append(float(token))
+ elif token[0]=='-' and token[1:].isdigit(): res.append(-float(token[1:]))
+ elif token[0] == '"': res.append(token[1:])
+ elif token == '[': res.append(readline(line))
+ elif token == ']': return res
+ else: res.append(intern(token))
+ return res
+
+
+def setup_cmd(str):
+ global iline, step, procstop
+ stopsignon(); procstop=False
+ list = readline(str)
+ step = start_eval(list)
+
+def start_eval(list):
+ icall(evline, list); yield True
+ yield False
+
+def evline(list):
+ global cfun, arglist, iline
+ oldiline = iline
+ iline = list[:]
+ arglist = None
+ while iline:
+ token = iline[0]
+ if token==symopar: token=iline[1]
+ icall(eval); yield True
+ if procstop: break
+ if iresult==None: continue
+ raise logoerror("You don't say what to do with %s" % token)
+ iline = oldiline
+ ireturn(); yield True
+
+def eval(infixarg=False):
+ token = iline.pop(0)
+ if type(token) == symtype:
+ icall(evalsym, token); yield True
+ res = iresult
+ else: res = token
+ if not infixarg:
+ while infixnext():
+ icall(evalinfix, res); yield True
+ res = iresult
+ ireturn(res); yield True
+
+def evalsym(token):
+ global cfun, arglist
+ undefined_check(token)
+ oldcfun, oldarglist = cfun, arglist
+ cfun, arglist = token, []
+ for i in range(token.nargs):
+ no_args_check()
+ icall(eval); yield True
+ arglist.append(iresult)
+ if cfun.rprim:
+ if type(cfun.fcn)==listtype: icall(ufuncall, cfun.fcn); yield True
+ else: icall(cfun.fcn, *arglist); yield True
+ result = None
+ else: result = cfun.fcn(*arglist)
+ cfun, arglist = oldcfun, oldarglist
+ if arglist!=None and result==None:
+ raise logoerror("%s didn't output to %s" % (oldcfun.name, cfun.name))
+ ireturn(result); yield True
+
+def evalinfix(firstarg):
+ global cfun, arglist
+ token = iline.pop(0)
+ oldcfun, oldarglist = cfun, arglist
+ cfun, arglist = token, [firstarg]
+ no_args_check()
+ icall(eval,True); yield True
+ arglist.append(iresult)
+ result = cfun.fcn(*arglist)
+ cfun, arglist = oldcfun, oldarglist
+ ireturn (result); yield True
+
+def infixnext():
+ if len(iline)==0: return False
+ if type(iline[0])!=symtype: return False
+ return iline[0].name in ['+', '-', '*', '/','%','and','or']
+
+def undefined_check(token):
+ if token.fcn != None: return False
+ raise logoerror("I don't know how to %s" % token.name)
+
+
+def no_args_check():
+ if iline and iline[0]!=symnothing : return
+ raise logoerror("Not enough inputs to %s" % cfun.name)
+
+def prim_wait(time):
+ turtle_spr.setlayer(630)
+ endtime = millis()+an_int(time)*100
+ while millis()<endtime:
+ yield True
+ turtle_spr.setlayer(100)
+ ireturn(); yield True
+
+def prim_repeat(num, list):
+ num = an_int(num)
+ for i in range(num):
+ icall(evline, list[:]); yield True
+ if procstop: break
+ ireturn(); yield True
+
+def prim_forever(list):
+ while True:
+ icall(evline, list[:]); yield True
+ if procstop: break
+ ireturn(); yield True
+
+def prim_if(bool, list):
+ if bool: icall(evline, list[:]); yield True
+ ireturn(); yield True
+
+def prim_ifelse(bool, list1,list2):
+ if bool: ijmp(evline, list1[:]); yield True
+ else: ijmp(evline, list2[:]); yield True
+
+def prim_opar(val):
+ iline.pop(0)
+ return val
+
+def prim_define(name, body):
+ if type(name) != symtype: name = intern(name)
+ name.nargs, name.fcn = 0, body
+ name.rprim = True
+
+def prim_stack1():
+ global procstop
+ if stacks['stack1']==None: raise logoerror("stack1 undefined")
+ icall(evline, stacks['stack1'][:]); yield True
+ procstop = False
+ ireturn(); yield True
+
+def prim_stack2():
+ global procstop
+ if stacks['stack2']==None: raise logoerror("stack2 undefined")
+ icall(evline, stacks['stack2'][:]); yield True
+ procstop = False
+ ireturn(); yield True
+
+def prim_stopstack():
+ global procstop
+ procstop = True
+
+def prim_utimer():
+ return float(int((clock()-utime_start)*1000000))
+
+def prim_resetut():
+ global utime_start
+ utime_start = clock()
+
+
+def ufuncall(body):
+ ijmp(evline, body); yield True
+
+def an_int(n):
+ try: return int(n)
+ except: raise logoerror("%s doesn't like %s as input" % (cfun.name, str(n)))
+
+def a_float(n):
+ try: return int(n)
+ except: raise logoerror("%s doesn't like %s as input" % (cfun.name, str(n)))
+
+def defprim(name, args, fcn, rprim=False):
+ sym = intern(name)
+ sym.nargs, sym.fcn = args,fcn
+ sym.rprim = rprim
+
+def init():
+ global symtype, numtype, listtype, symnothing, symopar
+ defprim('print', 1, lambda x:showlabel(int(float(x)*10)/10.))
+
+ defprim('sum', 2, lambda x,y:x+y)
+ defprim('+', None, lambda x,y:x+y)
+ defprim('difference', 2, lambda x,y:x-y)
+ defprim('-', None, lambda x,y:x-y)
+ defprim('product', 2, lambda x,y:x*y)
+ defprim('*', None, lambda x,y:x*y)
+ defprim('quotient', 2, lambda x,y:x/y)
+ defprim('/', None, lambda x,y:x/y)
+ defprim('random', 2, lambda x,y: int(random.uniform(x,y)))
+ defprim('greater?', 2, lambda x,y: float(x)>float(y))
+ defprim('less?', 2, lambda x,y: float(x)<float(y))
+ defprim('equal?', 2, lambda x,y: float(x)==float(y))
+ defprim('and', None, lambda x,y:x&y)
+ defprim('or', None, lambda x,y:x|y)
+ defprim('not', 1, lambda x:not x)
+ defprim('%', None, lambda x,y:x%y)
+
+ defprim('clean', 0, turtle.clearscreen)
+ defprim('forward', 1, turtle.forward)
+ defprim('back', 1, lambda x: turtle.forward(-x))
+ defprim('seth', 1, turtle.seth)
+ defprim('right', 1, turtle.right)
+ defprim('left', 1, lambda x:turtle.right(-x))
+ defprim('heading', 0, lambda: turtle.heading)
+ defprim('setxy', 2, turtle.setxy)
+ defprim('arc', 2, turtle.arc)
+ defprim('xcor', 0, lambda: turtle.xcor)
+ defprim('ycor', 0, lambda: turtle.ycor)
+
+ defprim('pendown', 0, lambda: turtle.setpen(True))
+ defprim('penup', 0, lambda: turtle.setpen(False))
+ defprim('(', 1, prim_opar)
+ defprim('setcolor', 1, turtle.setcolor)
+ defprim('setshade', 1, turtle.setshade)
+ defprim('setpensize', 1, turtle.setpensize)
+ defprim('fillscreen', 2, turtle.fillscreen)
+ defprim('color', 0, lambda: turtle.color)
+ defprim('shade', 0, lambda: turtle.shade)
+ defprim('pensize', 0, lambda: turtle.pensize)
+
+ defprim('wait', 1, prim_wait, True)
+ defprim('repeat', 2, prim_repeat, True)
+ defprim('forever', 1, prim_forever, True)
+ defprim('if', 2, prim_if, True)
+ defprim('ifelse', 3, prim_ifelse, True)
+ defprim('stopstack', 0, prim_stopstack)
+
+ defprim('stack1', 0, prim_stack1, True)
+ defprim('stack2', 0, prim_stack2, True)
+ defprim('box1', 0, lambda: boxes['box1'])
+ defprim('box2', 0, lambda: boxes['box2'])
+ defprim('storeinbox1', 1, lambda x: setbox('box1',x))
+ defprim('storeinbox2', 1, lambda x: setbox('box2',x))
+
+ defprim('define', 2, prim_define)
+ defprim('resetut', 0, prim_resetut)
+ defprim('utimer', 0, prim_utimer)
+ defprim('nop', 0, lambda: None)
+ defprim('start', 0, lambda: None)
+
+ symtype = type(intern('print'))
+ numtytpe = type(0.)
+ listtype = type([])
+
+ symnothing = intern('%nothing%')
+ symopar = intern('(')
+
+def doevalstep():
+ starttime = millis()
+ try:
+ while (millis()-starttime)<120:
+ if not step.next(): stopsignoff(); return False
+ except logoerror, e: showlabel(str(e)[1:-1]); stopsignoff(); return False
+ return True
+
+def icall(fcn, *args):
+ global step
+ istack.append(step)
+ step = fcn(*(args))
+
+def ireturn(res=None):
+ global step, iresult
+ step = istack.pop()
+ iresult = res
+
+def ijmp(fcn, *args):
+ global step
+ step = fcn(*(args))
+
+def showlabel(l):
+ status.setlabel(l)
+ status.setlayer(710);
+
+def stopsignon():
+ stopsign.setshape(stopsign.onshape)
+ turtle_spr.setlayer(100)
+
+def stopsignoff():
+ stopsign.setshape(stopsign.offshape)
+ turtle_spr.setlayer(630)
+
+def setbox(name,val): boxes[name]=val
+def tyo(n): print n
+def millis(): return int(clock()*1000)
+
diff --git a/masknumber.gif b/masknumber.gif Binary files differnew file mode 100755 index 0000000..1672ba0 --- /dev/null +++ b/masknumber.gif diff --git a/myblocks/1input.gif b/myblocks/1input.gif Binary files differnew file mode 100755 index 0000000..1c8b8bf --- /dev/null +++ b/myblocks/1input.gif diff --git a/myblocks/1inputmask.gif b/myblocks/1inputmask.gif Binary files differnew file mode 100755 index 0000000..c182222 --- /dev/null +++ b/myblocks/1inputmask.gif diff --git a/myblocks/2inputs.gif b/myblocks/2inputs.gif Binary files differnew file mode 100755 index 0000000..51195db --- /dev/null +++ b/myblocks/2inputs.gif diff --git a/myblocks/2inputsmask.gif b/myblocks/2inputsmask.gif Binary files differnew file mode 100755 index 0000000..976b6d5 --- /dev/null +++ b/myblocks/2inputsmask.gif diff --git a/myblocks/3inputs.gif b/myblocks/3inputs.gif Binary files differnew file mode 100755 index 0000000..b984637 --- /dev/null +++ b/myblocks/3inputs.gif diff --git a/myblocks/3inputsmask.gif b/myblocks/3inputsmask.gif Binary files differnew file mode 100755 index 0000000..7cae1e9 --- /dev/null +++ b/myblocks/3inputsmask.gif diff --git a/myblocks/boutput.gif b/myblocks/boutput.gif Binary files differnew file mode 100755 index 0000000..1ec435c --- /dev/null +++ b/myblocks/boutput.gif diff --git a/myblocks/boutputmask.gif b/myblocks/boutputmask.gif Binary files differnew file mode 100755 index 0000000..4062726 --- /dev/null +++ b/myblocks/boutputmask.gif diff --git a/myblocks/box1.gif b/myblocks/box1.gif Binary files differnew file mode 100755 index 0000000..1029ed3 --- /dev/null +++ b/myblocks/box1.gif diff --git a/myblocks/box2.gif b/myblocks/box2.gif Binary files differnew file mode 100755 index 0000000..d96aa73 --- /dev/null +++ b/myblocks/box2.gif diff --git a/myblocks/global.gif b/myblocks/global.gif Binary files differnew file mode 100755 index 0000000..a067b24 --- /dev/null +++ b/myblocks/global.gif diff --git a/myblocks/global1.gif b/myblocks/global1.gif Binary files differnew file mode 100755 index 0000000..204f6d1 --- /dev/null +++ b/myblocks/global1.gif diff --git a/myblocks/global1mask.gif b/myblocks/global1mask.gif Binary files differnew file mode 100755 index 0000000..519ac9b --- /dev/null +++ b/myblocks/global1mask.gif diff --git a/myblocks/globalmask.gif b/myblocks/globalmask.gif Binary files differnew file mode 100755 index 0000000..6d2c42f --- /dev/null +++ b/myblocks/globalmask.gif diff --git a/myblocks/hat1.gif b/myblocks/hat1.gif Binary files differnew file mode 100755 index 0000000..fd9eb1e --- /dev/null +++ b/myblocks/hat1.gif diff --git a/myblocks/hat2.gif b/myblocks/hat2.gif Binary files differnew file mode 100755 index 0000000..ad3caf8 --- /dev/null +++ b/myblocks/hat2.gif diff --git a/myblocks/line.gif b/myblocks/line.gif Binary files differnew file mode 100755 index 0000000..6d7ca55 --- /dev/null +++ b/myblocks/line.gif diff --git a/myblocks/linemask.gif b/myblocks/linemask.gif Binary files differnew file mode 100755 index 0000000..329e2ae --- /dev/null +++ b/myblocks/linemask.gif diff --git a/myblocks/myblocksgroup.gif b/myblocks/myblocksgroup.gif Binary files differnew file mode 100755 index 0000000..51df41e --- /dev/null +++ b/myblocks/myblocksgroup.gif diff --git a/myblocks/myblocksmask.gif b/myblocks/myblocksmask.gif Binary files differnew file mode 100755 index 0000000..5905411 --- /dev/null +++ b/myblocks/myblocksmask.gif diff --git a/myblocks/mystuffbg.gif b/myblocks/mystuffbg.gif Binary files differnew file mode 100755 index 0000000..3a3bc99 --- /dev/null +++ b/myblocks/mystuffbg.gif diff --git a/myblocks/mystuffgroup.gif b/myblocks/mystuffgroup.gif Binary files differnew file mode 100755 index 0000000..06b92fb --- /dev/null +++ b/myblocks/mystuffgroup.gif diff --git a/myblocks/mystuffmask.gif b/myblocks/mystuffmask.gif Binary files differnew file mode 100755 index 0000000..b03eccc --- /dev/null +++ b/myblocks/mystuffmask.gif diff --git a/myblocks/opwith1ip.gif b/myblocks/opwith1ip.gif Binary files differnew file mode 100755 index 0000000..ee81a67 --- /dev/null +++ b/myblocks/opwith1ip.gif diff --git a/myblocks/opwith1ipb.gif b/myblocks/opwith1ipb.gif Binary files differnew file mode 100755 index 0000000..fc01937 --- /dev/null +++ b/myblocks/opwith1ipb.gif diff --git a/myblocks/opwith1ipbmask.gif b/myblocks/opwith1ipbmask.gif Binary files differnew file mode 100755 index 0000000..1d9b98b --- /dev/null +++ b/myblocks/opwith1ipbmask.gif diff --git a/myblocks/opwith1ipmask.gif b/myblocks/opwith1ipmask.gif Binary files differnew file mode 100755 index 0000000..d985329 --- /dev/null +++ b/myblocks/opwith1ipmask.gif diff --git a/myblocks/output.gif b/myblocks/output.gif Binary files differnew file mode 100755 index 0000000..ec894e1 --- /dev/null +++ b/myblocks/output.gif diff --git a/myblocks/output1.gif b/myblocks/output1.gif Binary files differnew file mode 100755 index 0000000..72f0706 --- /dev/null +++ b/myblocks/output1.gif diff --git a/myblocks/output1mask.gif b/myblocks/output1mask.gif Binary files differnew file mode 100755 index 0000000..519ac9b --- /dev/null +++ b/myblocks/output1mask.gif diff --git a/myblocks/outputmask.gif b/myblocks/outputmask.gif Binary files differnew file mode 100755 index 0000000..6d2c42f --- /dev/null +++ b/myblocks/outputmask.gif diff --git a/myblocks/procedure.gif b/myblocks/procedure.gif Binary files differnew file mode 100755 index 0000000..1418e89 --- /dev/null +++ b/myblocks/procedure.gif diff --git a/myblocks/proceduremask.gif b/myblocks/proceduremask.gif Binary files differnew file mode 100755 index 0000000..b8b7242 --- /dev/null +++ b/myblocks/proceduremask.gif diff --git a/myblocks/setglobal.gif b/myblocks/setglobal.gif Binary files differnew file mode 100755 index 0000000..0f4908b --- /dev/null +++ b/myblocks/setglobal.gif diff --git a/myblocks/setglobalmask.gif b/myblocks/setglobalmask.gif Binary files differnew file mode 100755 index 0000000..f654994 --- /dev/null +++ b/myblocks/setglobalmask.gif diff --git a/myblocks/stack1.gif b/myblocks/stack1.gif Binary files differnew file mode 100755 index 0000000..57025ce --- /dev/null +++ b/myblocks/stack1.gif diff --git a/myblocks/stack2.gif b/myblocks/stack2.gif Binary files differnew file mode 100755 index 0000000..1e9dcba --- /dev/null +++ b/myblocks/stack2.gif diff --git a/myblocks/start.gif b/myblocks/start.gif Binary files differnew file mode 100755 index 0000000..b116f7b --- /dev/null +++ b/myblocks/start.gif diff --git a/myblocks/startmask.gif b/myblocks/startmask.gif Binary files differnew file mode 100755 index 0000000..fb2b9cd --- /dev/null +++ b/myblocks/startmask.gif diff --git a/myblocks/storeinbox1.gif b/myblocks/storeinbox1.gif Binary files differnew file mode 100755 index 0000000..95d8229 --- /dev/null +++ b/myblocks/storeinbox1.gif diff --git a/myblocks/storeinbox2.gif b/myblocks/storeinbox2.gif Binary files differnew file mode 100755 index 0000000..7df4f9a --- /dev/null +++ b/myblocks/storeinbox2.gif diff --git a/numbers/and.gif b/numbers/and.gif Binary files differnew file mode 100755 index 0000000..df94a8f --- /dev/null +++ b/numbers/and.gif diff --git a/numbers/division.gif b/numbers/division.gif Binary files differnew file mode 100755 index 0000000..358e6a6 --- /dev/null +++ b/numbers/division.gif diff --git a/numbers/equal.gif b/numbers/equal.gif Binary files differnew file mode 100755 index 0000000..3152be1 --- /dev/null +++ b/numbers/equal.gif diff --git a/numbers/greater.gif b/numbers/greater.gif Binary files differnew file mode 100755 index 0000000..1e5e304 --- /dev/null +++ b/numbers/greater.gif diff --git a/numbers/less.gif b/numbers/less.gif Binary files differnew file mode 100755 index 0000000..9ff0343 --- /dev/null +++ b/numbers/less.gif diff --git a/numbers/minus.gif b/numbers/minus.gif Binary files differnew file mode 100755 index 0000000..1630422 --- /dev/null +++ b/numbers/minus.gif diff --git a/numbers/not.gif b/numbers/not.gif Binary files differnew file mode 100755 index 0000000..44f50eb --- /dev/null +++ b/numbers/not.gif diff --git a/numbers/number.gif b/numbers/number.gif Binary files differnew file mode 100755 index 0000000..edd558e --- /dev/null +++ b/numbers/number.gif diff --git a/numbers/numbersgroup.gif b/numbers/numbersgroup.gif Binary files differnew file mode 100755 index 0000000..fc6d458 --- /dev/null +++ b/numbers/numbersgroup.gif diff --git a/numbers/numbersmask.gif b/numbers/numbersmask.gif Binary files differnew file mode 100755 index 0000000..7df1fc6 --- /dev/null +++ b/numbers/numbersmask.gif diff --git a/numbers/or.gif b/numbers/or.gif Binary files differnew file mode 100755 index 0000000..bc69e74 --- /dev/null +++ b/numbers/or.gif diff --git a/numbers/plus.gif b/numbers/plus.gif Binary files differnew file mode 100755 index 0000000..3e46aa2 --- /dev/null +++ b/numbers/plus.gif diff --git a/numbers/print.gif b/numbers/print.gif Binary files differnew file mode 100755 index 0000000..7f076cc --- /dev/null +++ b/numbers/print.gif diff --git a/numbers/product.gif b/numbers/product.gif Binary files differnew file mode 100755 index 0000000..b302763 --- /dev/null +++ b/numbers/product.gif diff --git a/numbers/random.gif b/numbers/random.gif Binary files differnew file mode 100755 index 0000000..c24ece3 --- /dev/null +++ b/numbers/random.gif diff --git a/numbers/remainder.gif b/numbers/remainder.gif Binary files differnew file mode 100755 index 0000000..670dacd --- /dev/null +++ b/numbers/remainder.gif diff --git a/palette/flowoff.gif b/palette/flowoff.gif Binary files differnew file mode 100755 index 0000000..d6c5313 --- /dev/null +++ b/palette/flowoff.gif diff --git a/palette/flowon.gif b/palette/flowon.gif Binary files differnew file mode 100755 index 0000000..c3e4c20 --- /dev/null +++ b/palette/flowon.gif diff --git a/palette/myblocksoff.gif b/palette/myblocksoff.gif Binary files differnew file mode 100755 index 0000000..4caf057 --- /dev/null +++ b/palette/myblocksoff.gif diff --git a/palette/myblockson.gif b/palette/myblockson.gif Binary files differnew file mode 100755 index 0000000..8c19095 --- /dev/null +++ b/palette/myblockson.gif diff --git a/palette/numbersoff.gif b/palette/numbersoff.gif Binary files differnew file mode 100755 index 0000000..4e1f2c1 --- /dev/null +++ b/palette/numbersoff.gif diff --git a/palette/numberson.gif b/palette/numberson.gif Binary files differnew file mode 100755 index 0000000..ac66ef3 --- /dev/null +++ b/palette/numberson.gif diff --git a/palette/penoff.gif b/palette/penoff.gif Binary files differnew file mode 100755 index 0000000..165af4c --- /dev/null +++ b/palette/penoff.gif diff --git a/palette/penon.gif b/palette/penon.gif Binary files differnew file mode 100755 index 0000000..25a4829 --- /dev/null +++ b/palette/penon.gif diff --git a/palette/turtleoff.gif b/palette/turtleoff.gif Binary files differnew file mode 100755 index 0000000..7aa8fe4 --- /dev/null +++ b/palette/turtleoff.gif diff --git a/palette/turtleon.gif b/palette/turtleon.gif Binary files differnew file mode 100755 index 0000000..7b660c9 --- /dev/null +++ b/palette/turtleon.gif diff --git a/pen/color.gif b/pen/color.gif Binary files differnew file mode 100755 index 0000000..e06f7be --- /dev/null +++ b/pen/color.gif diff --git a/pen/fillscreen.gif b/pen/fillscreen.gif Binary files differnew file mode 100755 index 0000000..9243702 --- /dev/null +++ b/pen/fillscreen.gif diff --git a/pen/pendown.gif b/pen/pendown.gif Binary files differnew file mode 100755 index 0000000..68e875a --- /dev/null +++ b/pen/pendown.gif diff --git a/pen/pengroup.gif b/pen/pengroup.gif Binary files differnew file mode 100755 index 0000000..dfc270f --- /dev/null +++ b/pen/pengroup.gif diff --git a/pen/penmask.gif b/pen/penmask.gif Binary files differnew file mode 100755 index 0000000..1031adb --- /dev/null +++ b/pen/penmask.gif diff --git a/pen/pensize.gif b/pen/pensize.gif Binary files differnew file mode 100755 index 0000000..273a0dd --- /dev/null +++ b/pen/pensize.gif diff --git a/pen/penup.gif b/pen/penup.gif Binary files differnew file mode 100755 index 0000000..b57c50f --- /dev/null +++ b/pen/penup.gif diff --git a/pen/setbg.gif b/pen/setbg.gif Binary files differnew file mode 100755 index 0000000..df64e7b --- /dev/null +++ b/pen/setbg.gif diff --git a/pen/setcolor.gif b/pen/setcolor.gif Binary files differnew file mode 100755 index 0000000..2f7c926 --- /dev/null +++ b/pen/setcolor.gif diff --git a/pen/setpensize.gif b/pen/setpensize.gif Binary files differnew file mode 100755 index 0000000..0f3877e --- /dev/null +++ b/pen/setpensize.gif diff --git a/pen/setshade.gif b/pen/setshade.gif Binary files differnew file mode 100755 index 0000000..de13ca8 --- /dev/null +++ b/pen/setshade.gif diff --git a/pen/shade.gif b/pen/shade.gif Binary files differnew file mode 100755 index 0000000..68d7d1e --- /dev/null +++ b/pen/shade.gif diff --git a/samples/birds.png b/samples/birds.png Binary files differnew file mode 100755 index 0000000..fbb44bb --- /dev/null +++ b/samples/birds.png diff --git a/samples/birds.ta b/samples/birds.ta new file mode 100755 index 0000000..fd73c16 --- /dev/null +++ b/samples/birds.ta @@ -0,0 +1,319 @@ +(lp0 +(I0 +S'hat1' +p1 +I330 +I306 +(lp2 +NaI4 +atp3 +a(I1 +S'clean' +p4 +I866 +I149 +(lp5 +NaI2 +atp6 +a(I2 +S'repeat' +p7 +I866 +I188 +(lp8 +I1 +aI31 +aI3 +aNatp9 +a(I3 +S'stack1' +p10 +I961 +I237 +(lp11 +I2 +aNatp12 +a(I4 +S'setxy' +p13 +I342 +I356 +(lp14 +I0 +aI5 +aI8 +aI11 +atp15 +a(I5 +S'random' +p16 +I416 +I346 +(lp17 +I4 +aI6 +aI7 +aNatp18 +a(I6 +(S'number' +p19 +S'-600' +p20 +tp21 +I444 +I365 +(lp22 +I5 +aNatp23 +a(I7 +(g19 +S'600' +p24 +tp25 +I566 +I365 +(lp26 +I5 +aNatp27 +a(I8 +g16 +I416 +I383 +(lp28 +I4 +aI9 +aI10 +aNatp29 +a(I9 +(g19 +S'-450' +p30 +tp31 +I444 +I402 +(lp32 +I8 +aNatp33 +a(I10 +(g19 +S'450' +p34 +tp35 +I566 +I402 +(lp36 +I8 +aNatp37 +a(I11 +S'setpensize' +p38 +I342 +I432 +(lp39 +I4 +aI12 +aI13 +atp40 +a(I12 +(g19 +S'10' +p41 +tp42 +I416 +I449 +(lp43 +I11 +aNatp44 +a(I13 +g7 +I342 +I486 +(lp45 +I11 +aI14 +aI15 +aNatp46 +a(I14 +(g19 +S'720' +p47 +tp48 +I428 +I495 +(lp49 +I13 +aNatp50 +a(I15 +S'forward' +p51 +I437 +I535 +(lp52 +I13 +aI16 +aI17 +atp53 +a(I16 +(g19 +S'200' +p54 +tp55 +I511 +I544 +(lp56 +I15 +aNatp57 +a(I17 +S'setcolor' +p58 +I437 +I574 +(lp59 +I15 +aI18 +aI21 +atp60 +a(I18 +S'xcor' +p61 +I511 +I591 +(lp62 +I17 +aI19 +atp63 +a(I19 +S'division' +p64 +I604 +I583 +(lp65 +I18 +aI20 +atp66 +a(I20 +(g19 +S'5' +p67 +tp68 +I643 +I591 +(lp69 +I19 +aNatp70 +a(I21 +S'setshade' +p71 +I437 +I628 +(lp72 +I17 +aI22 +aI23 +atp73 +a(I22 +S'heading' +p74 +I511 +I645 +(lp75 +I21 +aNatp76 +a(I23 +S'back' +p77 +I437 +I682 +(lp78 +I21 +aI24 +aI25 +atp79 +a(I24 +(g19 +S'400' +p80 +tp81 +I511 +I691 +(lp82 +I23 +aNatp83 +a(I25 +g51 +I437 +I721 +(lp84 +I23 +aI26 +aI29 +atp85 +a(I26 +g16 +I511 +I711 +(lp86 +I25 +aI27 +aI28 +aNatp87 +a(I27 +(g19 +S'190' +p88 +tp89 +I539 +I730 +(lp90 +I26 +aNatp91 +a(I28 +(g19 +S'210' +p92 +tp93 +I661 +I730 +(lp94 +I26 +aNatp95 +a(I29 +S'left' +p96 +I437 +I760 +(lp97 +I25 +aI30 +aNatp98 +a(I30 +(g19 +S'1' +p99 +tp100 +I511 +I769 +(lp101 +I29 +aNatp102 +a(I31 +(g19 +S'30' +p103 +tp104 +I952 +I197 +(lp105 +I2 +aNatp106 +a(I-1 +S'turtle' +p107 +F-383.13877876282021 +F-420.8404738372858 +F0.0 +F74.898245163485598 +F1.0 +F10.0 +tp108 +a.
\ No newline at end of file diff --git a/samples/bubbles.png b/samples/bubbles.png Binary files differnew file mode 100755 index 0000000..2f296b9 --- /dev/null +++ b/samples/bubbles.png diff --git a/samples/bubbles.ta b/samples/bubbles.ta new file mode 100755 index 0000000..93dfe7f --- /dev/null +++ b/samples/bubbles.ta @@ -0,0 +1,253 @@ +(lp0 +(I0 +S'setcolor' +p1 +I737 +I246 +(lp2 +NaI1 +aI2 +atp3 +a(I1 +(S'number' +p4 +S'60' +p5 +tp6 +I811 +I263 +(lp7 +I0 +aNatp8 +a(I2 +S'repeat' +p9 +I737 +I300 +(lp10 +I0 +aI3 +aI4 +aNatp11 +a(I3 +(g4 +S'5000' +p12 +tp13 +I823 +I309 +(lp14 +I2 +aNatp15 +a(I4 +S'setxy' +p16 +I832 +I349 +(lp17 +I2 +aI5 +aI8 +aI11 +atp18 +a(I5 +S'random' +p19 +I906 +I339 +(lp20 +I4 +aI6 +aI7 +aNatp21 +a(I6 +(g4 +S'-600' +p22 +tp23 +I934 +I358 +(lp24 +I5 +aNatp25 +a(I7 +(g4 +S'600' +p26 +tp27 +I1056 +I358 +(lp28 +I5 +aNatp29 +a(I8 +g19 +I906 +I376 +(lp30 +I4 +aI9 +aI10 +aNatp31 +a(I9 +(g4 +S'-450' +p32 +tp33 +I934 +I395 +(lp34 +I8 +aNatp35 +a(I10 +(g4 +S'450' +p36 +tp37 +I1056 +I395 +(lp38 +I8 +aNatp39 +a(I11 +S'storeinbox1' +p40 +I832 +I425 +(lp41 +I4 +aI12 +aI15 +atp42 +a(I12 +S'ycor' +p43 +I906 +I442 +(lp44 +I11 +aI13 +atp45 +a(I13 +S'plus' +p46 +I999 +I434 +(lp47 +I12 +aI14 +atp48 +a(I14 +(g4 +S'900' +p49 +tp50 +I1038 +I442 +(lp51 +I13 +aNatp52 +a(I15 +S'setpensize' +p53 +I832 +I479 +(lp54 +I11 +aI16 +aI19 +atp55 +a(I16 +S'box1' +p56 +I906 +I496 +(lp57 +I15 +aI17 +atp58 +a(I17 +S'division' +p59 +I999 +I488 +(lp60 +I16 +aI18 +atp61 +a(I18 +(g4 +S'9' +p62 +tp63 +I1038 +I496 +(lp64 +I17 +aNatp65 +a(I19 +S'setshade' +p66 +I832 +I533 +(lp67 +I15 +aI20 +aI23 +atp68 +a(I20 +g56 +I906 +I550 +(lp69 +I19 +aI21 +atp70 +a(I21 +g59 +I999 +I542 +(lp71 +I20 +aI22 +atp72 +a(I22 +(g4 +S'12' +p73 +tp74 +I1038 +I550 +(lp75 +I21 +aNatp76 +a(I23 +S'forward' +p77 +I832 +I587 +(lp78 +I19 +aI24 +aNatp79 +a(I24 +(g4 +S'1' +p80 +tp81 +I906 +I596 +(lp82 +I23 +aNatp83 +a(I-1 +S'turtle' +p84 +I-204 +I-436 +I0 +F60.0 +F38.666666666666664 +F51.555555555555557 +tp85 +a.
\ No newline at end of file diff --git a/samples/candyvortex.png b/samples/candyvortex.png Binary files differnew file mode 100755 index 0000000..89aec32 --- /dev/null +++ b/samples/candyvortex.png diff --git a/samples/candyvortex.ta b/samples/candyvortex.ta new file mode 100755 index 0000000..30e67af --- /dev/null +++ b/samples/candyvortex.ta @@ -0,0 +1,143 @@ +(lp0 +(I0 +S'repeat' +p1 +I777 +I164 +(lp2 +NaI1 +aI2 +aNatp3 +a(I1 +(S'number' +p4 +I350 +tp5 +I863 +I173 +(lp6 +I0 +aNatp7 +a(I2 +S'setpensize' +p8 +I872 +I213 +(lp9 +I0 +aI3 +aI4 +atp10 +a(I3 +S'heading' +p11 +I946 +I230 +(lp12 +I2 +aNatp13 +a(I4 +S'forward' +p14 +I872 +I267 +(lp15 +I2 +aI5 +aI6 +atp16 +a(I5 +(g4 +S'1000' +p17 +tp18 +I946 +I276 +(lp19 +I4 +aNatp20 +a(I6 +S'setcolor' +p21 +I872 +I306 +(lp22 +I4 +aI7 +aI8 +atp23 +a(I7 +S'xcor' +p24 +I946 +I323 +(lp25 +I6 +aNatp26 +a(I8 +S'setshade' +p27 +I872 +I360 +(lp28 +I6 +aI9 +aI10 +atp29 +a(I9 +S'ycor' +p30 +I946 +I377 +(lp31 +I8 +aNatp32 +a(I10 +S'back' +p33 +I872 +I414 +(lp34 +I8 +aI11 +aI12 +atp35 +a(I11 +(g4 +S'1000' +p36 +tp37 +I946 +I423 +(lp38 +I10 +aNatp39 +a(I12 +S'left' +p40 +I872 +I453 +(lp41 +I10 +aI13 +aNatp42 +a(I13 +(g4 +I1 +tp43 +I946 +I462 +(lp44 +I12 +aNatp45 +a(I-1 +S'turtle' +p46 +F0.0 +F0.0 +F10.0 +F8.1910046234551999 +F17.372816552336076 +F11.0 +tp47 +a.
\ No newline at end of file diff --git a/samples/colors.png b/samples/colors.png Binary files differnew file mode 100755 index 0000000..2891ba7 --- /dev/null +++ b/samples/colors.png diff --git a/samples/colors.ta b/samples/colors.ta new file mode 100755 index 0000000..7ab30e8 --- /dev/null +++ b/samples/colors.ta @@ -0,0 +1,125 @@ +(lp0 +(I0 +S'setpensize' +p1 +I460 +I86 +(lp2 +NaI1 +aI2 +atp3 +a(I1 +(S'number' +p4 +S'15' +p5 +tp6 +I534 +I103 +(lp7 +I0 +aNatp8 +a(I2 +S'repeat' +p9 +I460 +I140 +(lp10 +I0 +aI3 +aI4 +aNatp11 +a(I3 +(g4 +I360 +tp12 +I546 +I149 +(lp13 +I2 +aNatp14 +a(I4 +S'setcolor' +p15 +I555 +I189 +(lp16 +I2 +aI5 +aI6 +atp17 +a(I5 +S'heading' +p18 +I629 +I206 +(lp19 +I4 +aNatp20 +a(I6 +S'forward' +p21 +I555 +I243 +(lp22 +I4 +aI7 +aI8 +atp23 +a(I7 +(g4 +I1000 +tp24 +I629 +I252 +(lp25 +I6 +aNatp26 +a(I8 +S'back' +p27 +I555 +I282 +(lp28 +I6 +aI9 +aI10 +atp29 +a(I9 +(g4 +I1000 +tp30 +I629 +I291 +(lp31 +I8 +aNatp32 +a(I10 +S'right' +p33 +I555 +I321 +(lp34 +I8 +aI11 +aNatp35 +a(I11 +(g4 +I1 +tp36 +I629 +I330 +(lp37 +I10 +aNatp38 +a(I-1 +S'turtle' +p39 +F0.0 +F0.0 +F0.0 +F40.0 +I50 +F15.0 +tp40 +a.
\ No newline at end of file diff --git a/samples/csquiral.png b/samples/csquiral.png Binary files differnew file mode 100755 index 0000000..41b309a --- /dev/null +++ b/samples/csquiral.png diff --git a/samples/csquiral.ta b/samples/csquiral.ta new file mode 100755 index 0000000..c84cd54 --- /dev/null +++ b/samples/csquiral.ta @@ -0,0 +1,201 @@ +(lp0 +(I0 +S'setpensize' +p1 +I690 +I180 +(lp2 +NaI1 +aI2 +atp3 +a(I1 +(S'number' +p4 +S'25' +p5 +tp6 +I764 +I197 +(lp7 +I0 +aNatp8 +a(I2 +S'storeinbox1' +p9 +I690 +I234 +(lp10 +I0 +aI3 +aI4 +atp11 +a(I3 +(g4 +S'0' +p12 +tp13 +I764 +I251 +(lp14 +I2 +aNatp15 +a(I4 +S'repeat' +p16 +I690 +I288 +(lp17 +I2 +aI5 +aI6 +aNatp18 +a(I5 +(g4 +S'1300' +p19 +tp20 +I776 +I297 +(lp21 +I4 +aNatp22 +a(I6 +S'setcolor' +p23 +I785 +I337 +(lp24 +I4 +aI7 +aI10 +atp25 +a(I7 +S'xcor' +p26 +I859 +I354 +(lp27 +I6 +aI8 +atp28 +a(I8 +S'division' +p29 +I952 +I346 +(lp30 +I7 +aI9 +atp31 +a(I9 +(g4 +S'6' +p32 +tp33 +I991 +I354 +(lp34 +I8 +aNatp35 +a(I10 +S'setshade' +p36 +I785 +I391 +(lp37 +I6 +aI11 +aI12 +atp38 +a(I11 +S'heading' +p39 +I859 +I408 +(lp40 +I10 +aNatp41 +a(I12 +S'forward' +p42 +I785 +I445 +(lp43 +I10 +aI13 +aI14 +atp44 +a(I13 +S'box1' +p45 +I859 +I454 +(lp46 +I12 +aNatp47 +a(I14 +S'right' +p48 +I785 +I484 +(lp49 +I12 +aI15 +aI16 +atp50 +a(I15 +(g4 +S'91' +p51 +tp52 +I859 +I493 +(lp53 +I14 +aNatp54 +a(I16 +g9 +I785 +I523 +(lp55 +I14 +aI17 +aNatp56 +a(I17 +g45 +I859 +I540 +(lp57 +I16 +aI18 +atp58 +a(I18 +S'plus' +p59 +I952 +I532 +(lp60 +I17 +aI19 +atp61 +a(I19 +(g4 +S'1' +p62 +tp63 +I991 +I540 +(lp64 +I18 +aNatp65 +a(I-1 +S'turtle' +p66 +F906.80942086435073 +F86.478356202884811 +F220.0 +F16.117197178042431 +F70.0 +F25.0 +tp67 +a.
\ No newline at end of file diff --git a/samples/curlygates.png b/samples/curlygates.png Binary files differnew file mode 100755 index 0000000..c28e608 --- /dev/null +++ b/samples/curlygates.png diff --git a/samples/curlygates.ta b/samples/curlygates.ta new file mode 100755 index 0000000..a28e8fa --- /dev/null +++ b/samples/curlygates.ta @@ -0,0 +1,469 @@ +(lp0 +(I0 +S'hat2' +p1 +I689 +I380 +(lp2 +NaI1 +atp3 +a(I1 +S'setcolor' +p4 +I701 +I430 +(lp5 +I0 +aI2 +aI3 +atp6 +a(I2 +(S'number' +p7 +S'20' +p8 +tp9 +I775 +I447 +(lp10 +I1 +aNatp11 +a(I3 +S'setshade' +p12 +I701 +I484 +(lp13 +I1 +aI4 +aI5 +atp14 +a(I4 +(g7 +S'60' +p15 +tp16 +I775 +I501 +(lp17 +I3 +aNatp18 +a(I5 +S'setpensize' +p19 +I701 +I538 +(lp20 +I3 +aI6 +aI7 +atp21 +a(I6 +(g7 +S'20' +p22 +tp23 +I775 +I555 +(lp24 +I5 +aNatp25 +a(I7 +S'stack1' +p26 +I701 +I592 +(lp27 +I5 +aI8 +atp28 +a(I8 +g4 +I701 +I631 +(lp29 +I7 +aI9 +aI10 +atp30 +a(I9 +(g7 +S'0' +p31 +tp32 +I775 +I648 +(lp33 +I8 +aNatp34 +a(I10 +g12 +I701 +I685 +(lp35 +I8 +aI11 +aI14 +atp36 +a(I11 +S'random' +p37 +I775 +I683 +(lp38 +I10 +aI12 +aI13 +aNatp39 +a(I12 +(g7 +S'60' +p40 +tp41 +I803 +I702 +(lp42 +I11 +aNatp43 +a(I13 +(g7 +S'80' +p44 +tp45 +I925 +I702 +(lp46 +I11 +aNatp47 +a(I14 +g19 +I701 +I739 +(lp48 +I10 +aI15 +aI16 +atp49 +a(I15 +(g7 +S'12' +p50 +tp51 +I775 +I756 +(lp52 +I14 +aNatp53 +a(I16 +g26 +I701 +I793 +(lp54 +I14 +aNatp55 +a(I17 +S'hat1' +p56 +I660 +I90 +(lp57 +NaI18 +atp58 +a(I18 +S'repeat' +p59 +I672 +I140 +(lp60 +I17 +aI19 +aI20 +aNatp61 +a(I19 +(g7 +S'3' +p62 +tp63 +I758 +I149 +(lp64 +I18 +aNatp65 +a(I20 +S'storeinbox1' +p66 +I767 +I189 +(lp67 +I18 +aI21 +aI22 +atp68 +a(I21 +(g7 +S'200' +p69 +tp70 +I841 +I206 +(lp71 +I20 +aNatp72 +a(I22 +g59 +I767 +I243 +(lp73 +I20 +aI23 +aI24 +aNatp74 +a(I23 +(g7 +S'20' +p75 +tp76 +I853 +I252 +(lp77 +I22 +aNatp78 +a(I24 +S'arc' +p79 +I862 +I292 +(lp80 +I22 +aI25 +aI26 +aI27 +atp81 +a(I25 +(g7 +S'30' +p82 +tp83 +I936 +I301 +(lp84 +I24 +aNatp85 +a(I26 +S'box1' +p86 +I936 +I338 +(lp87 +I24 +aNatp88 +a(I27 +g66 +I862 +I368 +(lp89 +I24 +aI28 +aNatp90 +a(I28 +g86 +I936 +I385 +(lp91 +I27 +aI29 +atp92 +a(I29 +S'division' +p93 +I1029 +I377 +(lp94 +I28 +aI30 +atp95 +a(I30 +(g7 +S'1.2' +p96 +tp97 +I1068 +I385 +(lp98 +I29 +aNatp99 +a(I31 +S'fillscreen' +p100 +I216 +I375 +(lp101 +NaI32 +aI33 +aI34 +atp102 +a(I32 +(g7 +S'50' +p103 +tp104 +I290 +I384 +(lp105 +I31 +aNatp106 +a(I33 +(g7 +S'30' +p107 +tp108 +I290 +I421 +(lp109 +I31 +aNatp110 +a(I34 +g59 +I216 +I451 +(lp111 +I31 +aI35 +aI36 +aNatp112 +a(I35 +(g7 +S'20' +p113 +tp114 +I302 +I460 +(lp115 +I34 +aNatp116 +a(I36 +S'setxy' +p117 +I311 +I500 +(lp118 +I34 +aI37 +aI40 +aI43 +atp119 +a(I37 +g37 +I385 +I490 +(lp120 +I36 +aI38 +aI39 +aNatp121 +a(I38 +(g7 +S'-570' +p122 +tp123 +I413 +I509 +(lp124 +I37 +aNatp125 +a(I39 +(g7 +S'570' +p126 +tp127 +I535 +I509 +(lp128 +I37 +aNatp129 +a(I40 +g37 +I385 +I527 +(lp130 +I36 +aI41 +aI42 +aNatp131 +a(I41 +(g7 +S'-440' +p132 +tp133 +I413 +I546 +(lp134 +I40 +aNatp135 +a(I42 +(g7 +S'440' +p136 +tp137 +I535 +I546 +(lp138 +I40 +aNatp139 +a(I43 +S'seth' +p140 +I311 +I576 +(lp141 +I36 +aI44 +aI47 +atp142 +a(I44 +g37 +I385 +I566 +(lp143 +I43 +aI45 +aI46 +aNatp144 +a(I45 +(g7 +g31 +tp145 +I413 +I585 +(lp146 +I44 +aNatp147 +a(I46 +(g7 +S'360' +p148 +tp149 +I535 +I585 +(lp150 +I44 +aNatp151 +a(I47 +S'stack2' +p152 +I311 +I615 +(lp153 +I43 +aNatp154 +a(I-1 +S'turtle' +p155 +F-54.000000000000028 +F-435.00000000000006 +F251.0 +F0.0 +I71 +F12.0 +tp156 +a.
\ No newline at end of file diff --git a/samples/dots.png b/samples/dots.png Binary files differnew file mode 100755 index 0000000..dd95036 --- /dev/null +++ b/samples/dots.png diff --git a/samples/dots.ta b/samples/dots.ta new file mode 100755 index 0000000..a228722 --- /dev/null +++ b/samples/dots.ta @@ -0,0 +1,225 @@ +(lp0 +(I0 +S'setcolor' +p1 +I322 +I195 +(lp2 +NaI1 +aI2 +atp3 +a(I1 +(S'number' +p4 +S'0' +p5 +tp6 +I396 +I212 +(lp7 +I0 +aNatp8 +a(I2 +S'clean' +p9 +I322 +I249 +(lp10 +I0 +aI3 +atp11 +a(I3 +S'setpensize' +p12 +I322 +I288 +(lp13 +I2 +aI22 +aI4 +atp14 +a(I4 +S'storeinbox1' +p15 +I322 +I342 +(lp16 +I3 +aI5 +aI6 +atp17 +a(I5 +(g4 +g5 +tp18 +I396 +I359 +(lp19 +I4 +aNatp20 +a(I6 +S'repeat' +p21 +I322 +I396 +(lp22 +I4 +aI7 +aI8 +aNatp23 +a(I7 +(g4 +S'1000' +p24 +tp25 +I408 +I405 +(lp26 +I6 +aNatp27 +a(I8 +S'pendown' +p28 +I417 +I445 +(lp29 +I6 +aI9 +atp30 +a(I9 +S'forward' +p31 +I417 +I484 +(lp32 +I8 +aI10 +aI11 +atp33 +a(I10 +(g4 +S'1' +p34 +tp35 +I491 +I493 +(lp36 +I9 +aNatp37 +a(I11 +S'penup' +p38 +I417 +I523 +(lp39 +I9 +aI12 +atp40 +a(I12 +g31 +I417 +I562 +(lp41 +I11 +aI13 +aI14 +atp42 +a(I13 +S'box1' +p43 +I491 +I571 +(lp44 +I12 +aNatp45 +a(I14 +S'right' +p46 +I417 +I601 +(lp47 +I12 +aI15 +aI16 +atp48 +a(I15 +(g4 +S'93' +p49 +tp50 +I491 +I610 +(lp51 +I14 +aNatp52 +a(I16 +g15 +I417 +I640 +(lp53 +I14 +aI17 +aI20 +atp54 +a(I17 +g43 +I491 +I657 +(lp55 +I16 +aI18 +atp56 +a(I18 +S'plus' +p57 +I584 +I649 +(lp58 +I17 +aI19 +atp59 +a(I19 +(g4 +g34 +tp60 +I623 +I657 +(lp61 +I18 +aNatp62 +a(I20 +g1 +I417 +I694 +(lp63 +I16 +aI21 +aNatp64 +a(I21 +g43 +I491 +I711 +(lp65 +I20 +aNatp66 +a(I22 +(g4 +S'20' +p67 +tp68 +I396 +I305 +(lp69 +I3 +aNatp70 +a(I-1 +S'turtle' +p71 +F-195.08137186354315 +F661.36192458837445 +F120.0 +F0.0 +I50 +F15.0 +tp72 +a.
\ No newline at end of file diff --git a/samples/flower.png b/samples/flower.png Binary files differnew file mode 100755 index 0000000..9977d3a --- /dev/null +++ b/samples/flower.png diff --git a/samples/flower.ta b/samples/flower.ta new file mode 100755 index 0000000..c4b9009 --- /dev/null +++ b/samples/flower.ta @@ -0,0 +1,288 @@ +(lp0 +(I0 +S'hat1' +p1 +I838 +I260 +(lp2 +NaI1 +atp3 +a(I1 +S'repeat' +p4 +I850 +I310 +(lp5 +I0 +aI2 +aI3 +aNatp6 +a(I2 +(S'number' +p7 +S'4' +p8 +tp9 +I936 +I319 +(lp10 +I1 +aNatp11 +a(I3 +S'forward' +p12 +I945 +I359 +(lp13 +I1 +aI4 +aI5 +atp14 +a(I4 +S'box1' +p15 +I1019 +I368 +(lp16 +I3 +aNatp17 +a(I5 +S'right' +p18 +I945 +I398 +(lp19 +I3 +aI6 +aNatp20 +a(I6 +(g7 +S'90' +p21 +tp22 +I1019 +I407 +(lp23 +I5 +aNatp24 +a(I7 +S'hat2' +p25 +I846 +I55 +(lp26 +NaI8 +atp27 +a(I8 +g4 +I858 +I105 +(lp28 +I7 +aI9 +aI10 +aNatp29 +a(I9 +(g7 +S'10' +p30 +tp31 +I944 +I114 +(lp32 +I8 +aNatp33 +a(I10 +S'stack1' +p34 +I953 +I154 +(lp35 +I8 +aI11 +atp36 +a(I11 +g18 +I953 +I193 +(lp37 +I10 +aI12 +aNatp38 +a(I12 +(g7 +S'36' +p39 +tp40 +I1027 +I202 +(lp41 +I11 +aNatp42 +a(I13 +S'storeinbox1' +p43 +I407 +I105 +(lp44 +NaI14 +aI15 +atp45 +a(I14 +(g7 +S'0' +p46 +tp47 +I481 +I122 +(lp48 +I13 +aNatp49 +a(I15 +g4 +I407 +I159 +(lp50 +I13 +aI16 +aI17 +aNatp51 +a(I16 +(g7 +S'300' +p52 +tp53 +I493 +I168 +(lp54 +I15 +aNatp55 +a(I17 +S'setshade' +p56 +I502 +I208 +(lp57 +I15 +aI18 +aI21 +atp58 +a(I18 +(g7 +S'100' +p59 +tp60 +I576 +I225 +(lp61 +I17 +aI19 +atp62 +a(I19 +S'minus' +p63 +I669 +I217 +(lp64 +I18 +aI20 +atp65 +a(I20 +g15 +I708 +I225 +(lp66 +I19 +aNatp67 +a(I21 +S'setcolor' +p68 +I502 +I262 +(lp69 +I17 +aI22 +aI25 +atp70 +a(I22 +g15 +I576 +I279 +(lp71 +I21 +aI23 +atp72 +a(I23 +S'division' +p73 +I669 +I271 +(lp74 +I22 +aI24 +atp75 +a(I24 +(g7 +S'3' +p76 +tp77 +I708 +I279 +(lp78 +I23 +aNatp79 +a(I25 +S'stack2' +p80 +I502 +I316 +(lp81 +I21 +aI26 +atp82 +a(I26 +g43 +I502 +I355 +(lp83 +I25 +aI27 +aNatp84 +a(I27 +g15 +I576 +I372 +(lp85 +I26 +aI28 +atp86 +a(I28 +S'plus' +p87 +I669 +I364 +(lp88 +I27 +aI29 +atp89 +a(I29 +(g7 +S'1' +p90 +tp91 +I708 +I372 +(lp92 +I28 +aNatp93 +a(I-1 +S'turtle' +p94 +F1.3812950783176348e-11 +F-7.4464878707658499e-11 +F0.0 +F99.333333333333329 +F1.0 +I5 +tp95 +a.
\ No newline at end of file diff --git a/samples/fountain.png b/samples/fountain.png Binary files differnew file mode 100755 index 0000000..df84227 --- /dev/null +++ b/samples/fountain.png diff --git a/samples/fountain.ta b/samples/fountain.ta new file mode 100755 index 0000000..8ed05ac --- /dev/null +++ b/samples/fountain.ta @@ -0,0 +1,419 @@ +(lp0 +(I0 +S'hat1' +p1 +I699 +I215 +(lp2 +NaI1 +atp3 +a(I1 +S'repeat' +p4 +I711 +I265 +(lp5 +I0 +aI2 +aI3 +aNatp6 +a(I2 +(S'number' +p7 +S'400' +p8 +tp9 +I797 +I274 +(lp10 +I1 +aNatp11 +a(I3 +S'storeinbox1' +p12 +I806 +I314 +(lp13 +I1 +aI4 +aI7 +atp14 +a(I4 +S'heading' +p15 +I880 +I331 +(lp16 +I3 +aI5 +atp17 +a(I5 +S'division' +p18 +I973 +I323 +(lp19 +I4 +aI6 +atp20 +a(I6 +(g7 +I2 +tp21 +I1012 +I331 +(lp22 +I5 +aNatp23 +a(I7 +S'storeinbox2' +p24 +I806 +I368 +(lp25 +I3 +aI8 +aI11 +atp26 +a(I8 +S'box1' +p27 +I880 +I385 +(lp28 +I7 +aI9 +atp29 +a(I9 +S'plus' +p30 +I973 +I377 +(lp31 +I8 +aI10 +atp32 +a(I10 +(g7 +I5 +tp33 +I1012 +I385 +(lp34 +I9 +aNatp35 +a(I11 +S'setcolor' +p36 +I806 +I422 +(lp37 +I7 +aI12 +aI15 +atp38 +a(I12 +S'random' +p39 +I880 +I420 +(lp40 +I11 +aI13 +aI14 +aNatp41 +a(I13 +g27 +I908 +I439 +(lp42 +I12 +aNatp43 +a(I14 +S'box2' +p44 +I1030 +I439 +(lp45 +I12 +aNatp46 +a(I15 +S'arc' +p47 +I806 +I476 +(lp48 +I11 +aI16 +aI17 +aI18 +atp49 +a(I16 +(g7 +I-40 +tp50 +I880 +I485 +(lp51 +I15 +aNatp52 +a(I17 +(g7 +I3000 +tp53 +I880 +I522 +(lp54 +I15 +aNatp55 +a(I18 +g47 +I806 +I552 +(lp56 +I15 +aI19 +aI20 +aI21 +atp57 +a(I19 +(g7 +I-40 +tp58 +I880 +I561 +(lp59 +I18 +aNatp60 +a(I20 +(g7 +I-3000 +tp61 +I880 +I598 +(lp62 +I18 +aNatp63 +a(I21 +S'right' +p64 +I806 +I628 +(lp65 +I18 +aI22 +aNatp66 +a(I22 +(g7 +S'.1' +p67 +tp68 +I880 +I637 +(lp69 +I21 +aNatp70 +a(I23 +S'fillscreen' +p71 +I377 +I213 +(lp72 +NaI24 +aI25 +aI26 +atp73 +a(I24 +(g7 +S'10' +p74 +tp75 +I451 +I222 +(lp76 +I23 +aNatp77 +a(I25 +(g7 +S'30' +p78 +tp79 +I451 +I259 +(lp80 +I23 +aNatp81 +a(I26 +S'setshade' +p82 +I377 +I289 +(lp83 +I23 +aI27 +aI28 +atp84 +a(I27 +(g7 +S'85' +p85 +tp86 +I451 +I306 +(lp87 +I26 +aNatp88 +a(I28 +S'setxy' +p89 +I377 +I343 +(lp90 +I26 +aI29 +aI30 +aI31 +atp91 +a(I29 +(g7 +S'-590' +p92 +tp93 +I451 +I352 +(lp94 +I28 +aNatp95 +a(I30 +(g7 +S'-500' +p96 +tp97 +I451 +I389 +(lp98 +I28 +aNatp99 +a(I31 +S'setpensize' +p100 +I377 +I419 +(lp101 +I28 +aI32 +aI33 +atp102 +a(I32 +(g7 +S'3' +p103 +tp104 +I451 +I436 +(lp105 +I31 +aNatp106 +a(I33 +g4 +I377 +I473 +(lp107 +I31 +aI34 +aI35 +aNatp108 +a(I34 +(g7 +S'6' +p109 +tp110 +I463 +I482 +(lp111 +I33 +aNatp112 +a(I35 +S'seth' +p113 +I472 +I522 +(lp114 +I33 +aI36 +aI37 +atp115 +a(I36 +(g7 +S'0' +p116 +tp117 +I546 +I531 +(lp118 +I35 +aNatp119 +a(I37 +S'stack1' +p120 +I472 +I561 +(lp121 +I35 +aI38 +atp122 +a(I38 +g89 +I472 +I600 +(lp123 +I37 +aI39 +aI42 +aNatp124 +a(I39 +S'xcor' +p125 +I546 +I609 +(lp126 +I38 +aI40 +atp127 +a(I40 +g30 +I639 +I601 +(lp128 +I39 +aI41 +atp129 +a(I41 +(g7 +S'200' +p130 +tp131 +I678 +I609 +(lp132 +I40 +aNatp133 +a(I42 +S'ycor' +p134 +I546 +I646 +(lp135 +I38 +aNatp136 +a(I-1 +S'turtle' +p137 +F609.99999999906686 +F-500.00000000254568 +F40.000000000009074 +I22 +F85.0 +F3.0 +tp138 +a.
\ No newline at end of file diff --git a/samples/rainbow.png b/samples/rainbow.png Binary files differnew file mode 100755 index 0000000..213b204 --- /dev/null +++ b/samples/rainbow.png diff --git a/samples/rainbow.ta b/samples/rainbow.ta new file mode 100755 index 0000000..7730a7a --- /dev/null +++ b/samples/rainbow.ta @@ -0,0 +1,194 @@ +(lp0 +(I0 +S'clean' +p1 +I350 +I334 +(lp2 +NaI1 +atp3 +a(I1 +S'setcolor' +p4 +I350 +I373 +(lp5 +I0 +aI2 +aI3 +atp6 +a(I2 +(S'number' +p7 +S'50' +p8 +tp9 +I424 +I390 +(lp10 +I1 +aNatp11 +a(I3 +S'setpensize' +p12 +I350 +I427 +(lp13 +I1 +aI4 +aI5 +atp14 +a(I4 +(g7 +S'15' +p15 +tp16 +I424 +I444 +(lp17 +I3 +aNatp18 +a(I5 +S'repeat' +p19 +I350 +I481 +(lp20 +I3 +aI6 +aI7 +aNatp21 +a(I6 +(g7 +I360 +tp22 +I436 +I490 +(lp23 +I5 +aNatp24 +a(I7 +g4 +I445 +I530 +(lp25 +I5 +aI8 +aI13 +atp26 +a(I8 +S'heading' +p27 +I519 +I547 +(lp28 +I7 +aI9 +atp29 +a(I9 +S'product' +p30 +I612 +I539 +(lp31 +I8 +aI10 +atp32 +a(I10 +(g7 +S'100' +p33 +tp34 +I651 +I547 +(lp35 +I9 +aI11 +atp36 +a(I11 +S'division' +p37 +I744 +I539 +(lp38 +I10 +aI12 +atp39 +a(I12 +(g7 +I360 +tp40 +I783 +I547 +(lp41 +I11 +aNatp42 +a(I13 +S'forward' +p43 +I445 +I584 +(lp44 +I7 +aI14 +aI15 +atp45 +a(I14 +(g7 +S'1000' +p46 +tp47 +I519 +I593 +(lp48 +I13 +aNatp49 +a(I15 +S'back' +p50 +I445 +I623 +(lp51 +I13 +aI16 +aI17 +atp52 +a(I16 +(g7 +S'1000' +p53 +tp54 +I519 +I632 +(lp55 +I15 +aNatp56 +a(I17 +S'right' +p57 +I445 +I662 +(lp58 +I15 +aI18 +aNatp59 +a(I18 +(g7 +I1 +tp60 +I519 +I671 +(lp61 +I17 +aNatp62 +a(I-1 +S'turtle' +p63 +F0.0 +F0.0 +F0.0 +F99.277777777777771 +I50 +F15.0 +tp64 +a.
\ No newline at end of file diff --git a/samples/redwisp.png b/samples/redwisp.png Binary files differnew file mode 100755 index 0000000..efd6aa6 --- /dev/null +++ b/samples/redwisp.png diff --git a/samples/redwisp.ta b/samples/redwisp.ta new file mode 100755 index 0000000..63667c7 --- /dev/null +++ b/samples/redwisp.ta @@ -0,0 +1,354 @@ +(lp0 +(I0 +S'hat1' +p1 +I870 +I142 +(lp2 +NaI1 +atp3 +a(I1 +S'repeat' +p4 +I882 +I192 +(lp5 +I0 +aI2 +aI3 +aI9 +atp6 +a(I2 +(S'number' +p7 +S'4' +p8 +tp9 +I968 +I201 +(lp10 +I1 +aNatp11 +a(I3 +S'arc' +p12 +I977 +I241 +(lp13 +I1 +aI4 +aI5 +aI6 +atp14 +a(I4 +(g7 +S'180' +p15 +tp16 +I1051 +I250 +(lp17 +I3 +aNatp18 +a(I5 +(g7 +S'75' +p19 +tp20 +I1051 +I287 +(lp21 +I3 +aNatp22 +a(I6 +g12 +I977 +I317 +(lp23 +I3 +aI7 +aI8 +aNatp24 +a(I7 +(g7 +S'-180' +p25 +tp26 +I1051 +I326 +(lp27 +I6 +aNatp28 +a(I8 +(g7 +S'75' +p29 +tp30 +I1051 +I363 +(lp31 +I6 +aNatp32 +a(I9 +S'vspace' +p33 +I882 +I282 +(lp34 +I1 +aI10 +atp35 +a(I10 +g33 +I882 +I351 +(lp36 +I9 +aI11 +atp37 +a(I11 +g4 +I882 +I420 +(lp38 +I10 +aI12 +aI13 +aI19 +atp39 +a(I12 +(g7 +g8 +tp40 +I968 +I429 +(lp41 +I11 +aNatp42 +a(I13 +g12 +I977 +I469 +(lp43 +I11 +aI14 +aI15 +aI16 +atp44 +a(I14 +(g7 +S'-180' +p45 +tp46 +I1051 +I478 +(lp47 +I13 +aNatp48 +a(I15 +(g7 +S'-75' +p49 +tp50 +I1051 +I515 +(lp51 +I13 +aNatp52 +a(I16 +g12 +I977 +I545 +(lp53 +I13 +aI17 +aI18 +aNatp54 +a(I17 +(g7 +S'180' +p55 +tp56 +I1051 +I554 +(lp57 +I16 +aNatp58 +a(I18 +(g7 +S'-75' +p59 +tp60 +I1051 +I591 +(lp61 +I16 +aNatp62 +a(I19 +g33 +I882 +I510 +(lp63 +I11 +aI20 +atp64 +a(I20 +g33 +I882 +I579 +(lp65 +I19 +aI21 +atp66 +a(I21 +S'right' +p67 +I882 +I648 +(lp68 +I20 +aI22 +aNatp69 +a(I22 +(g7 +S'1' +p70 +tp71 +I956 +I657 +(lp72 +I21 +aNatp73 +a(I23 +S'setpensize' +p74 +I351 +I344 +(lp75 +NaI24 +aI25 +atp76 +a(I24 +(g7 +S'15' +p77 +tp78 +I425 +I361 +(lp79 +I23 +aNatp80 +a(I25 +g4 +I351 +I398 +(lp81 +I23 +aI26 +aI27 +aNatp82 +a(I26 +(g7 +S'360' +p83 +tp84 +I437 +I407 +(lp85 +I25 +aNatp86 +a(I27 +S'storeinbox1' +p87 +I446 +I447 +(lp88 +I25 +aI28 +aI31 +atp89 +a(I28 +S'heading' +p90 +I520 +I464 +(lp91 +I27 +aI29 +atp92 +a(I29 +S'product' +p93 +I613 +I456 +(lp94 +I28 +aI30 +atp95 +a(I30 +(g7 +S'600' +p96 +tp97 +I652 +I464 +(lp98 +I29 +aNatp99 +a(I31 +S'setshade' +p100 +I446 +I501 +(lp101 +I27 +aI32 +aI35 +atp102 +a(I32 +S'box1' +p103 +I520 +I518 +(lp104 +I31 +aI33 +atp105 +a(I33 +S'division' +p106 +I613 +I510 +(lp107 +I32 +aI34 +atp108 +a(I34 +(g7 +S'360' +p109 +tp110 +I652 +I518 +(lp111 +I33 +aNatp112 +a(I35 +S'stack1' +p113 +I446 +I555 +(lp114 +I31 +aNatp115 +a(I-1 +S'turtle' +p116 +I557 +I373 +F0.0 +I0 +F0.66666666666662877 +F15.0 +tp117 +a.
\ No newline at end of file diff --git a/samples/reflections.png b/samples/reflections.png Binary files differnew file mode 100755 index 0000000..9bf48a4 --- /dev/null +++ b/samples/reflections.png diff --git a/samples/reflections.ta b/samples/reflections.ta new file mode 100755 index 0000000..a009075 --- /dev/null +++ b/samples/reflections.ta @@ -0,0 +1,298 @@ +(lp0 +(I0 +S'clean' +p1 +I689 +I106 +(lp2 +NaI1 +atp3 +a(I1 +S'setpensize' +p4 +I689 +I145 +(lp5 +I0 +aI2 +aI3 +atp6 +a(I2 +(S'number' +p7 +S'15' +p8 +tp9 +I763 +I162 +(lp10 +I1 +aNatp11 +a(I3 +S'storeinbox1' +p12 +I689 +I199 +(lp13 +I1 +aI4 +aI5 +atp14 +a(I4 +(g7 +S'6200' +p15 +tp16 +I763 +I216 +(lp17 +I3 +aNatp18 +a(I5 +S'repeat' +p19 +I689 +I253 +(lp20 +I3 +aI6 +aI7 +aNatp21 +a(I6 +(g7 +S'6200' +p22 +tp23 +I775 +I262 +(lp24 +I5 +aNatp25 +a(I7 +S'storeinbox2' +p26 +I784 +I302 +(lp27 +I5 +aI8 +aI11 +atp28 +a(I8 +S'box1' +p29 +I858 +I319 +(lp30 +I7 +aI9 +atp31 +a(I9 +S'division' +p32 +I951 +I311 +(lp33 +I8 +aI10 +atp34 +a(I10 +(g7 +S'50' +p35 +tp36 +I990 +I319 +(lp37 +I9 +aNatp38 +a(I11 +S'setshade' +p39 +I784 +I356 +(lp40 +I7 +aI12 +aI15 +atp41 +a(I12 +(g7 +S'100' +p42 +tp43 +I858 +I373 +(lp44 +I11 +aI13 +atp45 +a(I13 +S'minus' +p46 +I951 +I365 +(lp47 +I12 +aI14 +atp48 +a(I14 +S'box2' +p49 +I990 +I373 +(lp50 +I13 +aNatp51 +a(I15 +S'forward' +p52 +I784 +I410 +(lp53 +I11 +aI16 +aI19 +atp54 +a(I16 +g29 +I858 +I419 +(lp55 +I15 +aI17 +atp56 +a(I17 +g32 +I951 +I411 +(lp57 +I16 +aI18 +atp58 +a(I18 +(g7 +S'8' +p59 +tp60 +I990 +I419 +(lp61 +I17 +aNatp62 +a(I19 +S'back' +p63 +I784 +I449 +(lp64 +I15 +aI20 +aI23 +atp65 +a(I20 +g29 +I858 +I458 +(lp66 +I19 +aI21 +atp67 +a(I21 +g32 +I951 +I450 +(lp68 +I20 +aI22 +atp69 +a(I22 +(g7 +g59 +tp70 +I990 +I458 +(lp71 +I21 +aNatp72 +a(I23 +S'right' +p73 +I784 +I488 +(lp74 +I19 +aI24 +aI25 +atp75 +a(I24 +(g7 +S'1' +p76 +tp77 +I858 +I497 +(lp78 +I23 +aNatp79 +a(I25 +g12 +I784 +I527 +(lp80 +I23 +aI26 +aI29 +atp81 +a(I26 +g29 +I858 +I544 +(lp82 +I25 +aI27 +atp83 +a(I27 +g46 +I951 +I536 +(lp84 +I26 +aI28 +atp85 +a(I28 +(g7 +g76 +tp86 +I990 +I544 +(lp87 +I27 +aNatp88 +a(I29 +S'setcolor' +p89 +I784 +I581 +(lp90 +I25 +aI30 +aNatp91 +a(I30 +g29 +I858 +I598 +(lp92 +I29 +aNatp93 +a(I-1 +S'turtle' +p94 +I-584 +I-436 +I0 +F0.0 +F99.019999999999996 +F15.0 +tp95 +a.
\ No newline at end of file diff --git a/samples/shades.png b/samples/shades.png Binary files differnew file mode 100755 index 0000000..7e7e504 --- /dev/null +++ b/samples/shades.png diff --git a/samples/shades.ta b/samples/shades.ta new file mode 100755 index 0000000..90dd90f --- /dev/null +++ b/samples/shades.ta @@ -0,0 +1,194 @@ +(lp0 +(I0 +S'clean' +p1 +I410 +I108 +(lp2 +NaI1 +atp3 +a(I1 +S'setcolor' +p4 +I410 +I147 +(lp5 +I0 +aI2 +aI3 +atp6 +a(I2 +(S'number' +p7 +S'50' +p8 +tp9 +I484 +I164 +(lp10 +I1 +aNatp11 +a(I3 +S'setpensize' +p12 +I410 +I201 +(lp13 +I1 +aI4 +aI5 +atp14 +a(I4 +(g7 +S'15' +p15 +tp16 +I484 +I218 +(lp17 +I3 +aNatp18 +a(I5 +S'repeat' +p19 +I410 +I255 +(lp20 +I3 +aI6 +aI7 +aNatp21 +a(I6 +(g7 +I360 +tp22 +I496 +I264 +(lp23 +I5 +aNatp24 +a(I7 +S'setshade' +p25 +I505 +I304 +(lp26 +I5 +aI8 +aI13 +atp27 +a(I8 +S'heading' +p28 +I579 +I321 +(lp29 +I7 +aI9 +atp30 +a(I9 +S'product' +p31 +I672 +I313 +(lp32 +I8 +aI10 +atp33 +a(I10 +(g7 +I200 +tp34 +I711 +I321 +(lp35 +I9 +aI11 +atp36 +a(I11 +S'division' +p37 +I804 +I313 +(lp38 +I10 +aI12 +atp39 +a(I12 +(g7 +I360 +tp40 +I843 +I321 +(lp41 +I11 +aNatp42 +a(I13 +S'forward' +p43 +I505 +I358 +(lp44 +I7 +aI14 +aI15 +atp45 +a(I14 +(g7 +S'1000' +p46 +tp47 +I579 +I367 +(lp48 +I13 +aNatp49 +a(I15 +S'back' +p50 +I505 +I397 +(lp51 +I13 +aI16 +aI17 +atp52 +a(I16 +(g7 +S'1000' +p53 +tp54 +I579 +I406 +(lp55 +I15 +aNatp56 +a(I17 +S'right' +p57 +I505 +I436 +(lp58 +I15 +aI18 +aNatp59 +a(I18 +(g7 +I1 +tp60 +I579 +I445 +(lp61 +I17 +aNatp62 +a(I-1 +S'turtle' +p63 +F0.0 +F0.0 +F0.0 +F50.0 +F-0.44444444444445708 +F15.0 +tp64 +a.
\ No newline at end of file diff --git a/samples/smoothcandy.png b/samples/smoothcandy.png Binary files differnew file mode 100755 index 0000000..8929d50 --- /dev/null +++ b/samples/smoothcandy.png diff --git a/samples/smoothcandy.ta b/samples/smoothcandy.ta new file mode 100755 index 0000000..5b424e6 --- /dev/null +++ b/samples/smoothcandy.ta @@ -0,0 +1,243 @@ +(lp0 +(I0 +S'clean' +p1 +I181 +I407 +(lp2 +NaI1 +atp3 +a(I1 +S'repeat' +p4 +I181 +I446 +(lp5 +I0 +aI2 +aI3 +aNatp6 +a(I2 +(S'number' +p7 +I350 +tp8 +I267 +I455 +(lp9 +I1 +aNatp10 +a(I3 +S'setpensize' +p11 +I276 +I495 +(lp12 +I1 +aI4 +aI7 +atp13 +a(I4 +S'heading' +p14 +I350 +I512 +(lp15 +I3 +aI5 +atp16 +a(I5 +S'plus' +p17 +I443 +I504 +(lp18 +I4 +aI6 +atp19 +a(I6 +(g7 +I4 +tp20 +I482 +I512 +(lp21 +I5 +aNatp22 +a(I7 +S'forward' +p23 +I276 +I549 +(lp24 +I3 +aI8 +aI9 +atp25 +a(I8 +(g7 +S'1000' +p26 +tp27 +I350 +I558 +(lp28 +I7 +aNatp29 +a(I9 +S'setcolor' +p30 +I276 +I588 +(lp31 +I7 +aI10 +aI13 +atp32 +a(I10 +g14 +I350 +I605 +(lp33 +I9 +aI11 +atp34 +a(I11 +S'division' +p35 +I443 +I597 +(lp36 +I10 +aI12 +atp37 +a(I12 +(g7 +I3 +tp38 +I482 +I605 +(lp39 +I11 +aNatp40 +a(I13 +S'storeinbox1' +p41 +I276 +I642 +(lp42 +I9 +aI14 +aI17 +atp43 +a(I14 +g14 +I350 +I659 +(lp44 +I13 +aI15 +atp45 +a(I15 +g35 +I443 +I651 +(lp46 +I14 +aI16 +atp47 +a(I16 +(g7 +I2 +tp48 +I482 +I659 +(lp49 +I15 +aNatp50 +a(I17 +S'setshade' +p51 +I276 +I696 +(lp52 +I13 +aI18 +aI21 +atp53 +a(I18 +(g7 +I100 +tp54 +I350 +I713 +(lp55 +I17 +aI19 +atp56 +a(I19 +S'minus' +p57 +I443 +I705 +(lp58 +I18 +aI20 +atp59 +a(I20 +S'box1' +p60 +I482 +I713 +(lp61 +I19 +aNatp62 +a(I21 +S'back' +p63 +I276 +I750 +(lp64 +I17 +aI22 +aI23 +atp65 +a(I22 +(g7 +S'1000' +p66 +tp67 +I350 +I759 +(lp68 +I21 +aNatp69 +a(I23 +S'left' +p70 +I276 +I789 +(lp71 +I21 +aI24 +aNatp72 +a(I24 +(g7 +I1 +tp73 +I350 +I798 +(lp74 +I23 +aNatp75 +a(I-1 +S'turtle' +p76 +F0.0 +F0.0 +F10.0 +F3.6666666666666665 +F94.5 +F15.0 +tp77 +a.
\ No newline at end of file diff --git a/samples/square.png b/samples/square.png Binary files differnew file mode 100755 index 0000000..91d4509 --- /dev/null +++ b/samples/square.png diff --git a/samples/square.ta b/samples/square.ta new file mode 100755 index 0000000..7cc3252 --- /dev/null +++ b/samples/square.ta @@ -0,0 +1,68 @@ +(lp0 +(I0 +S'repeat' +p1 +I853 +I277 +(lp2 +NaI1 +aI2 +aNatp3 +a(I1 +(S'number' +p4 +I4 +tp5 +I939 +I286 +(lp6 +I0 +aNatp7 +a(I2 +S'forward' +p8 +I948 +I326 +(lp9 +I0 +aI3 +aI4 +atp10 +a(I3 +(g4 +I200 +tp11 +I1022 +I335 +(lp12 +I2 +aNatp13 +a(I4 +S'right' +p14 +I948 +I365 +(lp15 +I2 +aI5 +aNatp16 +a(I5 +(g4 +I90 +tp17 +I1022 +I374 +(lp18 +I4 +aNatp19 +a(I-1 +S'turtle' +p20 +F2.8421709430404007e-14 +F-3.6738190614671318e-14 +F0.0 +I0 +I50 +I5 +tp21 +a.
\ No newline at end of file diff --git a/samples/squares.png b/samples/squares.png Binary files differnew file mode 100755 index 0000000..94d9461 --- /dev/null +++ b/samples/squares.png diff --git a/samples/squares.ta b/samples/squares.ta new file mode 100755 index 0000000..e309231 --- /dev/null +++ b/samples/squares.ta @@ -0,0 +1,114 @@ +(lp0 +(I0 +S'repeat' +p1 +I762 +I95 +(lp2 +NaI1 +aI2 +aNatp3 +a(I1 +(S'number' +p4 +I36 +tp5 +I848 +I104 +(lp6 +I0 +aNatp7 +a(I2 +g1 +I857 +I144 +(lp8 +I0 +aI3 +aI4 +aI8 +atp9 +a(I3 +(g4 +I4 +tp10 +I943 +I153 +(lp11 +I2 +aNatp12 +a(I4 +S'forward' +p13 +I952 +I193 +(lp14 +I2 +aI5 +aI6 +atp15 +a(I5 +(g4 +S'300' +p16 +tp17 +I1026 +I202 +(lp18 +I4 +aNatp19 +a(I6 +S'right' +p20 +I952 +I232 +(lp21 +I4 +aI7 +aNatp22 +a(I7 +(g4 +I90 +tp23 +I1026 +I241 +(lp24 +I6 +aNatp25 +a(I8 +S'vspace' +p26 +I857 +I234 +(lp27 +I2 +aI9 +atp28 +a(I9 +g20 +I857 +I303 +(lp29 +I8 +aI10 +aNatp30 +a(I10 +(g4 +I10 +tp31 +I931 +I312 +(lp32 +I9 +aNatp33 +a(I-1 +S'turtle' +p34 +F-2.8421709430404007e-13 +F-1.0587086762825493e-12 +F0.0 +I0 +I50 +I5 +tp35 +a.
\ No newline at end of file diff --git a/samples/squiral.png b/samples/squiral.png Binary files differnew file mode 100755 index 0000000..899b2ac --- /dev/null +++ b/samples/squiral.png diff --git a/samples/squiral.ta b/samples/squiral.ta new file mode 100755 index 0000000..2881645 --- /dev/null +++ b/samples/squiral.ta @@ -0,0 +1,131 @@ +(lp0 +(I0 +S'clean' +p1 +I714 +I181 +(lp2 +NaI1 +atp3 +a(I1 +S'storeinbox1' +p4 +I714 +I220 +(lp5 +I0 +aI2 +aI3 +atp6 +a(I2 +(S'number' +p7 +I0 +tp8 +I788 +I237 +(lp9 +I1 +aNatp10 +a(I3 +S'repeat' +p11 +I714 +I274 +(lp12 +I1 +aI4 +aI5 +aNatp13 +a(I4 +(g7 +S'300' +p14 +tp15 +I800 +I283 +(lp16 +I3 +aNatp17 +a(I5 +S'forward' +p18 +I809 +I323 +(lp19 +I3 +aI6 +aI7 +atp20 +a(I6 +S'box1' +p21 +I883 +I332 +(lp22 +I5 +aNatp23 +a(I7 +S'right' +p24 +I809 +I362 +(lp25 +I5 +aI8 +aI9 +atp26 +a(I8 +(g7 +I91 +tp27 +I883 +I371 +(lp28 +I7 +aNatp29 +a(I9 +g4 +I809 +I401 +(lp30 +I7 +aI10 +aNatp31 +a(I10 +g21 +I883 +I418 +(lp32 +I9 +aI11 +atp33 +a(I11 +S'plus' +p34 +I976 +I410 +(lp35 +I10 +aI12 +atp36 +a(I12 +(g7 +I5 +tp37 +I1015 +I418 +(lp38 +I11 +aNatp39 +a(I-1 +S'turtle' +p40 +F278.8796530912756 +F-1014.5091542600603 +F300.0 +I0 +I50 +I5 +tp41 +a.
\ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..ec0f64e --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python +from sugar.activity import bundlebuilder +bundlebuilder.start() diff --git a/shapes/t0.gif b/shapes/t0.gif Binary files differnew file mode 100755 index 0000000..7e934f5 --- /dev/null +++ b/shapes/t0.gif diff --git a/shapes/t1.gif b/shapes/t1.gif Binary files differnew file mode 100755 index 0000000..8b9b24c --- /dev/null +++ b/shapes/t1.gif diff --git a/shapes/t10.gif b/shapes/t10.gif Binary files differnew file mode 100755 index 0000000..5b1ff5a --- /dev/null +++ b/shapes/t10.gif diff --git a/shapes/t11.gif b/shapes/t11.gif Binary files differnew file mode 100755 index 0000000..bebbf07 --- /dev/null +++ b/shapes/t11.gif diff --git a/shapes/t12.gif b/shapes/t12.gif Binary files differnew file mode 100755 index 0000000..6e32168 --- /dev/null +++ b/shapes/t12.gif diff --git a/shapes/t13.gif b/shapes/t13.gif Binary files differnew file mode 100755 index 0000000..5b2b8a2 --- /dev/null +++ b/shapes/t13.gif diff --git a/shapes/t14.gif b/shapes/t14.gif Binary files differnew file mode 100755 index 0000000..11b5e96 --- /dev/null +++ b/shapes/t14.gif diff --git a/shapes/t15.gif b/shapes/t15.gif Binary files differnew file mode 100755 index 0000000..9093f91 --- /dev/null +++ b/shapes/t15.gif diff --git a/shapes/t16.gif b/shapes/t16.gif Binary files differnew file mode 100755 index 0000000..682748e --- /dev/null +++ b/shapes/t16.gif diff --git a/shapes/t17.gif b/shapes/t17.gif Binary files differnew file mode 100755 index 0000000..a9e9897 --- /dev/null +++ b/shapes/t17.gif diff --git a/shapes/t18.gif b/shapes/t18.gif Binary files differnew file mode 100755 index 0000000..52707a0 --- /dev/null +++ b/shapes/t18.gif diff --git a/shapes/t19.gif b/shapes/t19.gif Binary files differnew file mode 100755 index 0000000..0cd7398 --- /dev/null +++ b/shapes/t19.gif diff --git a/shapes/t2.gif b/shapes/t2.gif Binary files differnew file mode 100755 index 0000000..2d74126 --- /dev/null +++ b/shapes/t2.gif diff --git a/shapes/t20.gif b/shapes/t20.gif Binary files differnew file mode 100755 index 0000000..0760f09 --- /dev/null +++ b/shapes/t20.gif diff --git a/shapes/t21.gif b/shapes/t21.gif Binary files differnew file mode 100755 index 0000000..5861197 --- /dev/null +++ b/shapes/t21.gif diff --git a/shapes/t22.gif b/shapes/t22.gif Binary files differnew file mode 100755 index 0000000..271a3e4 --- /dev/null +++ b/shapes/t22.gif diff --git a/shapes/t23.gif b/shapes/t23.gif Binary files differnew file mode 100755 index 0000000..be44c53 --- /dev/null +++ b/shapes/t23.gif diff --git a/shapes/t24.gif b/shapes/t24.gif Binary files differnew file mode 100755 index 0000000..a00417e --- /dev/null +++ b/shapes/t24.gif diff --git a/shapes/t25.gif b/shapes/t25.gif Binary files differnew file mode 100755 index 0000000..8dda1ce --- /dev/null +++ b/shapes/t25.gif diff --git a/shapes/t26.gif b/shapes/t26.gif Binary files differnew file mode 100755 index 0000000..24be0da --- /dev/null +++ b/shapes/t26.gif diff --git a/shapes/t27.gif b/shapes/t27.gif Binary files differnew file mode 100755 index 0000000..24e9670 --- /dev/null +++ b/shapes/t27.gif diff --git a/shapes/t28.gif b/shapes/t28.gif Binary files differnew file mode 100755 index 0000000..9364fe3 --- /dev/null +++ b/shapes/t28.gif diff --git a/shapes/t29.gif b/shapes/t29.gif Binary files differnew file mode 100755 index 0000000..c75cba8 --- /dev/null +++ b/shapes/t29.gif diff --git a/shapes/t3.gif b/shapes/t3.gif Binary files differnew file mode 100755 index 0000000..f2fcece --- /dev/null +++ b/shapes/t3.gif diff --git a/shapes/t30.gif b/shapes/t30.gif Binary files differnew file mode 100755 index 0000000..4f51b9f --- /dev/null +++ b/shapes/t30.gif diff --git a/shapes/t31.gif b/shapes/t31.gif Binary files differnew file mode 100755 index 0000000..b081f2a --- /dev/null +++ b/shapes/t31.gif diff --git a/shapes/t32.gif b/shapes/t32.gif Binary files differnew file mode 100755 index 0000000..9c7c8a1 --- /dev/null +++ b/shapes/t32.gif diff --git a/shapes/t33.gif b/shapes/t33.gif Binary files differnew file mode 100755 index 0000000..dcfbe2e --- /dev/null +++ b/shapes/t33.gif diff --git a/shapes/t34.gif b/shapes/t34.gif Binary files differnew file mode 100755 index 0000000..3fe38ca --- /dev/null +++ b/shapes/t34.gif diff --git a/shapes/t35.gif b/shapes/t35.gif Binary files differnew file mode 100755 index 0000000..94ad89c --- /dev/null +++ b/shapes/t35.gif diff --git a/shapes/t4.gif b/shapes/t4.gif Binary files differnew file mode 100755 index 0000000..efb878a --- /dev/null +++ b/shapes/t4.gif diff --git a/shapes/t5.gif b/shapes/t5.gif Binary files differnew file mode 100755 index 0000000..f56e835 --- /dev/null +++ b/shapes/t5.gif diff --git a/shapes/t6.gif b/shapes/t6.gif Binary files differnew file mode 100755 index 0000000..35d038d --- /dev/null +++ b/shapes/t6.gif diff --git a/shapes/t7.gif b/shapes/t7.gif Binary files differnew file mode 100755 index 0000000..907930b --- /dev/null +++ b/shapes/t7.gif diff --git a/shapes/t8.gif b/shapes/t8.gif Binary files differnew file mode 100755 index 0000000..95ed9a6 --- /dev/null +++ b/shapes/t8.gif diff --git a/shapes/t9.gif b/shapes/t9.gif Binary files differnew file mode 100755 index 0000000..c6d7c19 --- /dev/null +++ b/shapes/t9.gif diff --git a/sprites.py b/sprites.py new file mode 100755 index 0000000..245bac3 --- /dev/null +++ b/sprites.py @@ -0,0 +1,120 @@ +import pygtk
+pygtk.require('2.0')
+import gtk
+import gobject
+import pango
+
+sprites = []
+gc = None
+window = None
+black = None
+
+class Sprite:
+ def __init__(self,x,y,image,altlabel=False):
+ self.x = x
+ self.y = y
+ self.setimage(image)
+ self.label = None
+ if altlabel: self.draw_label = self.draw_label2
+ else: self.draw_label = self.draw_label1
+
+ def setimage(self,image):
+ self.image = image
+ if isinstance(image,gtk.gdk.Pixbuf):
+ self.width = self.image.get_width()
+ self.height = self.image.get_height()
+ else: self.width,self.height=image.get_size()
+
+
+ def move(self,pos):
+ self.inval()
+ self.x,self.y = pos
+ self.inval()
+
+ def setshape(self,image):
+ self.inval()
+ self.setimage(image)
+ self.inval()
+
+ def setlayer(self, layer):
+ if self in sprites: sprites.remove(self)
+ self.layer = layer
+ for i in range(len(sprites)):
+ if layer < sprites[i].layer: sprites.insert(i, self); self.inval(); return
+ sprites.append(self)
+ self.inval()
+
+ def hide(self):
+ if self not in sprites: return
+ self.inval()
+ sprites.remove(self)
+
+ def setlabel(self,label):
+ self.label = label
+ self.inval()
+
+ def inval(self):
+ area.invalidate_rect(gtk.gdk.Rectangle(self.x,self.y,self.width,self.height), False)
+
+ def draw(self):
+ if isinstance(self.image,gtk.gdk.Pixbuf): area.draw_pixbuf(gc, self.image, 0, 0, self.x, self.y)
+ else: area.draw_drawable(gc,self.image,0,0,self.x,self.y,-1,-1)
+ if self.label!=None: self.draw_label(self.label)
+
+ def hit(self,pos):
+ x,y = pos
+ if x<self.x: return False
+ if x>self.x+self.width: return False
+ if y<self.y: return False
+ if y>self.y+self.height: return False
+ if isinstance(self.image,gtk.gdk.Pixmap): return True
+ dx,dy = x-self.x, y-self.y
+ return ord(self.image.get_pixels()[(dy*self.width+dx)*4+3]) == 255
+
+ def draw_label1(self, label):
+ fd = pango.FontDescription('Sans')
+ fd.set_size(7*pango.SCALE)
+ pl = window.create_pango_layout(str(label))
+ pl.set_font_description(fd)
+ swidth = pl.get_size()[0]/pango.SCALE
+ sheight = pl.get_size()[1]/pango.SCALE
+ centerx = self.x+self.width/2
+ centery = self.y+self.height/2
+ gc.set_foreground(black)
+ area.draw_layout(gc,centerx-swidth/2,centery-sheight/2,pl)
+
+ def draw_label2(self, label):
+ fd = pango.FontDescription('Sans')
+ fd.set_size(9*pango.SCALE)
+ pl = window.create_pango_layout(str(label))
+ pl.set_font_description(fd)
+ sheight = pl.get_size()[1]/pango.SCALE
+ centery = self.y+self.height/2
+ gc.set_foreground(black)
+ area.draw_layout(gc,self.x+50,centery-sheight/2,pl)
+
+
+def findsprite(pos):
+ list = sprites[:]
+ list.reverse()
+ for s in list:
+ if s.hit(pos): return s
+ return None
+
+def redrawsprites():
+ for s in sprites: s.draw()
+
+def getpixel(image,x,y):
+ array = image.get_pixels()
+ offset = (y*image.get_width()+x)*4
+ r,g,b,a = ord(array[offset]),ord(array[offset+1]),ord(array[offset+2]),ord(array[offset+3])
+ return (a<<24)+(b<<16)+(g<<8)+r
+
+def setspritecontext(w,a,g):
+ global window,area,gc,black
+ window=w
+ area =a
+ gc = g
+ black = gc.get_colormap().alloc_color('black')
+
+def spritelist(): return sprites
\ No newline at end of file diff --git a/status.gif b/status.gif Binary files differnew file mode 100755 index 0000000..376a5a9 --- /dev/null +++ b/status.gif @@ -0,0 +1,554 @@ +import pygtk +pygtk.require('2.0') +import gtk +import gobject +import os +import os.path +import pickle +from math import atan2, pi + +from sprites import * +from turtlesetup import * +import logo +import turtle + +WIDTH=1200 +HEIGHT=900 + +DEGTOR = 2*pi/360 + +gc = None +area = None +draggroup = None +dragpos = (0,0) +current_category = None +category_spr = None +bgcolor = None +block_operation = None +selected_block = None +select_mask = None +firstkey = False +turtlecanvas = None +status_spr = None +turtle_spr = None +hidden_palette_icon = None +selbuttons = None +project_flap = None + +load_save_folder = None +save_file_name = None + +# +# Button Press +# + +def buttonpress_cb(win, event): + global draggroup, dragpos, block_operation, selected_block + block_operation = 'click' + if selected_block!=None: unselect() + status_spr.setlayer(400) + pos = xy(event) + x,y = pos + spr = findsprite(pos) + if spr==None: return True + if spr.type == 'selbutton': + select_category(spr) + elif spr.type == 'tool': + tooldispatch(spr) + elif spr.type == 'category': + block_selector_pressed(x,y) + elif spr.type == 'block': + block_pressed(event,x,y,spr) + elif spr.type == 'turtle': + turtle_pressed(x,y) + elif spr.type == 'project_flap': + project_flap_pressed(spr,x,y) + return True + +def block_pressed(event,x,y,spr): + global draggroup, dragpos, block_operation + dragpos = x-spr.x,y-spr.y + draggroup = findgroup(spr) + for b in draggroup: + b.setlayer(2000) + disconnect(spr) + +def turtle_pressed(x,y): + global draggroup, dragpos, block_operation + dx,dy = x-turtle_spr.x-30,y-turtle_spr.y-30 + if dx*dx+dy*dy > 200: dragpos = ('turn', turtle.heading-atan2(dy,dx)/DEGTOR,0) + else: dragpos = ('move', x-turtle_spr.x,y-turtle_spr.y) + draggroup = [turtle_spr] + +def block_selector_pressed(x,y): + if category_spr.image==hidden_palette_icon: + for i in selbuttons: i.setlayer(800) + select_category(selbuttons[0]) + else: + proto = get_proto_from_category(x,y) + if proto==None: return + if proto!='hide': new_block_from_category(proto,x,y) + else: + for i in selbuttons: i.hide() + category_spr.setshape(hidden_palette_icon) + + +def new_block_from_category(proto,x,y): + global draggroup, dragpos, block_operation + block_operation = 'new' + if proto == None: return True + newspr = Sprite(x-20,y-20,proto.image) + newspr.setlayer(2000) + dragpos = 20,20 + newspr.type = 'block' + newspr.proto = proto + if newspr.proto.name == 'number': newspr.label=100 + newspr.connections = [None]*len(proto.docks) + for i in range(len(proto.defaults)): + dock = proto.docks[i+1] + numproto = blockproto('number') + numdock = numproto.docks[0] + nx,ny = newspr.x+dock[2]-numdock[2],newspr.y+dock[3]-numdock[3] + argspr = Sprite(nx,ny,numproto.image) + argspr.type = 'block' + argspr.proto = numproto + argspr.label = str(proto.defaults[i]) + argspr.setlayer(2000) + argspr.connections = [newspr,None] + newspr.connections[i+1] = argspr + draggroup = findgroup(newspr) + +def get_proto_from_category(x,y): +# if current_category.mask == None: return current_category.blockprotos[(y-100)/30] + dx,dy = x-category_spr.x, y-category_spr.y, + pixel = getpixel(current_category.mask,dx,dy) + index = ((pixel%256)>>3)-1 +# print hex(pixel),index + if index==0: return 'hide' + index-=1 + if index>len(current_category.blockprotos): return None + return current_category.blockprotos[index] + +def select_category(spr): + global current_category + if current_category != None: + current_category.setshape(current_category.offshape) + spr.setshape(spr.onshape) + current_category = spr + category_spr.setshape(spr.group) + +# +# Mouse move +# + +def move_cb(win, event): + global block_operation + if draggroup == None: return True + block_operation = 'move' + spr = draggroup[0] + x,y = xy(event) + if spr.type=='block': + dragx, dragy = dragpos + dx,dy = x-dragx-spr.x,y-dragy-spr.y + for b in draggroup: + b.move((b.x+dx, b.y+dy)) + elif spr.type=='turtle': + type,dragx,dragy = dragpos + if type == 'move': + dx,dy = x-dragx-spr.x,y-dragy-spr.y + spr.move((spr.x+dx, spr.y+dy)) + else: + dx,dy = x-spr.x-30,y-spr.y-30 + turtle.seth(int(dragx+atan2(dy,dx)/DEGTOR+5)/10*10) + return True + + +# +# Button release +# + +def buttonrelease_cb(win, event): + global draggroup, selected_block,firstkey + if draggroup == None: return True + spr = draggroup[0] + x,y = xy(event) + if spr.type == 'turtle': + turtle.xcor = turtle_spr.x-turtlecanvas.x-turtle.width/2+30 + turtle.ycor = turtle.height/2-turtle_spr.y+turtlecanvas.y-30 + turtle.move_turtle() + draggroup = None + return True + if block_operation=='move' and category_spr.hit((x,y)): + for b in draggroup: b.hide() + draggroup = None + return True + snap_to_dock(draggroup) + for b in draggroup: b.setlayer(650) + draggroup = None + if block_operation=='click': + if spr.proto.name=='number': + selected_block = spr + select_mask.move((spr.x-6,spr.y-6)) + select_mask.setlayer(660) + firstkey = True + else: run_stack(spr) + return True + +def snap_to_dock(group): + d=200 + me = draggroup[0] + for mydockn in range(len(me.proto.docks)): + for you in blocks(): + if you in group: continue + for yourdockn in range(len(you.proto.docks)): + thisxy = dock_dx_dy(you,yourdockn,me,mydockn) + if magnitude(thisxy)>d: continue + d=magnitude(thisxy) + bestxy=thisxy + bestyou=you + bestyourdockn=yourdockn + bestmydockn=mydockn + if d<200: + for b in group: b.move((b.x+bestxy[0],b.y+bestxy[1])) + me.connections[bestmydockn]=bestyou + bestyou.connections[bestyourdockn]=me + +def dock_dx_dy(block1,dock1n,block2,dock2n): + if block1.connections[dock1n] != None: return (100,100) + if block2.connections[dock2n] != None: return (100,100) + dock1 = block1.proto.docks[dock1n] + dock2 = block2.proto.docks[dock2n] + d1type,d1dir,d1x,d1y=dock1[0:4] + d2type,d2dir,d2x,d2y=dock2[0:4] + if block1==block2: return (100,100) + if d1type!=d2type: return (100,100) + if d1dir==d2dir: return (100,100) + return (block1.x+d1x)-(block2.x+d2x),(block1.y+d1y)-(block2.y+d2y) + + +# +# Repaint +# + +def expose_cb(win, event): +# gc.set_foreground(bgcolor) +# area.draw_rectangle(gc, True, category_spr.x, 0, category_spr.width, HEIGHT) +# area.draw_rectangle(gc, True, 100, 100, 100, 100) + + redrawsprites() + return True + + +# +# Keyboard, new, load, save +# + +def keypress_cb(area, event): + global firstkey + keyname = gtk.gdk.keyval_name(event.keyval) +# print keyname + if (event.get_state()>k.gdk.CONTROL_MASK): + if keyname=="n": new_project() + elif keyname=="o": load_file() + elif keyname=="s": save_file() + elif keyname=="c": turtle.clearscreen() + return True + if selected_block==None: return True + keyname = gtk.gdk.keyval_name(event.keyval) + if keyname in ['minus', 'period']: keyname = {'minus': '-', 'period': '.'}[keyname] + if len(keyname)>1: return True + oldnum = selected_block.label + if firstkey: newnum = numcheck(keyname,'0') + else: newnum = oldnum+keyname + selected_block.setlabel(numcheck(newnum,oldnum)) + firstkey = False + return True + +def numcheck(new, old): + if new in ['-', '.', '-.']: return new + if new=='.': return '0.' + try: float(new); return new + except ValueError,e : return old + +def unselect(): + global selected_block + if selected_block.label in ['-', '.', '-.']: select_block.setlabel('0') + select_mask.hide() + selected_block = None + +def new_project(): + global save_file_name + for b in blocks(): b.hide() + turtlecanvas.setlayer(600) + toolsprite('hideshow').setshape(toolsprs['hideshow'].offshape) + turtle.clearscreen() + save_file_name = None + +def load_file(): + global save_file_name + fname = get_load_name() + if fname==None: return + if fname[-3:]=='.ta': fname=fname[0:-3] + f = open(fname+'.ta',"rU") + data = pickle.load(f) + f.close() + new_project() + read_data(data) + if os.access(fname+'.png', os.F_OK): load_pict(fname+'.png') + turtlecanvas.inval() + save_file_name = os.path.basename(fname) + +def get_load_name(): + dialog = gtk.FileChooserDialog("Load...", None, + gtk.FILE_CHOOSER_ACTION_OPEN, + (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK)) + dialog.set_default_response(gtk.RESPONSE_OK) + return do_dialog(dialog) + +def read_data(data): + blocks = [] + for b in data: + if b[1]=='turtle': load_turtle(b) + else: spr = load_spr(b); blocks.append(spr) + for i in range(len(blocks)): + cons=[] + for c in data[i][4]: + if c==None: cons.append(None) + else: cons.append(blocks[c]) + blocks[i].connections = cons + +def load_spr(b): + btype, label = b[1],None + if type(btype)==type((1,2)): btype, label = btype + proto = blockproto(btype) + spr = Sprite(b[2]+turtlecanvas.x,b[3]+turtlecanvas.y, proto.image) + spr.type = 'block' + spr.proto = proto + if label!=None: spr.label=label + spr.setlayer(650) + return spr + +def load_turtle(b): + id, name, xcor, ycor, heading, color, shade, pensize = b + turtle.setxy(xcor, ycor) + turtle.seth(heading) + turtle.setcolor(color) + turtle.setshade(shade) + turtle.setpensize(pensize) + +def load_pict(fname): + pict = gtk.gdk.pixbuf_new_from_file(fname) + turtlecanvas.image.draw_pixbuf(gc, pict, 0, 0, 0, 0) + +def save_file(): + global save_file_name + fname = get_save_name() + if fname==None: return + if fname[-3:]=='.ta': fname=fname[0:-3] + save_data(fname) + save_pict(fname) + save_file_name = os.path.basename(fname) + +def get_save_name(): + dialog = gtk.FileChooserDialog("Save..", None, + gtk.FILE_CHOOSER_ACTION_SAVE, + (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_SAVE, gtk.RESPONSE_OK)) + dialog.set_default_response(gtk.RESPONSE_OK) + if save_file_name!=None: dialog.set_current_name(save_file_name+'.ta') + return do_dialog(dialog) + +def save_data(fname): + f = file(fname+".ta", "w") + bs = blocks() + data = [] + for i in range(len(bs)): bs[i].id=i + for b in bs: + name = b.proto.name + if name=='number': name=(name,b.label) + connections = [get_id(x) for x in b.connections] + data.append((b.id,name,b.x-turtlecanvas.x,b.y-turtlecanvas.y,connections)) + data.append((-1,'turtle', + turtle.xcor,turtle.ycor,turtle.heading, + turtle.color,turtle.shade,turtle.pensize)) + pickle.dump(data,f) + f.close() + +def save_pict(fname): + tc = turtlecanvas + pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, tc.width, tc.height) + pixbuf.get_from_drawable(tc.image, tc.image.get_colormap(), 0, 0, 0, 0, tc.width, tc.height) + pixbuf.save(fname+'.png', 'png') + +def get_id(x): + if x==None: return None + return x.id + +def do_dialog(dialog): + global load_save_folder + result = None + filter = gtk.FileFilter() + filter.add_pattern("*.ta") + filter.set_name("Turtle Art") + dialog.add_filter(filter) + dialog.set_current_folder(load_save_folder) + response = dialog.run() + if response == gtk.RESPONSE_OK: + result = dialog.get_filename() + load_save_folder = dialog.get_current_folder() + dialog.destroy() + return result + + +# +# Block utilities +# + +def run_stack(spr): + top = find_top_block(spr) + logo.run_blocks(top, blocks()) + gobject.idle_add(logo.doevalstep) + + +def disconnect(b): + if b.connections[0]==None: return + b2=b.connections[0] + b2.connections[b2.connections.index(b)] = None + b.connections[0] = None + + +def findgroup(b): + group=[b] + for b2 in b.connections[1:]: + if b2!=None: group.extend(findgroup(b2)) + return group + +def find_top_block(spr): + while spr.connections[0]!=None: spr=spr.connections[0] + return spr + +def magnitude(pos): + x,y = pos + return x*x+y*y + +def xy(event): return map(int, event.get_coords()) +def blocks(): return [spr for spr in spritelist() if spr.type == 'block'] + + +# +# Toolbar +# + +def tooldispatch(spr): + if spr.blocktype == 'new': runtool(spr,new_project) + elif spr.blocktype == 'open': runtool(spr,load_file) + elif spr.blocktype == 'save': runtool(spr,save_file) + elif spr.blocktype == 'hideshow': hideshow_blocks(spr) + elif spr.blocktype == 'eraser': runtool(spr,turtle.clearscreen) + elif spr.blocktype == 'stopit': logo.step = just_stop() + +def just_stop(): yield False + +def runtool(spr,cmd): + spr.setshape(spr.onshape) + cmd() + gobject.timeout_add(250,spr.setshape,spr.offshape) + +def hideshow_blocks(spr): + if spr.image==spr.offshape: + for b in blocks(): b.setlayer(100) + spr.setshape(spr.onshape) + else: + for b in blocks(): b.setlayer(650) + spr.setshape(spr.offshape) + turtlecanvas.inval() + + +def project_flap_pressed(spr,x,y): + if spr.image==project_flap['closed']: spr.setshape(project_flap['open']) + else: + dx,dy = x-spr.x, y-spr.y, + pixel = getpixel(project_flap['mask'],dx,dy) + index = ((pixel%256)>>3)-1 + if index==0: spr.setshape(project_flap['closed']) + elif index==1: new_project() + elif index==2: load_file() + elif index==3: save_file() + + +# +# Startup +# + +def init(top_window, path): + global gc, area, category_spr, bgcolor,turtlecanvas, select_mask + global status_spr, turtle_spr, selbuttons, hidden_palette_icon, project_flap + global base_path, load_save_folder + window = top_window + base_path = path + + # remove any children of the window that Sugar may have added + for widget in window.get_children(): window.remove(widget) + + window.set_title("TurteArt") + window.connect("destroy", lambda w: gtk.main_quit()) + window.set_size_request(WIDTH, HEIGHT) + window.add_events(gtk.gdk.BUTTON_PRESS_MASK) + window.add_events(gtk.gdk.BUTTON_RELEASE_MASK) + window.add_events(gtk.gdk.POINTER_MOTION_MASK) + window.connect("expose-event", expose_cb) + window.connect("button-press-event", buttonpress_cb) + window.connect("button-release-event", buttonrelease_cb) + window.connect("motion-notify-event", move_cb) + window.connect("key_press_event", keypress_cb) + window.show() + area = window.window + cursor_pix = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'arrow.gif')) + cursor = gtk.gdk.Cursor(area.get_display(), cursor_pix, 10, 0) + area.set_cursor(cursor) + gc = area.new_gc() + + setspritecontext(window,area,gc) + cm = gc.get_colormap() + bgcolor = cm.alloc_color('#fff8de') + +# who = Sprite(0,0,gtk.gdk.pixbuf_new_from_file('fullscreen.gif')) +# who.type = 'bg' +# who.setlayer(700) + + + turtlecanvas = Sprite(0,0,gtk.gdk.Pixmap(area,1200,900,-1)) + turtlecanvas.type = 'canvas' + turtlecanvas.setlayer(600) + select_mask = Sprite(100,100,gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'masknumber.gif'))) + select_mask.type = 'selectmask' + status_spr = Sprite(0,865,gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'status.gif')),True) + status_spr.type = 'status' + status_spr.setlayer(400) + turtle.shapelist = [gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'shapes','t'+str(i)+'.gif')) + for i in range(36)] + turtle_spr = Sprite(100,100,turtle.shapelist[0]) + turtle_spr.type = 'turtle' + turtle_spr.setlayer(630) + turtle.init(window,turtlecanvas, turtle_spr, bgcolor) + hidden_palette_icon = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'toolbar','blocks-.gif')) + category_spr, selbuttons, default_category = setup_selectors(base_path) +# select_category(default_category) + for i in selbuttons: i.hide() + category_spr.setshape(hidden_palette_icon) + setup_toolbar() + project_flap = setup_project_flap() + logo.turtle = turtle + logo.turtle_spr = turtle_spr + logo.stopsign = toolsprite('stopit') + logo.status = status_spr + logo.init() + load_save_folder = os.path.join(base_path,'samples') + +def main(): + win = gtk.Window(gtk.WINDOW_TOPLEVEL) + init(win, os.path.abspath('.')) + gtk.main() + return 0 + +if __name__ == "__main__": + main() diff --git a/toolbar/blocks-.gif b/toolbar/blocks-.gif Binary files differnew file mode 100755 index 0000000..d8347ed --- /dev/null +++ b/toolbar/blocks-.gif diff --git a/toolbar/eraseroff.gif b/toolbar/eraseroff.gif Binary files differnew file mode 100755 index 0000000..9da2c2e --- /dev/null +++ b/toolbar/eraseroff.gif diff --git a/toolbar/eraseron.gif b/toolbar/eraseron.gif Binary files differnew file mode 100755 index 0000000..a3db3cc --- /dev/null +++ b/toolbar/eraseron.gif diff --git a/toolbar/hideshowoff.gif b/toolbar/hideshowoff.gif Binary files differnew file mode 100755 index 0000000..25a5d7d --- /dev/null +++ b/toolbar/hideshowoff.gif diff --git a/toolbar/hideshowon.gif b/toolbar/hideshowon.gif Binary files differnew file mode 100755 index 0000000..f727380 --- /dev/null +++ b/toolbar/hideshowon.gif diff --git a/toolbar/project-.gif b/toolbar/project-.gif Binary files differnew file mode 100755 index 0000000..4050808 --- /dev/null +++ b/toolbar/project-.gif diff --git a/toolbar/project.gif b/toolbar/project.gif Binary files differnew file mode 100755 index 0000000..ff0fe4f --- /dev/null +++ b/toolbar/project.gif diff --git a/toolbar/projectmask.gif b/toolbar/projectmask.gif Binary files differnew file mode 100755 index 0000000..8092284 --- /dev/null +++ b/toolbar/projectmask.gif diff --git a/toolbar/stopitoff.gif b/toolbar/stopitoff.gif Binary files differnew file mode 100755 index 0000000..c559ee5 --- /dev/null +++ b/toolbar/stopitoff.gif diff --git a/toolbar/stopiton.gif b/toolbar/stopiton.gif Binary files differnew file mode 100755 index 0000000..4b79aef --- /dev/null +++ b/toolbar/stopiton.gif diff --git a/turtle.py b/turtle.py new file mode 100755 index 0000000..dc1b0b6 --- /dev/null +++ b/turtle.py @@ -0,0 +1,195 @@ +import gtk
+from math import sin,cos,pi
+
+colors = {}
+buffer = None
+gc = None
+window = None
+width = 0
+height = 0
+sprite = None
+cm = None
+bgcolor = None
+fgcolor = None
+color = 0
+shade = 50
+pensize = 5
+pendown = True
+turtle = None
+
+DEGTOR = 2*pi/360
+
+xcor = 0
+ycor = 0
+heading = 0
+
+color_table = (
+ 0xFF0000,0xFF0D00,0xFF1A00,0xFF2600,0xFF3300,0xFF4000,0xFF4D00,0xFF5900,0xFF6600,0xFF7300,
+ 0xFF8000,0xFF8C00,0xFF9900,0xFFA600,0xFFB300,0xFFBF00,0xFFCC00,0xFFD900,0xFFE600,0xFFF200,
+ 0xFFFF00,0xE6FF00,0xCCFF00,0xB3FF00,0x99FF00,0x80FF00,0x66FF00,0x4DFF00,0x33FF00,0x1AFF00,
+ 0x00FF00,0x00FF0D,0x00FF1A,0x00FF26,0x00FF33,0x00FF40,0x00FF4D,0x00FF59,0x00FF66,0x00FF73,
+ 0x00FF80,0x00FF8C,0x00FF99,0x00FFA6,0x00FFB3,0x00FFBF,0x00FFCC,0x00FFD9,0x00FFE6,0x00FFF2,
+ 0x00FFFF,0x00F2FF,0x00E6FF,0x00D9FF,0x00CCFF,0x00BFFF,0x00B3FF,0x00A6FF,0x0099FF,0x008CFF,
+ 0x0080FF,0x0073FF,0x0066FF,0x0059FF,0x004DFF,0x0040FF,0x0033FF,0x0026FF,0x001AFF,0x000DFF,
+ 0x0000FF,0x0D00FF,0x1A00FF,0x2600FF,0x3300FF,0x4000FF,0x4D00FF,0x5900FF,0x6600FF,0x7300FF,
+ 0x8000FF,0x8C00FF,0x9900FF,0xA600FF,0xB300FF,0xBF00FF,0xCC00FF,0xD900FF,0xE600FF,0xF200FF,
+ 0xFF00FF,0xFF00E6,0xFF00CC,0xFF00B3,0xFF0099,0xFF0080,0xFF0066,0xFF004D,0xFF0033,0xFF001A)
+
+def init(win, spr, tspr, bg):
+ global buffer, gc, window, sprite, width, height, bgcolor, fgcolor, cm, turtle
+ window, sprite, buffer, turtle, bgcolor = win.window, spr, spr.image, tspr, bg
+ width, height = buffer.get_size()
+ gc = win.window.new_gc()
+ cm = gc.get_colormap()
+ gc = buffer.new_gc()
+ clearscreen()
+
+def clearscreen():
+ global xcor,ycor,heading, pendown
+ xcor, ycor, heading = 0,0,0
+ rect = gtk.gdk.Rectangle(0,0,width,height)
+ gc.set_foreground(bgcolor)
+ buffer.draw_rectangle(gc, True, *rect)
+ inval(0,0,width,height)
+ setpensize(5)
+ setcolor(0)
+ setshade(50)
+ pendown = True
+ move_turtle()
+ turn_turtle()
+ return None
+
+def forward(n):
+ global xcor,ycor
+ gc.set_foreground(fgcolor)
+ oldx, oldy = xcor, ycor
+ xcor += n*sin(heading*DEGTOR)
+ ycor += n*cos(heading*DEGTOR)
+ if pendown: draw_line(oldx,oldy,xcor,ycor)
+ move_turtle()
+ return None
+
+def seth(n):
+ global heading
+ heading=n
+ heading%=360
+ turn_turtle()
+ return None
+
+def right(n):
+ global heading
+ heading+=n
+ heading%=360
+ turn_turtle()
+ return None
+
+def arc(a,r):
+ gc.set_foreground(fgcolor)
+ if a<0: larc(-a,r)
+ else: rarc(a,r)
+ move_turtle()
+ turn_turtle()
+
+def rarc(a,r):
+ global xcor,ycor
+ if r<0: r=-r; a=-a
+ cx = xcor+r*cos(heading*DEGTOR)
+ cy = ycor-r*sin(heading*DEGTOR)
+ x,y,w,h=width/2+int(cx-r),height/2-int(cy+r),int(2*r),int(2*r)
+ buffer.draw_arc(gc,False,x,y,w,h,int(180-heading-a)*64,int(a)*64)
+ inval(x-pensize/2-3,y-pensize/2-3,w+pensize+6,h+pensize+6)
+ right(a)
+ xcor=cx-r*cos(heading*DEGTOR)
+ ycor=cy+r*sin(heading*DEGTOR)
+
+def larc(a,r):
+ global xcor,ycor
+ if r<0: r=-r; a=-a
+ cx = xcor-r*cos(heading*DEGTOR)
+ cy = ycor+r*sin(heading*DEGTOR)
+ x,y,w,h=width/2+int(cx-r),height/2-int(cy+r),int(2*r),int(2*r)
+ buffer.draw_arc(gc,False,x,y,w,h,int(360-heading)*64,int(a)*64)
+ inval(x-pensize/2-3,y-pensize/2-3,w+pensize+6,h+pensize+6)
+ right(-a)
+ xcor=cx+r*cos(heading*DEGTOR)
+ ycor=cy-r*sin(heading*DEGTOR)
+
+def setxy(x,y):
+ global xcor,ycor
+ xcor,ycor = x,y
+ move_turtle()
+
+def setpensize(ps):
+ global pensize
+ pensize = ps
+ gc.set_line_attributes(int(pensize),gtk.gdk.LINE_SOLID,gtk.gdk.CAP_ROUND,gtk.gdk.JOIN_MITER)
+ return None
+
+def setcolor(c):
+ global color
+ color = c
+ set_fgcolor()
+ return None
+
+def setshade(s):
+ global shade
+ shade = s
+ set_fgcolor()
+ return None
+
+def fillscreen(c,s):
+ oldc, olds = color,shade
+ setcolor(c); setshade(s)
+ rect = gtk.gdk.Rectangle(0,0,width,height)
+ gc.set_foreground(fgcolor)
+ buffer.draw_rectangle(gc, True, *rect)
+ inval(0,0,width,height)
+ setcolor(oldc); setshade(olds)
+ return None
+
+def set_fgcolor():
+ global fgcolor
+ sh = (wrap100(shade)-50)/50.0
+ rgb = color_table[wrap100(color)]
+ r,g,b = (rgb>>8)&0xff00,rgb&0xff00,(rgb<<8)&0xff00
+ r,g,b = calc_shade(r,sh),calc_shade(g,sh),calc_shade(b,sh)
+ fgcolor = cm.alloc_color(r,g,b)
+
+def wrap100(n):
+ n = int(n)
+ n %= 200
+ if n>99: n=199-n
+ return n
+
+def calc_shade(c,s):
+ if s<0: return int(c*(1+s*.8))
+ return int(c+(65536-c)*s*.9)
+
+def setpen(bool):
+ global pendown
+ pendown = bool
+
+def draw_line(x1,y1,x2,y2):
+ x1,y1 = width/2+int(x1), height/2-int(y1)
+ x2,y2 = width/2+int(x2), height/2-int(y2)
+ if x1<x2: minx,maxx=x1,x2
+ else: minx,maxx=x2,x1
+ if y1<y2: miny,maxy=y1,y2
+ else: miny,maxy=y2,y1
+ w,h=maxx-minx,maxy-miny
+ buffer.draw_line(gc,x1,y1,x2,y2)
+ inval(minx-pensize/2-3,miny-pensize/2-3,w+pensize+6,h+pensize+6)
+
+def turn_turtle():
+ turtle.setshape(shapelist[(int(heading+5)%360)/10])
+
+def move_turtle():
+ x,y = width/2+int(xcor), height/2-int(ycor)
+ turtle.move((sprite.x+x-30,sprite.y+y-30))
+ inval(x-30,y-30,60,60)
+
+def inval(x,y,w,h):
+ rect = gtk.gdk.Rectangle(int(x+sprite.x),int(y+sprite.y),int(w),int(h))
+ window.invalidate_rect(rect, False)
+
+
diff --git a/turtle/arc.gif b/turtle/arc.gif Binary files differnew file mode 100755 index 0000000..66c9815 --- /dev/null +++ b/turtle/arc.gif diff --git a/turtle/back.gif b/turtle/back.gif Binary files differnew file mode 100755 index 0000000..c77bb51 --- /dev/null +++ b/turtle/back.gif diff --git a/turtle/clean.gif b/turtle/clean.gif Binary files differnew file mode 100755 index 0000000..8355b8f --- /dev/null +++ b/turtle/clean.gif diff --git a/turtle/forward.gif b/turtle/forward.gif Binary files differnew file mode 100755 index 0000000..fa2eee4 --- /dev/null +++ b/turtle/forward.gif diff --git a/turtle/heading.gif b/turtle/heading.gif Binary files differnew file mode 100755 index 0000000..ed36dac --- /dev/null +++ b/turtle/heading.gif diff --git a/turtle/left.gif b/turtle/left.gif Binary files differnew file mode 100755 index 0000000..0274404 --- /dev/null +++ b/turtle/left.gif diff --git a/turtle/right.gif b/turtle/right.gif Binary files differnew file mode 100755 index 0000000..be381c7 --- /dev/null +++ b/turtle/right.gif diff --git a/turtle/seth.gif b/turtle/seth.gif Binary files differnew file mode 100755 index 0000000..2700f00 --- /dev/null +++ b/turtle/seth.gif diff --git a/turtle/setxy.gif b/turtle/setxy.gif Binary files differnew file mode 100755 index 0000000..2dfb9d8 --- /dev/null +++ b/turtle/setxy.gif diff --git a/turtle/turtlegroup.gif b/turtle/turtlegroup.gif Binary files differnew file mode 100755 index 0000000..ddc11da --- /dev/null +++ b/turtle/turtlegroup.gif diff --git a/turtle/turtlemask.gif b/turtle/turtlemask.gif Binary files differnew file mode 100755 index 0000000..7a5dda3 --- /dev/null +++ b/turtle/turtlemask.gif diff --git a/turtle/xcor.gif b/turtle/xcor.gif Binary files differnew file mode 100755 index 0000000..5f6afef --- /dev/null +++ b/turtle/xcor.gif diff --git a/turtle/ycor.gif b/turtle/ycor.gif Binary files differnew file mode 100755 index 0000000..a2e5588 --- /dev/null +++ b/turtle/ycor.gif diff --git a/turtlesetup.py b/turtlesetup.py new file mode 100755 index 0000000..6525a1c --- /dev/null +++ b/turtlesetup.py @@ -0,0 +1,179 @@ +import pygtk
+pygtk.require('2.0')
+import gtk
+import gobject
+import os
+#import os.path
+
+from sprites import *
+
+selectors = (
+ ('turtle', 37,
+ (('clean','clean','noarg'),
+ ('forward','forward','onearg',100),
+ ('back','back','onearg',100),
+ ('left','left','onearg',90),
+ ('right','right','onearg',90),
+ ('arc','arc','twoargs',90,100),
+ ('setxy','setxy','twoargs',0,0),
+ ('seth','seth','onearg',0),
+ ('xcor','xcor','num'),
+ ('ycor','ycor','num'),
+ ('heading','heading','num'))),
+ ('pen', 30,
+ (('penup','penup','noarg'),
+ ('pendown','pendown','noarg'),
+ ('setpensize','setpensize','1arg',5),
+ ('setcolor','setcolor','1arg',0),
+ ('setshade','setshade','1arg',50),
+ ('fillscreen','fillscreen','twoargs',60,80),
+ ('pensize','pensize','num'),
+ ('color','color','num'),
+ ('shade','shade','num'))),
+ ('numbers', 55,
+ (('number','','num'),
+ ('plus','+','ari'),
+ ('minus','-','ari'),
+ ('product','*','ari'),
+ ('division','/','ari'),
+ ('remainder','%','ari2'),
+ ('random','random','random',0,100),
+ ('greater','greater?','comp'),
+ ('less','less?','comp'),
+ ('equal','equal?','comp'),
+ ('and','and','and'),
+ ('or','or','and'),
+ ('not','not','not'),
+ ('print','print','onearg'))),
+ ('flow', 30,
+ (('wait','wait','onearg',10),
+ ('forever','forever','forever'),
+ ('repeat','repeat','repeat',4),
+ ('if','if','if'),
+ ('stopstack','stopstack','stop'),
+ ('ifelse','ifelse','ifelse'),
+ ('hspace','nop','hspace'),
+ ('vspace','nop','vspace'))),
+ ('myblocks', 46,
+ (('hat1','nop','start'),
+ ('stack1','stack1','noarg'),
+ ('hat2','nop','start'),
+ ('stack2','stack2','noarg'),
+ ('storeinbox1','storeinbox1','1arg'),
+ ('box1','box1','num'),
+ ('storeinbox2','storeinbox2','1arg'),
+ ('box2','box2','num'))))
+
+toolbaritems = (
+# ('new',0,20),('open',70,20), ('save',70,20),
+ ('hideshow',700, 850),('eraser',54,850), ('stopit',54,850))
+# ('hideshow',200, 2),('eraser',54,3), ('stopit',54,2))
+
+dockdetails = {
+ 'noarg': (('flow',True,37,5),('flow',False,37,44)),
+ 'onearg': (('flow',True,37,5),('num',False,74,21),('flow',False,37,44)),
+ '1arg': (('flow',True,37,5),('num',False,74,29),('flow',False,37,59)),
+ 'twoargs': (('flow',True,37,5),('num',False,74,21),('num',False,74,58),('flow',False,37,81)),
+ 'forever': (('flow',True,37,5),('flow',False,118,19,'['),('unavailable',False,0,0,']')),
+ 'repeat': (('flow',True,37,5),('num',False,86,21),('flow',False,132,54,'['),('flow',False,37,95,']')),
+ 'num': (('num',True,0,12),('numend',False,105,12)),
+ 'if': (('flow',True,37,5),('logi+',False,80,31),('flow',False,132,79,'['),('flow',False,37,120,']')),
+ 'ifelse': (('flow',True,37,5),('logi+',False,80,31),('flow',False,132,79,'['),('flow',False,217,79,']['),('flow',False,37,120,']')),
+ 'ari': (('numend',True,12,20),('num',False,39,20)),
+ 'ari2': (('numend',True,12,20),('num',False,51,20)),
+ 'stop': (('flow',True,37,5),('unavailable',False,0,0)),
+ 'comp': (('logi+',True,0,21,'('),('num',False,32,21),('num',False,181,21),('logi-',False,320,21,')')),
+ 'random': (('num',True,0,31,'('),('num',False,28,31),('num',False,150,31),('numend',False,279,31,')')),
+ 'and': (('logi-',True,28,24),('logi+',False,64,24)),
+ 'vspace': (('flow',True,37,5),('flow',False,37,74)),
+ 'hspace': (('flow',True,37,14),('flow',False,128,13)),
+ 'not': (('logi+',True,0,24),('unavailable',False,0,0),('logi+',False,55,24)),
+ 'start': (('start',True,50,0),('flow',False,49,55))
+}
+
+protodict = {}
+toolsprs = {}
+base_path = None
+
+class BlockProto:
+ def __init__(self,name):
+ self.name = name
+
+
+def setup_selectors(path):
+ global base_path
+ base_path = path
+ y = 25
+ categories = []
+ for s in selectors:
+ name,dy,blockdescriptions = s
+ cat = setup_selector(name,y, blockdescriptions)
+ y += dy*3/2
+ categories.append(cat)
+ category_spr = Sprite(0, 0, categories[0].group)
+ category_spr.type = 'category'
+ category_spr.setlayer(660)
+ return category_spr, categories, categories[0]
+
+def setup_selector(name,y,blockdescriptions):
+ offshape = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'palette',name+'off.gif'))
+ onshape = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'palette',name+'on.gif'))
+ who = Sprite(140,y,offshape)
+ who.setlayer(800)
+ who.offshape = offshape
+ who.onshape = onshape
+ who.group = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, name,name+'group.gif'))
+ maskname = os.path.join(base_path, name,name+'mask.gif')
+ if os.access(maskname, os.F_OK):
+ who.mask = gtk.gdk.pixbuf_new_from_file(maskname)
+ else: who.mask = None
+ who.type = 'selbutton'
+ protos = []
+ for b in blockdescriptions:
+ bname,primname,docktype = b[0:3]
+ image = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, name, bname+'.gif'))
+ proto = BlockProto(bname)
+ proto.image = image
+ proto.primname=primname
+ proto.defaults=b[3:]
+ if docktype in dockdetails: proto.docks=dockdetails[docktype]
+ else: proto.docks = docktype
+ protodict[bname] = proto
+ protos.append(proto)
+ who.blockprotos = protos
+ return who
+
+def setup_toolbar():
+ x,y = 330,0
+ for s in toolbaritems:
+ name,dx,dy= s
+ x += dx
+ setup_tool(x,y + dy,name)
+ return
+
+def setup_tool(x,y,name):
+ offshape = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'toolbar',name+'off.gif'))
+ onshape = gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'toolbar',name+'on.gif'))
+ who = Sprite(x,y,offshape)
+ who.setlayer(800)
+ who.offshape = offshape
+ who.onshape = onshape
+ who.type = 'tool'
+ who.blocktype = name
+ toolsprs[name] = who
+
+def setup_project_flap():
+ project_flap = {
+ 'closed': gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'toolbar','project-.gif')),
+ 'open': gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'toolbar','project.gif')),
+ 'mask': gtk.gdk.pixbuf_new_from_file(os.path.join(base_path, 'toolbar','projectmask.gif'))}
+# who = Sprite(720,0,project_flap['closed'])
+ who = Sprite(888,0,project_flap['closed'])
+ who.type = 'project_flap'
+ who.setlayer(800)
+ return project_flap
+
+def blockproto(name): return protodict[name]
+
+def toolsprite(name): return toolsprs[name]
+
|