some examples

630 views
Skip to first unread message

Luke

unread,
Sep 1, 2009, 3:59:20 PM9/1/09
to KTurtle; an educational programming environment
Hi there,

I checked out KTurtle cause my little brother kept asking me about
programming... so I got to play around a little and created some
examples. Maybe someone here has a use for them...

http://rapidshare.com/files/274405396/turtle_examples.tar.bz.html

(Please mirror this since I currently have no webspace available and
Rapidshare limits download count to 10...) This archive contains among
other things (including screenshots for every program) the star-
examples I posted at

http://de.wikiversity.org/wiki/Kurs:KTurtle/Code-Rubrik

some days ago, plus some basic fractal FUSS-curves that I haven't seen
in KTurtle yet:
- hilbert curve
- peano curve
- dragon curve and
- gosper curve

Feel free to use them for whatever you want. I don't have much time
right now anyway, so I'm done with KTurtle for now. Some suggestions
though:

- better documentation, especially a full list of known keywords. I
needed sine/cosine and square root for drawing the stars and ended up
writing my own taylor approximation before I noticed they're built in
anyway ;-)

- clarification of variable scoping (!)

- some basic functions are missing, e.g. facing a certain point,
moving to a certain point (with pen down), especially querying system
information (pen state, colour, canvas size, direction (!), etc. I
ended up writing these myself (except for the colour/state things),
but since it's so common I had to copy/paste these into every new
file...

(- maybe a stack for the turtle's situation (including pen colour and
up/down state) to push and pop from.. useful for drawing more complex
scenes)


Otherwise this is a nice program, thanks for the good work.

Greets,
Luke

cies

unread,
Sep 1, 2009, 10:50:28 PM9/1/09
to kdeedu-...@googlegroups.com
On Wed, Sep 2, 2009 at 1:29 AM, Luke<morph...@mail.com> wrote:
>
> Hi there,
>
> I checked out KTurtle cause my little brother kept asking me about
> programming... so I got to play around a little and created some
> examples. Maybe someone here has a use for them...
>
> http://rapidshare.com/files/274405396/turtle_examples.tar.bz.html

thanks for sharing!
can we, in case we want, ship this with kturtle?
(that means we initially license it GPLv3, and at the discretion of
the KDE e.V. it could be relicensed later, together with the rest of
KDE, if needed)

> (Please mirror this since I currently have no webspace available and
> Rapidshare limits download count to 10...)

you can upload files to this google-group.
(if the licensing is ok i'll upload it here for you)


i really like the examples. thanks!


> Feel free to use them for whatever you want. I don't have much time
> right now anyway, so I'm done with KTurtle for now. Some suggestions
> though:
>
> - better documentation, especially a full list of known keywords. I
> needed sine/cosine and square root for drawing the stars and ended up
> writing my own taylor approximation before I noticed they're built in
> anyway ;-)

you're right. that should be done soon.
documentation improved a lot in SVN lately, but no list-of-keywords yet.

> - clarification of variable scoping (!)

what do you mean exactly here? the fact that you can have local
variables inside sme scope that do not affect variables of the same
name in a parent scope...?


> - some basic functions are missing, e.g. facing a certain point,
> moving to a certain point (with pen down), especially querying system
> information (pen state, colour, canvas size, direction (!), etc. I
> ended up writing these myself (except for the colour/state things),
> but since it's so common I had to copy/paste these into every new
> file...

making state information available is one of the TODOs. thanks for
pointing it out. we do try to prioritize after our users wishes :)


> (- maybe a stack for the turtle's situation (including pen colour and
> up/down state) to push and pop from.. useful for drawing more complex
> scenes)

what do you mean here? a stack containing the state history of the turtle?


> Otherwise this is a nice program, thanks for the good work.

you thanks for taking the effort posting feedback.


_cies.

p.s.: i didn't even know that this site existed, thanks for pointing it out!
http://de.wikiversity.org/wiki/Kurs:KTurtle/Code-Rubrik
(most of the examples given i somehow know though)

Niels Slot

