writing procedures

114 views
Skip to first unread message

steve_redshaw

unread,
Dec 3, 2009, 4:10:01 PM12/3/09
to KTurtle; an educational programming environment
I have used Logo with children for some years and now I have started
using Linux as an OS on my computer I am interested to se a Linux
version. I am using Mandriva 2010.

1) brackets;

In the handbook it gives this format;

learn square [
repeat 4 [tr 90 fw 100]
]

this will not work on my computer, it has to be;

learn square {
repeat 4 {tr 90 fw 100}
}

2) I have written some simple procedures to try things out, but cannot
get them to work with a variable;

learn square (x) {
repeat 4 {tr 90 fw (x)}
}
this produces the error message;

expected a scope after the learn command 0 (code)

I cannot find any refernece to error codes in the handbook so cannot
debug this!!

as the brackets on my system are different from the ones described in
the handbook, maybe the way of setting variables is different?

any advice would be useful - thanks

cies

unread,
Dec 3, 2009, 4:41:11 PM12/3/09
to KTurtle; an educational programming environment


On Dec 3, 10:10 pm, steve_redshaw <stevereds...@googlemail.com> wrote:
> I have used Logo with children for some years and now I have started
> using Linux as an OS on my computer I am interested to se a Linux
> version. I am using Mandriva 2010.
>
> 1) brackets;
>
> In the handbook it gives this format;
>
> learn square [
> repeat 4 [tr 90 fw 100]
> ]

KTurtle uses different syntax than the dialects of the LOGO language.

> this will not work on my computer, it has to be;
>
> learn square {
> repeat 4 {tr 90 fw 100}
>
> }

almost right, try:

learn square {
repeat 4 {
tr 90
fw 100
}
}

if your code works it works, but actually you need to put newlines
after commands.

> 2) I have written some simple procedures to try things out, but cannot
> get them to work with a variable;
>
> learn square (x) {
> repeat 4 {tr 90 fw (x)}}

here you might want to try:

learn square (x) {
repeat 4 {
tr 90
fw (x)
}
}

the indentation is not mandatory, but as indentation is more/less
standard in programming and helps with reading it is nice to teach it
i think.


> as the brackets on my system are different from the ones described in
> the handbook, maybe the way of setting variables is different?

you have to translate all LOGO exercises to "KTurtle" code before
they'll work in KTurtle.


good luck, thanks for using kturtle!
_c.

steve_redshaw

unread,
Dec 3, 2009, 5:21:33 PM12/3/09
to KTurtle; an educational programming environment
learn square (x) {
repeat 4 {
tr 90
fw (x)
}

}

this does not work, the error message is;

expected a scope after the learn command 0 (code)

what is a scope? how can I find the right syntax for my computer? I
cannot use the program if I have no way to debug

thanks

cies

unread,
Dec 3, 2009, 5:50:22 PM12/3/09
to kdeedu-...@googlegroups.com
sorry i didn't even run it before i send it to you... my excuses
(little busy at work)

On Thu, Dec 3, 2009 at 11:21 PM, steve_redshaw
<stever...@googlemail.com> wrote:
> learn square (x) {
>  repeat 4 {
>    tr 90
>    fw (x)
>  }
>
> }
>
> this does not work, the error message is;
>
> expected a scope after the learn command 0 (code)

true, it should be this (we also added '$' before variables):

learn square $x {
repeat 4 {
tr 90
fw $x
}
}

square 60

> what is a scope? how can I find the right syntax for my computer?

please read the documentation, the might be some errors or problems
(please report if you find 'm!!) -- but overal it is the place to
start learning kturtle.

in the file menu you'll find some examples, these might also get you started.

> cannot use the program if I have no way to debug

again, the manual is yr friend. (Help -> Handbook)

best of luck,
_cies.

steve_redshaw

unread,
Dec 4, 2009, 7:37:39 AM12/4/09
to KTurtle; an educational programming environment
thank you for this, I can now run procedures so can progress with
using this program

I have read through the handbook which appears under the Help menu, it
does not mention any error codes and of course does not have the
syntax you provided me with to get the procedures to work - some
people may be put off continuing with kTurtle if their initial
attempts do not work and they cannot find answers in the help file

I am not trying to criticise here and I know this group is a good
source of advice, but my first impression is that the help file may
not be that 'helpful'

are there plans to make the handbook more comprehensive? if so I am
quite willing to contribute in any way I can

I shall certainly continue now to use kTurtle and develop activities
for my daughter to enjoy

regards

Steve

On 3 Dec, 22:50, cies <cies.bre...@gmail.com> wrote:
> sorry i didn't even run it before i send it to you... my excuses
> (little busy at work)
>
> On Thu, Dec 3, 2009 at 11:21 PM, steve_redshaw
>

cies

unread,
Dec 7, 2009, 11:31:03 PM12/7/09
to kdeedu-...@googlegroups.com
On Fri, Dec 4, 2009 at 1:37 PM, steve_redshaw
<stever...@googlemail.com> wrote:
> thank you for this, I can now run procedures so can progress with
> using this program

good to hear..


> are there plans to make the handbook more comprehensive? if so I am
> quite willing to contribute in any way I can

if you could list very detailed what made it hard for you to get
started with kturtle that would be a good thing.

then you say the kturtle handbook (under the help menu), is not
"proper".. please state the version of kturtle yr using then we can
have a look at that.

> I shall certainly continue now to use kTurtle and develop activities
> for my daughter to enjoy

good to hear that.. your welcome :)

