I’ve got into strife before about not being sure about recursion, but now I’m reasonably happy with it… I’d almost go so far as to say that I’ll use it when I can… So I decided to print out a 4-dimensional javascript array using recursion… as a table! It isn’t a proper array as javascript doesn’t do associative arrays… but there you go, anyway, instead of using a nice simple for(var something in somethingElse)
I decided to do the for(var i = 0; var < somethingElse.length; i++)
then thought it’d be a good idea to send it to itself… but i never changed the i
and I ended up with something that Bridget Riley might be proud of ;-):
Dominic Myers writes about all sorts of stuff to do with HTML, CSS, JavaScript and a fair chunk of self-indulgent stuff. Thoughts and opinions are all his own, and nothing to do with any employer.
Thursday, 1 July 2010
Lost in Recursion
Labels:
Graphics,
JavaScript,
Thoughts
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment