Writing robocode was not as exciting as I had hoped it would be. Rather, I found that having a strong background in trigonometry would help immensely. At the very least, was pretty neat that I could design my own robot and have them fight each other.
For some of the uninitiated, robocode was a program originally created by IBM and was later dropped by them and became an open source project. Over the years it created a fan base that programmed robots and even held competitions for it.
I was not able to complete all the assignments which was to implement simple robot behaviors. They were named according to what their behavior was supposed to be. The only ones that still remained were boom02-04 and position05. Again it was my having a weak background in trigonometry that held me back. I spent many days on position04 alone refining the trigonometric calculation so it would give me the correct direction towards the center. Even then it still took detours despite that it was heading in the wrong direction. I felt I could use what I learned from position04 for position05. I was somewhat wrong as I had to account for my robot running into the wall. When I fixed that, I realized I should have gotten a clarification on whether it should be exactly in the corner or near there. At the moment, I have it ramming the wall and reversing to turn a few degrees just like Austin Powers. Boom02-04 all depended on each other and since I could not do boom02, I was not able to complete the rest. Even though there were less trigonometry, I still found it hard to tell my robot when to stop turning its gun.
I learned that robots were very obedient, if somewhat frustrating in that it was completely obedient. Everything about robocode had to be overly specific, with all contingencies covered. Without this exact specific behavioral programming, the robots tend to either die and mislead you or seem to have developed a mind of its own.
Having a set of code katas helped in refining the robot's behavior, but rather they helped in getting my feet wet. Generally, code katas are good practice. Knowing that I spent time practicing this kind of thing gives me confidence in myself, which is important when people start to ask questions. Unfortunately, even with this, I still do not have any ideas or plans on how to create a competitive robot yet. I am not a very creative person.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment