neolateral

programming, drawing, photograpy etc.

Articles tagged with picoturtle

First Previous Page 2 / 2
PicoTurtle C# program to draw a wave

Recently I added C# .NET support to picoturtle. I was playing around generating waves... here's an example based on the sine function. And the C# Turtle code follows below.

using System;
using picoturtle;

namespace cspico
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            // Create the turtle before using
            Turtle t = picoturtle.Turtle.CreateTurtle(args);

            if (t != null) {
                // Your code goes here

                t.penup();
                t.setx(0);
                t.sety(250);

                for(double i = 0; i < 500; i+=0.25) {
                    t.setx(i);
                    double sin = Math.Sin(i/15);
                    double y = sin * 100;
                    t.forward(y);
                    t.pendown();
                    int col = Math.Abs …
PicoTurtle released

This week I built the first release of PicoTurtle - a turtle program built on REST/HTTP APIs, allowing programs written in potentially any programming language to draw turtle graphics with it. The desktop editor is built using electron. Download it at PicoTurtle Homepage.

I'll make follow-up posts about how the program works, but here's a dragon curve drawn using picoturtle...

And here's the code... (based on the entry on dragon curve in wikipedia at https://en.wikipedia.org/wiki/Dragon_curve#Code)

from picoturtle import *
create_turtle()

### Your code goes here ###

def dragonCurve(order, length):
    right(order * 45)
    dragonCurveRecursive(order, length, 1 …
First Previous Page 2 / 2