Skip to content


C/C++ is a language that hates the programmer, mostly for stupid reasons. It’s not a bad language, really. It’s just not what you might call user-friendly.

I have an AI project due tomorrow. It’s pretty simple: we have to produce something that plays tic-tac-toe in three dimensions on a board four spaces across. So my project partner and I started working on it this afternoon.

We took maybe two hours to do the algorithms, the data representation, all the tough parts. Test programs showed that it was working fine.

Then we spent four hours making the IO work, because the thing has to talk to a referee and for whatever reason just didn’t want to parse the data that was being passed to it about the state of the board.

We are using C++ for efficiency, because there are a lot of crazy optimizations that work in that language that you can’t do in many higher-level ones. We need efficiency because there is a tournament, and each player gets only one minute of realtime to make their move. It’s a really good language when you need to do efficient fast manipulation of strange data structures, deep recursive functions, experimentation and problem solving. It’s a really bad language when you just want to parse input sent to you over standard input.

Our player works now, and has been demonstrated to win a game played against itself. Tomorrow’s work will involve implementing an idea I had which, if it works, should make it have snap decisions about trees which are obviously good or bad, and explore ambiguous ones much more deeply. Also we will be working on implementing a timer system in a separate thread so that it can go explore trees without having to worry too much about losing for going overtime. I just wish that we hadn’t been required to spend as much time as we did on the IO, so that we could have worked on some of that tonight.

RSS feed


No comments yet.

Sorry, the comment form is closed at this time.