Thursday, 1 July 2010

Lost in Recursion

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 ;-):

Broken Recursion

No comments:

Post a Comment