Difference between revisions of "Turtle spiral"

From JSXGraph Wiki
Jump to navigationJump to search
Line 16: Line 16:
 
function run() {
 
function run() {
 
   brd.suspendUpdate();
 
   brd.suspendUpdate();
   var code = $('inputtext').value;
+
   var code = document.getElementById('inputtext').value;
 
   if (code=='') { return; }
 
   if (code=='') { return; }
 
   eval(code);
 
   eval(code);
Line 35: Line 35:
 
function run() {
 
function run() {
 
   brd.suspendUpdate();
 
   brd.suspendUpdate();
   var code = $('inputtext').value;
+
   var code = document.getElementById('inputtext').value;
 
   if (code=='') { return; }
 
   if (code=='') { return; }
 
   eval(code);
 
   eval(code);

Revision as of 18:34, 29 October 2009


Source code

<jsxgraph width="600" height="600">
var brd = JXG.JSXGraph.initBoard('jxgbox', {originX: 300, originY: 300, unitX: 1, unitY: 1});
var t = brd.createElement('turtle');

function run() {
  brd.suspendUpdate();
  var code = document.getElementById('inputtext').value;
  if (code=='') { return; }
  eval(code);
  brd.unsuspendUpdate();
}
function clearturtle() {
  t.cs();
}
run();
</jsxgraph>

External links