2D graphics/turtle lib suitable for kids?
2D graphics/turtle lib suitable for kids?
My daughter found Land of Lisp on my shelf and wants to learn Common Lisp. I approve of course, but for a 10-year old child I think the examples in the book are a bit too abstract. I'd like to start simple interactive graphics (create stuff from the REPL - instant satisfaction), but I have no luck finding a simple 2D graphics lib for this, preferably with turtle graphics, and perhaps other simple 2D functions (lines, basic shapes, fill with colors etc.). Is there such a package which is small and easy enough to be useful for small children just starting out? Any advice appreciated.
Re: 2D graphics/turtle lib suitable for kids?
If I were you, I'd just use lispbuilder-sdl and make whatever primitives I need on top of it. Lispbuilder handles window creation, framerate, and the event pump pretty cleanly. It includes draw-pixel, draw-line, as well as draw functions for filled and unfilled rectangles, polygons, and circles. You'd have to define your own sprite type and... google image search a turtle to use to that end, I guess.yena wrote:My daughter found Land of Lisp on my shelf and wants to learn Common Lisp. I approve of course, but for a 10-year old child I think the examples in the book are a bit too abstract. I'd like to start simple interactive graphics (create stuff from the REPL - instant satisfaction), but I have no luck finding a simple 2D graphics lib for this, preferably with turtle graphics, and perhaps other simple 2D functions (lines, basic shapes, fill with colors etc.). Is there such a package which is small and easy enough to be useful for small children just starting out? Any advice appreciated.
"If you want to improve, be content to be thought foolish and stupid." -Epictetus
Re: 2D graphics/turtle lib suitable for kids?
BAH! Just use a triangle!Duke wrote: google image search a turtle to use to that end, I guess.
It was good enough for when I was learning how to work Apple Logo on my //c with the tiny phosphorescent green-screen
-
- Posts: 117
- Joined: Tue Aug 10, 2010 11:24 pm
- Location: Calgary, Alberta
- Contact:
Re: 2D graphics/turtle lib suitable for kids?
I think Duke's idea is a good one (if you have the time). I discovered programming through Basic, because I could put it into mode 13h and draw pixels. I think pixel plotting is probably an easier starting point than rotation, recursion and line drawing.
Were it me, I'd probably use SDL to create a 800x600 window, and then create a 'pixel' routine to draw 4x4 square (in one of 5 colors: RED, BLUE GREEN, WHITE, BLACK) big and visible. I'd expect this to be about 100 loc, max.
With pixel drawing routines, she can probably figure out horz-line routines and vert-line routines. Then progress to using those to draw big boxes, hollow boxes, a trail of boxes, a moving box, etc. In time you might relax limitations --- draw 1 pixel rather than 4, use RGB colors, manually control double buffering, etc.
Just an idea, if you keep your beginner library short (less than 100 loc) than she is never far removed from the real language itself.
Were it me, I'd probably use SDL to create a 800x600 window, and then create a 'pixel' routine to draw 4x4 square (in one of 5 colors: RED, BLUE GREEN, WHITE, BLACK) big and visible. I'd expect this to be about 100 loc, max.
With pixel drawing routines, she can probably figure out horz-line routines and vert-line routines. Then progress to using those to draw big boxes, hollow boxes, a trail of boxes, a moving box, etc. In time you might relax limitations --- draw 1 pixel rather than 4, use RGB colors, manually control double buffering, etc.
Just an idea, if you keep your beginner library short (less than 100 loc) than she is never far removed from the real language itself.
Need an online wiki database? My Lisp startup http://www.formlis.com combines a wiki with forms and reports.
-
- Posts: 406
- Joined: Sat Mar 07, 2009 6:17 pm
- Location: Brazil
- Contact:
Re: 2D graphics/turtle lib suitable for kids?
Teaching Common Lisp to a 10 years old kid? Man, you are my hero
Seriously, if you eventually manage to do it, I would love if you could explain how you did it. Of course, please don't feel obligated to it, just a relative small post telling your experience will be enough for me
Seriously, if you eventually manage to do it, I would love if you could explain how you did it. Of course, please don't feel obligated to it, just a relative small post telling your experience will be enough for me
Re: 2D graphics/turtle lib suitable for kids?
Different strokes for different folks, but I would have found that tedious and painful.Warren Wilkinson wrote:I think Duke's idea is a good one (if you have the time). I discovered programming through Basic, because I could put it into mode 13h and draw pixels. I think pixel plotting is probably an easier starting point than rotation, recursion and line drawing.
Were it me, I'd probably use SDL to create a 800x600 window, and then create a 'pixel' routine to draw 4x4 square (in one of 5 colors: RED, BLUE GREEN, WHITE, BLACK) big and visible. I'd expect this to be about 100 loc, max.
With pixel drawing routines, she can probably figure out horz-line routines and vert-line routines. Then progress to using those to draw big boxes, hollow boxes, a trail of boxes, a moving box, etc. In time you might relax limitations --- draw 1 pixel rather than 4, use RGB colors, manually control double buffering, etc.
Just an idea, if you keep your beginner library short (less than 100 loc) than she is never far removed from the real language itself.
LOGO is beautiful, because once you write a few routines you can use those to draw stick figures and other simple objects, and if you have something more complete at your disposal (like SDL gives) you can grow from there.
Advocating a programming style inspired by BASIC in a CL forum is also a bit o_O to me...
Re: 2D graphics/turtle lib suitable for kids?
For an out-of-the-box solution, give Scratch a try.
Tk's canvas is not far from what you describe. Simple, cross-platform, but a bit dated in capabilities. Easily accessible through LTK.
The new HTML canvas is much better. I people are using it from CL; Kenny Tilton or Tim Daly might be able to point you towards CL bindings.
There's also the Qt canvas. A bit heavier API. Accessible via CommonQt, or on ECL via EQL.
Tk's canvas is not far from what you describe. Simple, cross-platform, but a bit dated in capabilities. Easily accessible through LTK.
The new HTML canvas is much better. I people are using it from CL; Kenny Tilton or Tim Daly might be able to point you towards CL bindings.
There's also the Qt canvas. A bit heavier API. Accessible via CommonQt, or on ECL via EQL.
Re: 2D graphics/turtle lib suitable for kids?
Thanks all for the replies so far. I'm a bit short of time and was hoping to find something ready to use, but I suppose that putting together a simple turtle lib myself shouldn't be too hard. I'll have a look at the sdl and tk options. Re: Lisp for a child - I don't really think that is too far-fetched, strange, or harder than any other approach. Her mind is still open to non-C syntax We actually tried Ruby but it was more confusing to her - too many ways to get syntax errors.
-
- Posts: 117
- Joined: Tue Aug 10, 2010 11:24 pm
- Location: Calgary, Alberta
- Contact:
Re: 2D graphics/turtle lib suitable for kids?
I've never used logo, so I can't judge. I just feel that teaching cartesian coordinates would be easier than trigonometry, and since all graphical displays are based on pixels, also more useful long term. I'm also guessing that a child might be more interested in gradients and colorful patterns than they would be in triangles and recursion, this is easier with pixel plotting.TheGZeus wrote:Different strokes for different folks, but I would have found that tedious and painful.
LOGO is beautiful, because once you write a few routines you can use those to draw stick figures and other simple objects, and if you have something more complete at your disposal (like SDL gives) you can grow from there.
Advocating a programming style inspired by BASIC in a CL forum is also a bit o_O to me...
Its simpler too -- there is no pen, if you do it right there is just a continuous block of memory. Line drawing calls pixel drawing. Box drawing calls line drawing. Its perfectly functional. =)
Need an online wiki database? My Lisp startup http://www.formlis.com combines a wiki with forms and reports.
Re: 2D graphics/turtle lib suitable for kids?
You're not teaching trigonometry, but basic geometry. You're still working from coordinates, just abstract ones. fd 1 (forward one, in a hypothetical dialect) could be one pixel (it was in Apple Logo) but it could also be an arbitrary distance, with 1.235 as a possibility, as well.Warren Wilkinson wrote:I've never used logo, so I can't judge. I just feel that teaching cartesian coordinates would be easier than trigonometry, and since all graphical displays are based on pixels, also more useful long term. I'm also guessing that a child might be more interested in gradients and colorful patterns than they would be in triangles and recursion, this is easier with pixel plotting.TheGZeus wrote:Different strokes for different folks, but I would have found that tedious and painful.
LOGO is beautiful, because once you write a few routines you can use those to draw stick figures and other simple objects, and if you have something more complete at your disposal (like SDL gives) you can grow from there.
Advocating a programming style inspired by BASIC in a CL forum is also a bit o_O to me...
Its simpler too -- there is no pen, if you do it right there is just a continuous block of memory. Line drawing calls pixel drawing. Box drawing calls line drawing. Its perfectly functional. =)
Advocating direct pixel manipulation seems... archaic, and non-portable to higher/lower resolutions.
SVG is much more flexible than (insert bitmapped format).
NeWS was much more flexible than X.
Artists don't draw on graphing paper, yo.