I use this blog as a soap box to preach (ahem... to talk :-) about subjects that interest me.

Wednesday, September 14, 2011

A CalcuDoku application for the iPad

Perhaps you have visited my DailyCalcuDoku page. There, I provide interactivity with JavaScript, but all the work is done offline by a C application that runs on my server. Every day, a few minutes after midnight AEST (Australian Eastern Standard Time), the system launches the application, which uses the current date as a pseudorandom seed, and generates an HTML file with the daily CalcuDoku.

Actually, I have just realised that if you attempt to play immediately after my midnight, the program will fail. I have to fix it. It’s not nice when a program fails with no explanation. It might not seem a serious problem, but midnight here is 10 AM in Boston and 6 PM in Moscow...

Anyhow, after developing the Daily CalcuDoku software, I thought: wouldn’t it be nice to create an application for the iPad that does a similar thing? I started on 1 September, and the following snapshot gives you a taste of it:

So far, the application reads a file with the list of cages and, when you click on (ahem... when you touch!) one of the cells, it shows the combinations of digits that provide the correct results. For the multiplication, as you can see in the snapshot, it also lists the prime factors.

OK. It doesn’t sound much, yet. But I had to modify the original application to write the cages in a file. Then, after familiarising myself with the development environment on the Mac and with the peculiarities of Objective-C, I wrote from scratch the code for the iPad to display the cages and to calculate the combinations.

Next, I will develop the code to identify the candidates for each cell, and a context menu to let the player interact with the application. Obviously, I will also have to develop the functionality to save and retrieve the context when the player switches the iPad off and back on. And, not to be forgotten, a setup screen and/or a toolbar to choose playing options.

I would like the application to provide hints when requested, but I still have to look into it. I haven’t clear yet what hints would be possible.

I intend to create two applications: one will be free and will contain a limited number of puzzles. The other one, at a low price, will connect to my server to access a new puzzle every day. Also, the full application will be able to download more puzzles, which you can then play offline. Perhaps I should also provide a training mode, in which the player can see different strategies in action. Not sure about that.

Years ago, when Macintoshes were still running on Motorola Chips, before the advent of System X, I developed applications for the Mac. The documentation from Apple was excellent, and the APIs smart. But with the iPhone/iPad, the Apple developers have really surpassed themselves. Sometimes, the interfaces are so well designed and intelligent that they make me smile. This truly is promamming Nirvana! Perhaps it is because, after decades of programming and system design, I can fully appreciate all the thought that went into them.

Sorry for the lyric digression.

I have decided that, in any case, the application will only be available for the iPad, because the screen of the iPhone is too small for so many numbers. Also, the orientation will be fixed to portrait.

I will still need weeks (or longer...) to complete the application. I’ll keep you posted.

No comments:

Post a Comment