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$..$/
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|