12 Tiles


After tinkering for a while, I released a new game today - 12 Tiles. Nothing flashy or fancy, just a little puzzle game with sliding tiles. While looking a bit like the classic 15-puzzle, the game mechanics are different and tailored for touchscreen manipulation. Instead of having a single "free" square, moves are limited by the need to find sequences of increasing numbers, and only being able to move low-numbered squares across higher numbers.

The project basically started with me wanting to learn more about web programming, and try writing something small in HTML5 and JavaScript, to be played online or saved offline. I came away liking it more than I expected - the entire app is about 25kB of code that increasingly turned to spaghetti as I was putting the finishing touches, but never got bad enough that I turned away in disgust. Undoubtedly a larger project wouldn't be so lucky, so I'm glad I got some good experiences and lessons from this one.

As an actual game, it does manage to achieve "easy to start solving, hard to solve completely". However, I worry that the mechanics of the endgame might be too opaque - I actually haven't yet found a satisfying strategy for the endgame (*), and I hesitate to compute one until I've solved the problem myself (**).

An interesting sub-problem in making 12 Tiles was finding "interesting" starting positions. A completely random board might either be too easy, or impossible to finish. Luckily, there are only 12! possible starting positions (about 500 million), which is few enough that a computer can fully solve the game for any starting position in under an hour. Only 0.5% of boards are "impossible" - meaning there are no legal moves. After that, the most difficult possible starting positions tended to be frustrating situations where 3 of the 4 possible first moves would leave the board in an impossible state, which is not a good first experience. Using a combination of "many moves required for finishing the game" and "can't reach an impossible state in few moves" turned out to be a better criterion for finding interesting starting boards.

Give it a spin - it's best on touchscreen devices but a mouse will also work. I hope you like it.

