Short courses. It’s a nice way to knock a few classes off the “to-do” list in-between regular semesters. I’d had a few short courses before this August, but never one actually requiring my physical presence. So I set off to face the unknown, which turned out to be a room full of people I already knew, to learn the basics of a programming language I was aware of only in the vaguest sense, (i.e., that it existed and ran some stuff).
Now, learning a language in two weeks is, um, challenging, to say the least. The format of the class Dr. Casey, our instructor, suggested we experiment with helped tremendously. The class was flipped, where we would do the reading and listen to the lectures ahead of time, and then come in to the classroom during the scheduled time and ask questions about things we hadn’t understood. I don’t know if I would have processed the information to the same degree had the class been structured differently.
During the first week, we covered two thirds of the textbook and had assignments to make Java applications that gradually built up from a simple arithmetic calculator to one that converted to and from Roman numerals. (This sounds less impressive than it should, but I assure you it required a lot of effort at the time.)
The class day after our “mid-term”, our final project was announced. With the game robocode, we would be programming our own Java tanks to face off in gladiatorial combat for bonus points on our final.
At the time it sounded insanely over our heads, but as we worked through the lectures and assignments in week two, it started to come together a little more.
Our last day of class, we took our final exam and then watched tiny little tanks obliterate each other on a TV for our amusement. It meant a little more, knowing that we had each had a hand in the building of one of them.
As for robocode: The robots themselves are customizable in almost every way, except for adding outside sprite-work, which means than while you can have a tank in every reasonably conceivable solid color, you cannot add demon wings. So I suppose that is a letdown on the part of the system itself, but that’s really the only one I could find.
To successfully program a robocode tank, you have to keep track of gun heat (a meter that dictates when you have fired too much, too quickly), health (which you lose with each shot fired and gain back with each hit), movement, tracking opponent’s movement, and so many other factors. Even taking a page from Dr. Frankenstein and using sample robot parts won’t get you very far if you don’t know what you are doing. The first time I ran my robot, it spun around in circles, rammed a wall, and was beaten by the sample tank MyFirstJuniorRobot. It took careful study and application of what all we’d gone over in class for two weeks to get a bot that worked passably, and plenty of refinement to get one that worked well.
The very fact that any of us were capable of programming anything resembling a working robot after only two weeks to familiarize ourselves with the language should speak volumes about the course. This blue one here is my little guy:
…which I named Saving Throw, since my strategy hinged mostly on survival. Any number of other strategies exists, and people far more clever and practiced than I have built some pretty amazing bots that they take videos of and post online.
Now that the short course is over with and I have a good grounding in Java, I still tinker with robocode, because I think it’s an excellent way to keep fresh what I have learned, and even pick up a trick or two along the way.
Lastly, to those who will take the Java course in the future, here’s some advice:
- Don’t worry; it’s possible to learn it in two weeks.
- Work early and work often on any assignment, and
- There’s nothing quite like watching your own work in active use, even if that work is a tiny, computer generated, gladiator machine that is crushing its opposition without mercy.