Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: RFC: Language::Logo

by eric256 (Parson)
on Feb 03, 2007 at 16:07 UTC ( [id://598095]=note: print w/replies, xml ) Need Help??


in reply to RFC: Language::Logo

Hey, I love LOGO!

Realy who doesn't? Many of us started programming in logo so it will always hold a special place for us. However I don't think this module does enough to be that logo we miss. I mean you need to supply a full set of programming options so that kids can use it and learn. Learning that I could use repeat to make a circle beat doing it by hand, and then latter learn to use 'to circle :radius' things just got better and better. I think you've made an awesome start, and the client/server idea is genius!, but I think before you go to far with it you should consider what changes to the parser need made in order to accomplish a fuller implementation of LOGO.

/me can remember himself with a notebook full of procedures/functions to try next time he got access to the logo computer! ;)

I was trying to add repeat when I noticed you were splitting up the commands before sending them to the server, i was wondering if it wouldn't make more sense to have all commands just sent to the server raw and have the client be just a very thin client. Off I go to see how to split on ; only outside of ....hmmm


___________
Eric Hodges

Replies are listed 'Best First'.
Re^2: RFC: Language::Logo
by liverpole (Monsignor) on Feb 03, 2007 at 16:51 UTC
    Thanks for the enthusiastic comments!

    Don't worry -- I know it needs to implement more programming options.  But I wanted to create something workable first, get feedback on that, and then go from there.

    There's a lot of of fun you can have driving it around the way it is, even if you have let Perl do the steering.  And you can even write code that looks a lot like Logo.  For instance, using the Spiral example at Wikipedia as a starting point, you could implement a reasonably similar Perl subroutine that provides the same drawn output:

    use strict; use warnings; use Language::Logo; my $l = new Logo(bg => 'white'); $l->cmd("co black; pd"); spiral(10); # # From http://en.wikipedia.org/wiki/Logo_programming_language # (Example_8) "A spiral drawn using recursion" # # to spiral :size # if :size > 30 [stop] ; a condition stop # fd :size rt 15 ; many lines of action # spiral :size *1.02 ; the tailend recursive call # end sub spiral { my $size = shift; if ($size > 30) { return } # a condition stop $l->cmd("fd $size; rt 15"); # many lines of action spiral($size * 1.02); # the tailend recursive call }

    So now that I have the basics working, I will concentrate on what needs to be done to provide more of the Logo language.

    Any constructive feedback is, of course, very welcome!


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

      I had an itch and had to scratch it so I implemented brackets, a repeat command, and a rudimentary ability to define user functions. In order to do most of this I moved the command parsing code to the server itself which means user defined functions are available to any connected clients! ;)

      Drawing a circle now:

      pendown; repeat 35 [left 10; forward 10;];

      Making a circle function:

      to circle [ repeat 35 [ left 10; forward 10;]]; circle;

      I'm not sure what the best way is to get you the changes so I've attached the entire modified version.


      ___________
      Eric Hodges

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://598095]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-18 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found