unread,
Sep 2, 2009, 3:25:23 AM9/2/09
to kdeedu-...@googlegroups.com


2009/9/2 cies <cies....@gmail.com>


On Wed, Sep 2, 2009 at 1:29 AM, Luke<morph...@mail.com> wrote:
>
> Hi there,
>
> I checked out KTurtle cause my little brother kept asking me about
> programming... so I got to play around a little and created some
> examples. Maybe someone here has a use for them...
>
> http://rapidshare.com/files/274405396/turtle_examples.tar.bz.html

thanks for sharing!
can we, in case we want, ship this with kturtle?
(that means we initially license it GPLv3, and at the discretion of
the KDE e.V. it could be relicensed later, together with the rest of
KDE, if needed)

That would be GPLv2, GPLv3 or any higher at the discretion of KDE e.V. (see http://techbase.kde.org/Policies/Licensing_Policy ).

That's usual for KDE code. This however, is example data. Maybe license this under something non-GPL is more appropriate here?


> (Please mirror this since I currently have no webspace available and
> Rapidshare limits download count to 10...)

you can upload files to this google-group.
(if the licensing is ok i'll upload it here for you)


i really like the examples. thanks!
Same here, they look great :)

cies

unread,
Sep 2, 2009, 5:50:18 AM9/2/09
to kdeedu-...@googlegroups.com
> That would be GPLv2, GPLv3 or any higher at the discretion of KDE e.V. (see
> http://techbase.kde.org/Policies/Licensing_Policy ).
>
> That's usual for KDE code. This however, is example data. Maybe license this
> under something non-GPL is more appropriate here?

yeah, what about public domain or CC (no share-alike, no attribution)?
this way users can use it in any way and never make a licensing mistake.
and please no licensing info in the .turtle files 'm selves. :)
a notice in the README will do..

a one line comment on to of the file saying: # $SCRIPT_NAME by $AUTHOR

and we should edit the scripts to adhere some kind of code style conventions..


_c.

Luke

unread,
Sep 2, 2009, 9:32:09 AM9/2/09
to KTurtle; an educational programming environment
Hi,

> thanks for sharing!
> can we, in case we want, ship this with kturtle?
> (that means we initially license it GPLv3, and at the discretion of
> the KDE e.V. it could be relicensed later, together with the rest of
> KDE, if needed)
You can use the code for any purpose and relicense it any way you see
fit, however if you really intend to ship these with kturtle you
probably need to recomment(/rewrite?) them anyway. These are quick
undocumented hacks with inconsistent style. (For example, the hilbert
and peano curves are rescaled to fill a square of $length, while with
gosper and dragon $length means the length of the basic forward step.)

(I started commenting the star examples but I couldn't be bothered to
continue because I originally wrote these for myself and my little
brother. But the fractals should be straightforward, I just picked the
more interesting looking from german wikipedia and translated their L-
systems to the kturtle language.)

> you can upload files to this google-group.
> (if the licensing is ok i'll upload it here for you)
I didn't find the option on the 'Files' tab.

> i really like the examples. thanks!
thx

> > - clarification of variable scoping (!)
>
> what do you mean exactly here? the fact that you can have local
> variables inside sme scope that do not affect variables of the same
> name in a parent scope...?
Yes, this is basically what I mean, including especially whether vars
are passed to functions per value or per reference. What are the
shadowing rules, what happens to variables "declared" in blocks (or
loops). Are function variables static?

> > (- maybe a stack for the turtle's situation (including pen colour and
> > up/down state) to push and pop from.. useful for drawing more complex
> > scenes)
>
> what do you mean here? a stack containing the state history of the turtle?
Take for example a function that draws some geometric shape. It would
be nice for the caller to be guaranteed that on return the turtle's
state is exactly what it was before calling. (This is a basic paradigm
that would benefit algorithmic thinking in my opinion.)
In this case the function would have to save all available state
information before starting to draw, and restore it when done. (This
is difficult anyway because you can't query color information,
direction, etc yet.)
With a stack the function would call 'push' before drawing and 'pop'
when done.


--Luke
Reply all
Reply to author
Forward
0 new messages