Lessee...
How many lines of code?
Well, it *was* a while ago...I think it was in the neighborhood of 700 lines, give or take. Could've been done much more economically via recursion, as I alluded.
How big was the maze? How many dead ends?
Somewhere in the neighborhood of 250 x 250, if I recall. The matrix (if you'll forgive the term) was constructed via a text file, with dashes and bars (|) being walls, and spaces being, appropriately enough, empty space. The display itself was text only, with Algernon being an 'm.' A lot of my classmates spent huge amounts of time building the text files by hand, but driven as I am by a fundamental laziness (which has on ocassion served me well in my programming life), I built a small utility to create the text file based on a few input parameters. Child's play, of course, but I was proud of myself in first-year programming :-)
The number of dead ends depended on the design of the maze, however Algernon created his own pseudo dead-ends as he wasn't allowed to back-track unless it was his only remaining option.
Did you use some kind of timer to get 'Agernon' moving.
No, not specifically. He came to life when the program started.
Did you use cartesian coordinates and line equations?
No, although it sure would've spiced things up! Algernon was one of those up-down, left-right kinda mice :-)
Looking back on it now, it really was a very simple little thing, which is exactly why it was so surprising to watch the little guy "hunt and peck," as it were, as if thoughtfully looking for his cheese. All an illusion, of course, for the most part just me seeing what I wanted to see.
Space/Science » in reply to re: Very cool Mcfly.
re: Very cool Mcfly.