cheers,
_cies.
> --
>
> You received this message because you are subscribed to the Google Groups "KTurtle; an educational programming environment" group.
> To post to this group, send email to kdeedu-...@googlegroups.com.
> To unsubscribe from this group, send email to kdeedu-kturtl...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/kdeedu-kturtle?hl=en.
>
>
>

steve_redshaw

unread,
Dec 18, 2009, 4:37:04 AM12/18/09
to KTurtle; an educational programming environment
my suggestions for kTurtle

sorry it has been a while before replying to your last message, I have
been using the program a bit more to gather some more thoughts

firstly, these commands do not work on my Linux (Mandriva 2010);

wrapon
wrapoff
hide (but sh does)
show (but ss does)
inputwindow

on trying to use kTurtle I had these problems/frustrations;

the syntax for building procedures was not valid for my Linux - ie the
handbook shows these brackets [], but I have to use these {}
(however the screenshot examples in the handbook do show {} being
used)
a variable on my Linux needs $ before it, this is not mentioned in the
handbook

there is no mention of error messages or how to deal with them

I feel these discrepancies could frustrate a new user (a child for
example) and they could then dismiss the program at the first hurdle

possible developments;

a tutorial approach to learning the program's basics using simple
shapes eg lines, lines at an angle, draw triangle, square,then
progress to building procedures using the learn command, projects to
carry out that will teach the programming language in easy steps (the
handbook does do this, but not with enough simple illustrated steps,
maybe this would be good on a website or tutorials that can be
downloaded)
an easily accessible list of logo primitives, definition of use and
their abbreviations
ability to save and load procedures (at the moment a whole turtle file
has to be loaded containing all procedures needed for a partucular
session)
fill shapes with colour
ability to run commands consequentially as they are typed in, not
whole editor contents from beginning
guide on error codes for debugging

these are my initial thoughts, I am really pleased to have found a
good Logo version for Linux, as a teacher I have used Logo from its
manifestation on BBC computers back in the 1980s(!) with primary
school children, if you feel I could help with development of kTurtle
I would be happy to do so (I am not tecnically able, but experienced
in using programs and possibly devising projects and tutorials so that
others can use the program and learn the basics of logical thought,
planning, editing and testing)

best regards
Steve Redshaw

On 8 Dec, 04:31, cies <cies.bre...@gmail.com> wrote:
> On Fri, Dec 4, 2009 at 1:37 PM, steve_redshaw
>

cies

unread,
Dec 18, 2009, 9:08:30 AM12/18/09
to kdeedu-...@googlegroups.com
On Fri, Dec 18, 2009 at 10:37 AM, steve_redshaw
<stever...@googlemail.com> wrote:
> my suggestions for kTurtle
>
> sorry it has been a while before replying to your last message, I have
> been using the program a bit more to gather some more thoughts

great..


> firstly, these commands do not work on my Linux (Mandriva 2010);
>
> wrapon
> wrapoff

intended. we do not have wrapping anymore in kturtle starting with kde4.

> hide (but sh does) -> spritehide
> show (but ss does) -> spriteshow
> inputwindow -> ask

hmmm.. interesting. these commands have changed (see my arrows).
do you use the german handbook for kturtle? or do you use an old one?

please use a new kturtle and handbook.


> on trying to use kTurtle I had these problems/frustrations;
>
> the syntax for building procedures was not valid for my Linux - ie the
> handbook shows these brackets [], but I have to use these {}
> (however the screenshot examples in the handbook do show {} being
> used)
> a variable on my Linux needs $ before it, this is not mentioned in the
> handbook

you use a different manual than me im afraid.

please refer to this one:
http://docs.kde.org/stable/en/kdeedu/kturtle
http://docs.kde.org/stable/en/kdeedu/kturtle/commands.html


> there is no mention of error messages or how to deal with them
>
> I feel these discrepancies could frustrate a new user (a child for
> example) and they could then dismiss the program at the first hurdle

what would you suggest here? please elaborate...


> possible developments;
>
> a tutorial approach to learning the program's basics using simple
> shapes eg lines, lines at an angle, draw triangle, square,then
> progress to building procedures using the learn command, projects to
> carry out that will teach the programming language in easy steps (the
> handbook does do this, but not with enough simple illustrated steps,
> maybe this would be good on a website or tutorials that can be
> downloaded)

a tutorial would be a welcome addition. i doesnt have to be in the
handbook. anyone can publish this in any format :).


> an easily accessible list of logo primitives, definition of use and
> their abbreviations

see link mentioned earlier.

