Wednesday, July 20, 2005

programming

ahhh, the joys of programming... or rather banging one's head on the desk because said program refuses to work for no apparent reason. stupid infinite loops....

I talked with Ford today. I'm going to need to figure out how to get my scheme program to output this specific list of number in binary in order for the simrender program to display it:

X size of the World container (float)
Y size of the World container (float)
Z size of the World container (float)
Number of hostcells (int)
Number of parasites (int)
Number of timesteps (int)

radii for each cell (hostcells followed by parasites) (float)

loop for each timestep
loop for each cell
X location of the current cell (float)
Y location of the current cell (float)
Z location of the current cell (float)
go to next cell
go to next timestep

I'm hoping there is some part of scheme that can output binary, and I'm hoping that scheme is smart enough that the floats and ints won't be a problem. And then there's the fun part: getting it to output just a bunch of numbers. Not a list of numbers, not a list of structures, just plain numbers.

we'll see... Meanwhile I'm still trying to get the program to even work. I've got a sweet idea for a very clean loop for when a parasite tries to exit the world, but unfortunately I have to hardwire six different cond statements (plus an else) for it to check individually because it has to do something different for each one and I can't generalize it. So this neat little idea turned into a monster screenfull of code.

Part of me feels guilty for being so stubborn about making Scheme work in this very C++ project, but I like Scheme, and I know Scheme, and even though it probably looks like using Scheme is nothing but jury rigging, that's only because I'm trying to make it work with C++. It's a very nice language.

You know, C++ is linear--it processes one function after another in order till it comes to the end, but Scheme is circular--if everything isn't interconnected, it doesn't work.

0 Comments:

Post a Comment

<< Home