Skip to content

Instantly share code, notes, and snippets.

@alexpelan
Created March 28, 2017 01:48
Show Gist options
  • Select an option

  • Save alexpelan/ff1996031f0649e66ba912ed7d30d582 to your computer and use it in GitHub Desktop.

Select an option

Save alexpelan/ff1996031f0649e66ba912ed7d30d582 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=ff1996031f0649e66ba912ed7d30d582
<!DOCTYPE html>
<html>
<head>
<title>Tiny Turtle</title>
<script src="https://toolness.github.io/tiny-turtle/tiny-turtle.js"></script>
</head>
<body>
<h1>Tiny Turtle</h1>
<canvas></canvas>
</body>
</html>
// Tiny Turtle Setup. Avoid modifying these lines of code!
var adjCanvasSize = document.getElementsByTagName('canvas')[0];
adjCanvasSize.width = 400;
adjCanvasSize.height = 400;
TinyTurtle.apply(window);
// Start writing code here
function square(){
forward(50);
right(90);
forward(50);
right(90);
forward(50);
right(90);
forward(50);
right(90);
forward(50);
}
function triangle() {
forward(50);
right(120);
forward(50);
right(120);
forward(50);
}
function rectangle() {
}
stamp();
canvas {
border: 1px solid black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment