neolateral

programming, drawing, photograpy etc.
PicoTurtle Java program to draw a groovy tunnel

I've also added Java support to picoturtle. Here's a program to draw a rather groovy tunnel. Java code follows.

import in.abhishekmishra.picoturtle.Turtle;
import in.abhishekmishra.picoturtle.TurtleState;

public class Tunnel
{
    public static void cuboid(Turtle t, double b, double w, double h) {
        t.forward(b);

        t.right(-45);
        t.forward(h);
        t.back(h);
        t.left(-45);

        t.left(90);
        t.forward(w);

        t.left(-45);
        t.forward(h);
        t.back(h);
        t.right(-45);

        t.left(90);
        t.forward(b);

        t.left(-135);
        t.forward(h);
        t.back(h);
        t.right(-135);

        t.left(90);
        t.forward …
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 …
VS Code Extension - timed-themes

VS Code is now my primary IDE, it's the IDE I use the most and really like. At home I use a laptop hooked to a large monitor. This setup is in a room with lots of windows and skylights. So during the day, the room lights up a lot and there are a lot of reflections on the screen. So I use a dark theme with lots of contrast during the day. But at night I use a lighter theme with less contrast. I used to switch manually with a two lines in my settings for the IDE theme …

Install gcloud-sdk and Docker on Ubuntu 16.04 on VirtualBox

I use Windows 10 Home on my laptop, so docker integration is a challenge, espescially running all the builds written in shell scripts won't run nicely on Ubuntu on Windows or MSYS2.

So I've had to fallback on installing ubuntu on virtualbox, with docker and gcloud-sdk. I've documented the steps below.

Get VirtualBox

Download VirtualBox

Install Ubuntu on VirtualBox

Get Xubuntu 16.04 ISO. Xubuntu is lightweight and provides a standard desktop. Ubuntu or other flavours should also work.

Download Xubuntu LTS

VirtualBox Guest Config

Config suggested for guest: 1. Min Disk: 30GB 2. RAM: 2GB 3. LVM Partitioning 4 …

Exploring turtle graphics

This week I started exploring turtle graphics with my son as he is very interested in drawing and crafts (he calls his room "art room"). We wrote one program together in python's turtle graphics library. It's here - face.py , and this is what it looks like :)

So this got me reading and exploring a bit more about turtle graphics, especially since the tools and language python were not really easy enough to use for my son. So I decided to create my own turtle environment (currently I'm thinking about doing this in electron so that it's available on all platforms …

A GCD Game!

Recently I've again started reading Dijkstra's book "A Discipline Of Programming". In the very first chapter "Chapter 0 on executional abstraction", he mentions a board game which when played correctly produces the GCD of two numbers. It is just an implementation of Euclid's Algorithm. I wanted to write a program to play this game.

I'd also discovered a library to produce svg animations called vivus, which I wanted to try.

So here's my implementation of the GCD game in html/javascript - GCD Board Game. Note that the numbers are provided using URL params to the html (x, and y are …

First Post!

This is my first post on the new jekyll site on my github page. I'm currently learning node.js using nodeschool.io tutorials. I'm recording my progress at learnnode