
previous

page 8
next
A better way to test is the following. The timeout is to make sure there is time for everything to be loaded. Then add an appropriate test function to my.js.
<script>setup(); setTimeout(test,500);</script>
Well, we now have all the tools we need to draw our first spirolateral. I've chosen 41523 - a rarity in that it contains all 5 digits.
We'll store this pattern in g_pattern and then split it into the g_numbers array. Remember split('') from Project 3?

my globals.js
var g_ctx;
var g_side;
var g_x0, g_y0, g_step;
var g_x, g_y, g_h;
var g_pattern='41523';
var g_numbers=g_pattern.split('');
var g_side;
var g_x0, g_y0, g_step;
var g_x, g_y, g_h;
var g_pattern='41523';
var g_numbers=g_pattern.split('');
previous
next