A new version of Mines Ahoy is up! It turns out that my earlier post titled “Finished!” was a little premature. Not only were there problems that needed fixing, but there were a couple features present in the desktop minesweeper game that were not in Mines Ahoy. In particular, a timer and a list of best times were absent. So, over the last week or so I have completed a major overhaul of the game. The interface is spiffier, there is a timer, and you can see the top 10 scores for each setting (easy, medium, hard, and any custom settings that have been used).

There were many hours spent bent over the keyboard and cries of desperation emitted. I often wanted to give up, but was somehow able to stick with it. The “best times” feature, in particular, was tortorous. I think maybe, not being a cs major, I’m lacking certain habits that would help me move beyond the “write some code, then spend an hour debugging it” pattern. Perhaps I should invest time in writing pseudo-code or use cases. I’m beginning to gain an appreciation for objects. Looking back, using objects for the timer and the images in the buttons was helpful. Of course, the objects in javascript don’t have all the usual functionality of objects in object-oriented programming languages. For example, there are no private methods or data. If I understand them correctly, objects in javascript are basically associative arrays, or maps, that incidentally can include behvavior as well as data because functions can be treated like data (unlike in other languages).

I guess now it’s time to get to Python, though I think I will put aside the Mines Ahoy port for the time being to focus on familiarizing myself with the core language.