The fudge factors
I
spent this morning before lunchtime writing code for a checkers player.
Once I understood what the proper data structures and algorithms were,
it took me about two hours to write and debug the code needed for
efficiently representing the game board and generating all legal moves
from the given state. Once that was done, writing the basic minimax
algorithm for move selection (including alpha-beta pruning and
transposition tables) was of course a snap. I didn't write anything but
the most rudimentary user interface, so I couldn't play against the
machine yet to see which one of us is smarter, but I tested the code
with some checkers problems that I found, and it solved them all
correctly, so at least that's promising.
The next thing to do is to see how much other well-known algorithmic game playing techniques and optimizations could speed up and improve the gameplay. The code is also a bit messy at this point, and I can see many places to both clean it up and to make it run faster. But already this thing feels like it would be an excellent example to go through in my next book, so I feel quite productive. Better keep going with the flow as long as it's on.
In other news, tonight is the midterm exam, which is funny because it feels like this semester hardly started. As usual, during the previous lecture we had a review session, in which we went through the material covered in the first half of the course in form of a long series of questions. At many of these questions I could explain some additional stuff that can't really be a part of the course. One particular example delightfully provoked the students to ask additional questions for a staccato that at least felt like it went on for ten minutes, since every answer that I provided led to additional things to learn and ask about. But it felt quite natural so that even though the topics discussed were sometimes rather esoteric, high-flying and not really suitable for a first course, most students seemed to grasp them simply because I could explain them in such a natural fashion. I wish every lecture always went like that.
The next thing to do is to see how much other well-known algorithmic game playing techniques and optimizations could speed up and improve the gameplay. The code is also a bit messy at this point, and I can see many places to both clean it up and to make it run faster. But already this thing feels like it would be an excellent example to go through in my next book, so I feel quite productive. Better keep going with the flow as long as it's on.
In other news, tonight is the midterm exam, which is funny because it feels like this semester hardly started. As usual, during the previous lecture we had a review session, in which we went through the material covered in the first half of the course in form of a long series of questions. At many of these questions I could explain some additional stuff that can't really be a part of the course. One particular example delightfully provoked the students to ask additional questions for a staccato that at least felt like it went on for ten minutes, since every answer that I provided led to additional things to learn and ask about. But it felt quite natural so that even though the topics discussed were sometimes rather esoteric, high-flying and not really suitable for a first course, most students seemed to grasp them simply because I could explain them in such a natural fashion. I wish every lecture always went like that.
Comments