Dykata – my first Android app
Wow, 5 years since my last post. That’s an unfortunate record, but not surprising. I started this blog to help me land a better job, and now that I’ve held one for a while and still like it, I haven’t had much need for this place. Yet here I am again, not because I’m seeking work, but because I have something kinda cool to show off.
My newest project was actually inspired by my awesome cousin. He came up with an idea for a logic puzzle that’s best described as sudoku, but with less math and more art.
Here’s the very first prototype:
Now I’ll explain the rules.
- There are 4 colors – red, yellow, green, and blue
- There are 4 shapes – star, circle, triangle, and square
- The object of the puzzle is to fit one of every color into each row and column, as well as one of every shape.
- Additionally, you have to fit every possible color of every shape somewhere on the grid exactly once.
So, for instance, within the same column you couldn’t have 2 circles or 2 red shapes. And over the whole grid, you couldn’t have more than one blue triangle, for example.
In a given puzzle, some values will be filled in already. You might know the color, the shape, or both for any given space on the board.
Back to this particular puzzle, the star in the top left corner is shown as black because its shape is known, but not its color. It’s the job of the puzzle solver to figure out what color it should be.
So, for instance, the place most people would start in solving this would be a yellow triangle between the blue star and red square. Next, you might put the green triangle into the grid on the bottom left corner, since that’s the only place a green triangle can fit at that point. The puzzle continues along those lines until it’s solved.
In my case, I used some colorful unicode characters to play around with it on my own computer until I had a solution:
I was so taken by the possibilities of this game that I spent the next few days knocking together a way to play it in a webpage. The first result lives on here:
To play, click on one of the squares in the upper grid. That will let you specify a color, shape or both using the options in the bottom 2 grids, unless that value was already set by the constraints. If you make a mistake and can’t figure out what went wrong, you can hit reset to start over with just the original constraints and all your selections removed.
By the time I was able to play it whenever I wanted, one of the first things I realized is that the game could be much more challenging if it used 5 colors and 5 shapes instead of the 4×4 that my cousin’s first puzzle used. Building an algorithm that could generate random 4×4 puzzles was a challenge all unto itself, but it turned out my algorithm wasn’t nearly efficient enough to generate a 5×5 in a reasonable amount of time. So I ended up having to do a lot of work on it to get it to the point where I could do this:
For the record, I still can’t generate a 6×6, though not for lack of trying. The complexity of the problem grows enormously with each added color and shape. If I ever crack that problem, I’ll be pretty happy to see if I can actually solve a 6×6.
Anyway, that was the point where we decided to finally name the puzzle and give it its own home on the internet. Originally, we were going to call it “dichata” to suggest the term “dichotomy” as well as to invoke the 3 hard syllable sounds of sudoku. However, since “dichata” was taken already, we went with the spelling “dykata” and now Dykata.com is where you’ll find this guy in all its glory, complete with prettier graphics and Google adsense (because hey, that domain cost $10 to register so we have to make up our costs somehow).
But in my mind, the web-based version of this game was just a prototype for what really deserves to be an app you can play anywhere, whether or not you’re connected to the internet. So I coded it up using Android studio (an awesome and free IDE from the folks behind JetBrains) and submitted it to the Amazon app store.
Why the Amazon store and not Google Play, you might ask? Simple – Amazon was free whereas registering as a developer with Google was going to cost $25. Did I mention I was doing this on the cheap?
So at long last, here’s the link where you can get it for yourself, provided you have the Amazon app store installed on your phone and you allow apps from unknown sources.
As apps go, it’s pretty basic. There are 5 difficulty settings to choose from. I discovered I could make the puzzle a lot easier by randomly adding constraints so that there was less to solve for yourself. If the first two puzzles on this page were a little too tricky, don’t feel bad. Most people start off by playing beginner.
What it’s missing is a way to save your high scores, a way to share your best times with friends on social media (though taking a screenshot and posting to Facebook is still a viable option). It should also have its own sound effects and maybe some light background music, and probably most important, it should either have a LOT more puzzles pre-installed or be able to generate its own on the fly the way the website does. Play it for a day or two and you’ll start noticing the same puzzles over and over.
But it is fast, light, and easy to use. It also hasn’t got any ads and it’s free. If it proves popular, and I hope it does, I’ll do some more work on it to address its current shortcomings, but in exchange for that work I’ll either add some ads or charge for it.
If I do, I might even come back to my lonely little blog and update this post. Though honestly, it took 5 years to get me back here, so I’m not sure if that would be enough to get me back again.
May 11 2015 | Uncategorized | Comments Off on Dykata – my first Android app