<!--
/*************************************************************
* This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com
* Feel free to distribute and modify code, but keep reference to its creator
*
* Canvas Turtle provides LOGO Turtle Grpahics Javascript API
* and LOGO Turtle Grpahic language interpreter for drawing
* objects in Canvas
*
* For more information, examples and online documentation visit:
* http://webcodingeasy.com/JS-classes/Canvas-Turtle-graphics-using-javascript
**************************************************************/
-->
<html>
<head>
</head>
<body>
<div id='logo_div'></div>
<script src="./canvas_turtle.packed.js" type="text/javascript"></script>
<script>
var l = new canvas_turtle("logo_div", {
//width of canvas
width: 800,
//height of canvas
height: 600,
//start value for x axis
});
l.font("20px Arial");
for(var i = 0; i < 4; i++)
{
l.draw(50);
l.turtleprint("Hello world");
l.draw(50);
l.right(90);
}
</script>
</body>
</html> |