> ability to save and load procedures (at the moment a whole turtle file
> has to be loaded containing all procedures needed for a partucular
> session)

file -> save :)


> fill shapes with colour

impossible.


> ability to run commands consequentially as they are typed in, not
> whole editor contents from beginning

in the toolbar is a single command console. works much like you describe.

otherwise use the step-by-step run mode.

> guide on error codes for debugging

error codes are merely for reference of the developers.


> these are my initial thoughts, I am really pleased to have found a
> good Logo version for Linux, as a teacher I have used Logo from its
> manifestation on BBC computers back in the 1980s(!) with primary
> school children, if you feel I could help with development of kTurtle
> I would be happy to do so (I am not tecnically able, but experienced
> in using programs and possibly devising projects and tutorials so that
> others can use the program and learn the basics of logical thought,
> planning, editing and testing)

please do not call kturtle logo. we're not pretending to be logo any more :)
we're a educatinoal programming environment. (also on windows and mac)

im glad you like it!

kindly,
_cies.

Steve Redshaw

unread,
Dec 18, 2009, 11:32:55 AM12/18/09
to kdeedu-...@googlegroups.com
I think the problem is the kTurtle version available through the Mandriva 2010 (KDE4) software repository (the kTurtle version on offer is 0.8 beta)

maybe this is the latest version, but with an old manual?

I have looked at the online manual from your link and it answers most of my problems and frustrations!! I cannot however get a later version through my software updater - as a fairly new Linux user I am still floundering with terminals and commands and building an application seems quite a challenge, however I have looked at the instructions and will try it out if this gives me the latest version

should be able to contribute some simple projects too in the not too distant future

just to elaborate on the loading/saving of procedures (by this I mean commands defined by the user with the learn primitive);

perhaps importing and exporting procedures would be a better term

at the moment (if I understand things correctly), the program operates from one turtle script that is displayed in the editor, if a new script is loaded the program forgets any previous commands and procedures - it would be a useful feature I think if single procedures or groups of procedures could be imported into a session, they would not have to be displayed in the editor, but the commands (that the imported procedures had defined) would be available to use in the current session

if a session was then saved it would perhaps then include the procedures that had been added or maybe link to the files containing the imported procedures

also if procedures were able to be exported separate to the current session they could be used in other sessions without having to redefine them within the current session

eg I have defined a procedure that draws a square, I export (save) this procedure (just the script with the instructions for drawing a square), in another session I need to draw a square (or several), so I import (load) that procedure and it is then available to me as a command that I can simply type in

regards
Steve

2009/12/18 cies <cies....@gmail.com>

cies

unread,
Dec 18, 2009, 12:36:38 PM12/18/09
to kdeedu-...@googlegroups.com
On Fri, Dec 18, 2009 at 5:32 PM, Steve Redshaw
<stever...@googlemail.com> wrote:
> I think the problem is the kTurtle version available through the Mandriva
> 2010 (KDE4) software repository (the kTurtle version on offer is 0.8 beta)
>
> maybe this is the latest version, but with an old manual?

i dont know. my kununtu does not suffer from this problem, maybe a
problem with mandriva.

> I have looked at the online manual from your link and it answers most of my
> problems and frustrations!!

good. im glad to hear.

> I cannot however get a later version through my
> software updater - as a fairly new Linux user I am still floundering with
> terminals and commands and building an application seems quite a challenge,
> however I have looked at the instructions and will try it out if this gives
> me the latest version

try some mandriva related sources. maybe raise this issue on a mailing
list ("old documentation for kturtle in m2010")

> should be able to contribute some simple projects too in the not too distant
> future

great!

> just to elaborate on the loading/saving of procedures (by this I mean
> commands defined by the user with the learn primitive);
>
> perhaps importing and exporting procedures would be a better term
>
> at the moment (if I understand things correctly), the program operates from
> one turtle script that is displayed in the editor, if a new script is loaded
> the program forgets any previous commands and procedures - it would be a
> useful feature I think if single procedures or groups of procedures could be
> imported into a session, they would not have to be displayed in the editor,
> but the commands (that the imported procedures had defined) would be
> available to use in the current session
>
> if a session was then saved it would perhaps then include the procedures
> that had been added or maybe link to the files containing the imported
> procedures
>
> also if procedures were able to be exported separate to the current session
> they could be used in other sessions without having to redefine them within
> the current session
>
> eg I have defined a procedure that draws a square, I export (save) this
> procedure (just the script with the instructions for drawing a square), in
> another session I need to draw a square (or several), so I import (load)
> that procedure and it is then available to me as a command that I can simply
> type in

i understand what you mean. but from my respective your suggestion
would need a lot of code added to kturtle.
what is the point? i having scripts that draw various things by
"learned" functions, and using copy/paste will do. we have decided
against an 'include' statement -- keeping it simple is most important.

doing things with a gui that have clear analogues in in programming
(with code) are not what we want either: we van to make programming
simple, but not to the extend that it becomes a clicking exercise. :)

kindly,
_cies.

Reply all
Reply to author
Forward
0 new messages