You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//raw.github.com/davidbau/jquery-turtle/master/jquery-turtle.js"></script>
<script src="//raw.github.com/jashkenas/coffee-script/master/extras/coffee-script.js"></script>
<script type="text/coffeescript">
eval($.turtle())
pen 'red'
for x in [1..4]
lt 90
fd 50
</script>
</head>
</html>
Explanation: The first line of the script, eval($.turtle()), initializes the (optional) interactive console and creates the (optional) default global turtle.
The rest of the script just draws a square with this global turtle: pen controls the color, lt turns left, fd moves forward. Indents are significant in CoffeeScript and punctuation is minimal.