"Pascal HTML5 graphics" or "What Opera did with Rainbow Dash"
I saw Turbo Pascal code on the thematic site dedicated to the My Little Pony series , using the old Graph module and drawing several characters.
The code contained only function calls and comments, javascript perfectly its parsil. It remains only to add their graphic functions.
Final version
Here's what happened.
Opera didn’t react well to my implementation of the ellipse () function: the

bug was reported.
But I did not stop there, and the result can be observed here .

At the moment I’m thinking how else can all this be accelerated. Ideas?
The code contained only function calls and comments, javascript perfectly its parsil. It remains only to add their graphic functions.
Final version
var colors = ["#000000", "#0000AA", "#00AA00", "#00AAAA", "#AA0000", "#AA00AA", "#AA5500", "#AAAAAA",
"#555555", "#5555FF", "#55FF55", "#55FFFF", "#FF5555", "#FF55FF", "#FFFF55", "#FFFFFF"];
function setcolor(colorIndex)
{
ctx.strokeStyle = colors[colorIndex];
}
function line(x1, y1, x2, y2)
{
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.stroke();
ctx.closePath();
}
function setlinestyle(p, t, width)
{
ctx.lineWidth = width;
}
function setfillstyle(t, colorIndex)
{
ctx.fillStyle = colors[colorIndex];
}
function ellipse(x, y, st, end, xrad, yrad)
{
ctx.save();
ctx.translate(x, y);
ctx.scale(xrad, -yrad);
ctx.beginPath();
ctx.arc(0, 0, 1, st * Math.PI / 180.0, end * Math.PI / 180.0, false);
ctx.restore();
ctx.stroke();
}
function fillellipse(x, y, xrad, yrad)
{
ctx.save();
ctx.translate(x, y);
ctx.scale(xrad, yrad);
ctx.beginPath();
ctx.arc(0, 0, 1, 0, Math.PI * 2, true);
ctx.fill();
ctx.closePath();
ctx.restore();
}
Here's what happened.
Opera didn’t react well to my implementation of the ellipse () function: the

bug was reported.
But I did not stop there, and the result can be observed here .

At the moment I’m thinking how else can all this be accelerated. Ideas?