Tuesday, April 28, 2015

Debugging the CoffeeScript Bug

I have been working on my project and have been able to finish my third AI, which featured defensive switching, with very little difficulty. However, when I began the fourth AI, I began running into numerous issues. A majority of these issues have to do with CoffeeScript. While I do love the minimalist approach with CoffeeScript, it has a lack of commas and parentheses in many locations, it has proven frustrating at many times. This has caused me to try and call a objects instead of functions. I've also tried to call functions instead of variables. However the biggest headache, by far has been with debugging in CoffeeScript. This is mostly due to the terminal outputting line numbers where an error does not exists, whether it is outside the message, white space, or sometimes it doesn't even exist in the class!























For example, the picture above shows the error on the damageCalculator, which is called from the chooseMove function in strategy on line 118. But the choose move function ends at line 73! This has cause some frustration and slowed down my programming progress but I'm still continuing.

So far on my fourth, and final, AI I have been able to get it to attack. It's not quite predicting its opponent's moves yet, but I will continue to work on this process.

No comments:

Post a Comment