Friday, January 21, 2005

To Excesses

The main problem I'm facing right now is how to make the AI memory file work. Right now I'm using a single RandomAccessFile to hold all the data, but the data may have varying lengths (in reference to the state of the Board before the move, and games won, lost, stalemated using the move) and if I have to update a move, I might overwrite part of another and corrupt the file.

If I use Object Input and Output, the entire file will be rewritten after every game, and that may become extremely time-consuming when the AI gets experienced.

Alternately, I could do separate files: one for each player, or one for each possible state of the Board (which would be a lot of files). But then the same questions arise... Or: I make a different folder for each possible move (of each possible board state), and they contain the numerical data which I don't have to worry about (ints are always 32-bit). What should I do?

Until next time, remember: Answers exist, even to the unanswerable questions.

---TDM

No comments: