LogoTurtle is currently the FIRST and only one Chrome Extension for Turtle Graphics. I have also written a PHP version of Logo Interpreter in 2006 but that runs only on the server.
This Commit has the following changes:
Let's put all the above in one LOGO source code to demonstrate:
ht cs screen green color yellow ; test comment
pu moveto -200 20 pd turn 270
repeat 8 [circle 50 fd 10 rt 45]
The MoveTo takes two parameters that moves the turtle to a given coordinate, which is handled by the following javascript.
case "moveto":
expr = this.evalVars(word_next);
try {
word_next = eval(expr);
} catch (e) {
this.pushErr(word, LOGO_ERR_EVAL, expr);
return false;
}
if ((word_next == '') || (!isNumeric(word_next))) {
this.pushErr(word, LOGO_ERR_MISSING_NUMBERS, word_next);
return false;
}
second_word = getNextWord(s, y.next, U);
second_word_word = second_word.word;
expr = this.evalVars(second_word_word);
try {
second_word_word = eval(expr);
} catch (e) {
this.pushErr(word, LOGO_ERR_EVAL, expr);
return false;
}
if ((second_word_word == '') || (!isNumeric(second_word_word))) {
this.pushErr(word, LOGO_ERR_MISSING_NUMBERS, second_word_word);
return false;
}
this.logo.moveTo(word_next, second_word_word);
i = second_word.next;
break;
If an App can be written in Javascript, eventually it will be written in Javascript.
Install the Turtle Programming for Kids Now!
Github: https://github.com/DoctorLai/LogoTurtle
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-feature