Support for the NintendoDS custom puzzle format
Today has been pretty busy for me. Once I released the Polarium clone, a co-worker at my workplace pointed out that the custom puzzles are being specified in a separate format and not the B/W/G format that I had come up with. Here is an example of that format:If you look at the numbers you will have no clue how those numbers map to the Black/White/Gray tiles! I was stumped too. After a prolonged search over the Internet I came across this link that described this encoding format. The description was fairly straightforward and I coded up the decoding logic quickly. The only hitch I faced here was for converting the integer to its binary representation. I used the string Convert.ToString(long value, int toBase) API for this purpose but I found out that the binary representation does not end on a word-boundary. For example for the integer 2862745346, the binary representation turns out to be 10101010101000100000011100000010, whose length is 29 instead of the intuitive 32. This required me to add the padding manually. Frankly I feel the BCL should have given me a binary string of size 8/16/32/64 as it sees fit. Too bad.
Hooking up this format into the program was simple. I added a new file extension (.pol) for this kind of encoding and also created the corresponding parser using GOLD.
With the support for this new format, you can now play more than 1000 puzzles freely available over the internet. That should keep you busy for a loooooooooooooooooong time!
Download Source and Binaries. I christine this v2.0. Visit the Puzzle Archive to play some cool puzzles. Enjoy!