(* My first foray into making touch-based puzzle games was better in this regard - I had played with it for a while without "getting it", and I literally solved it while taking a shower and thinking about the possible moves and combos. Unfortunately, I wrote (or half-wrote really) it for iOS and ported it to Android, but didn't bother finishing the product and putting it on either app store. Maybe it will come back in an HTML5-version.)

(** I approached the Rubik's Cube the same way - first finding my own solution with only pen, paper and headscratching; and only later learning a quicker method online.)




When thinking about writing, or blogging, it has struck me how much easier it is to react than to act. Here's what I mean: When someone else brings up a topic, it's oftentimes easy to respond. Perhaps there's something you didn't like about it, or some thought was triggered by what you read. Linkblogs are the ultimate embodiment of that: Something happens in the world, someone else reports on it, which triggers comments or responses. Sometimes entire chains of them.

I also sometimes watch The Daily Show. It's basically built on the concept of reacting to others' reporting. Which is fine. There's definitely room in this world for reaction, and commentary, and so on. When I see or read something, and I have an opinion, I feel like sharing that opinion too.

But I also read Seth Godin's blog. He posts every day. There are certain topics that are close to his heart, and he returns to them again and again. But in contrast to the examples above, he's always acting. Something is on his mind because he's passionate about it, not because he read about it in the news, or on some blog. He wants to share his thoughts, writing unprompted, every day. Very impressive, and very inspiring.


Note to Self


Like many others, I find it hard to write because whenever I come up with something to write about, I tend to paralyze myself by overthinking things, and applying my own impossible standards. I want each post to make a point, preferably original, written in impeccable prose: A nugget of literary perfection. Something I can be proud of, and that will withstand the test of time. And so, instead of writing, I sit down and worry about the quality of my writing, or the originality of my thoughts. Or I fall into the trap of doing research to educate myself about others' points of view, and to perhaps trigger some thoughts of my very own. Obviously, "doing research" in this context is indistinguishable from "procrastination".

Welcome to the proverbial "perfect", enemy of the good. Through this process, I usually succeed in writing nothing but stuff I can be proud of. Which is to say, nothing at all.


A while ago, I read Shawn Blanc's Here's to the Future, and from there Jeffrey Zeldman's Past Blast, where he discusses the phenomenon of being embarrassed about past work. It's a familiar feeling, but he gives it a new interpretation by reversing the perspective: looking back by looking forward, at the progress you've made since the past work was done. In Zeldman's words, "if your old work doesn't shame you, you're not growing".

What a refreshing point of view! Of course, years from now, I will know things I don't know now. And I hope that I have improved in skills I care about, including writing. Not only is it useless to worry about past work being embarrassing — worrying being among the least useful activities there are — but it also misses the point: an essential aspect of personal growth is that your view of your past work changes. It's not getting any prettier.

While that covers the past, I actually think it can be extended to the present. Growth isn't something that just happens, it requires work. And finding areas of embarrassement is pretty close to finding fertile areas for growth, because it's the intersection of things I care about, and where I don't live up to my own standards. My tendency to sometimes compare myself to best-in-class-practicioners isn't helping: Obviously as a beginning writer I'm not going to fit among them. But equally obviously, none of them, X years back, would fit either. However: that didn't stop them.

I'm sure it stopped many others. You just don't think about them, because you never read anything they wrote. How could you?


When trying new things, sometimes I'm doing alright, due to luck, or talent, or related skills, or whatnot. Other times I'm terrible, due to bad luck, or lack of talent, or because there's a wide gap between beginners and experts. However, the state of being a beginner gives perfect cover — mistakes are expected and improvements come quickly. It's the step after that's the killer. Seth Godin calls it the Dip. It's there that I get paralyzed by my refusal to produce something embarrassing, or even something that may become embarrassing when looking back at my "old work". Even though that's what's supposed to happen!


Zeldman ends with "When you look at old work, it should suck glaringly and you should cringe painfully. But there should also be some germ within it that you're not ashamed of some spark of talent or inspiration that connects to what you do now."

Which is a nice sentiment, but I don't think the work itself needs to have any redeeming qualities whatsoever. Instead, you can be proud of the process, and the person: the person who faced embarrassement, but instead saw an opportunity to grow. Who got (or kept) the ball rolling, without being intimidated by the expert ball-rollers so far ahead of him. And who can, years later, look back at both the embarrassement and the progress, knowing that they are two sides of the same coin.


So, future me, if you ever come back to read this: I hope it made you cringe. But also made you think about how far you've come.




I think my monitor has a relationship problem. With power cables. Let me start from the beginning.

Back in 2010, when 109 dpi was a decent resolution and my eyes were unspoiled by retinal bliss, I bought a Dell 27-inch monitor. Life was good, if unsharp, but I didn't know any better.

In late 2012, something inside the monitor broke, and it started displaying a funky double-wide wrapped pattern. Perhaps it realized 2012 was the year of the 21:9 widescreen monitors, and it was trying its best to fit in? Or it got inspired by the recent pixel-doubling of OS X with retina screens, and it tried too hard to live up to that? Who knows? Anyway, under Dell's warranty program I got a free replacement, and all was well. Or so I thought.

Earlier this summer the monitor suddenly wouldn't turn on. Pushing the power button produced no beep, no LED, no nothing. I had not unplugged or replugged it for a while, and the day before it had been just fine. Unplugging and replugging power and video cables solved nothing. Some cursory googling didn't turn up any widespread issues, only some support pages instructing me about the "factory reset" which I did to no avail. So I figured I'd gotten unlucky with the replacement and prepared to contact Dell support again.

On a whim I thought about the power cable, which actually seems like the least likely thing to spontaneously break - it's not a transformer or converter or anything, just carries AC from the wall to the monitor, and I hadn't even been messing with it. On the other hand, it was literally the only user-serviceable part, so I thought why not? And to my surprise, with a new cable the monitor started happily! And all was well again, or so I thought.

Today, the monitor wouldn't turn on. By now it's out of warranty, but I'm not yet out of spare power cables, so I figured I'd give that trick another try. Lo and behold, with a new cable, the monitor is back alive! While I'm happy about it, I have to say it's pretty weird. I was willing to believe one cable could somehow crap out, but two of them, a few months apart? So I tried the other cable on my PS3, and it's perfectly functional. And I dug out the rejected cable from before (it's been in the "waiting-to-be-recycled"-pile), and it also works fine with the PS3.

So now I don't know who to trust anymore, but I'm pretty sure it's not my monitor. And so I come up with a cunning plan - will the monitor now work with the cable it rejected earlier in the summer?

It does!

Which leaves me with the only conclusion that my monitor isn't dealing well with long-term power cable relationships. To coin a phrase, sometimes it needs a new one in order to be turned on. And while it's pretty annoying behavior, I have to admire the subtlety in which the machines are becoming more and more human.


A new Beginning


A few years ago, I blogged in Swedish at alltmastebeskrivas.blogspot.com. Not sure why I stopped, but I figured I'd try again here.