
Game about squares - golergka
http://gameaboutsquares.com/
======
Sephr
The author is intentionally limiting this app to touch-only for touch-capable
users. This breaks the game for anyone wanting to use a touchpad or mouse on
their touchscreen laptop.

The offending code (from
[http://gameaboutsquares.com/game.c.js](http://gameaboutsquares.com/game.c.js),
beautified):

    
    
        (function($) {
            try {
                document.createEvent("TouchEvent");
                return;
            } catch (f) {}
            var eventMap = {
                mousedown : "touchstart",
                mouseup : "touchend",
                mousemove : "touchmove"
            };
            // mouse handling code follows
    

Never do this! Remove the entire try-catch block. There is absolutely no
reason for you to be limiting touch-capable users to touch-only.

~~~
gk1
I use a touch-enabled laptop and come across this far too often. Even
nytimes.com is guilty of this, as is Stripe Checkout.

~~~
agmetcalf
We actually changed this recently in Stripe Checkout. Touch detection worked
great for 99% of cases, but serving a touch-only experience to devices like
yours was pretty clearly unacceptable.

We're now treating the touch-only versions as optimized for specific
platforms. For example, we have a mobile version that is optimized for, and
only displays on, Android and iOS. Going forward, we may explore a pointer
event polyfill to improve support for less common touch devices.

~~~
gk1
I stand corrected. Thank you for finally making this change... It's been
driving me mad.

------
laxatives
I like the game and that it teaches you the rules as you play without needing
any explicit instructions. I thought some of the comments between levels were
annoying. Also the little flag in the corner indicating you're over the
correct target could be a little easier to see at a glance.

Just curious, how do you design these levels? Work backwards from the
solution?

edit: I'm a little further in, and I'm starting to think the annoying comment
thing is on purpose...

~~~
integricho
I specifically liked the comments between levels, it was obvious what he did
there after the second message :)

~~~
ppod
Are you from the US? I'm from the UK and I really liked the comments too. I
really find that people from the US are more likely to dislike humour in this
kind of game. Especially Californians.

~~~
russellbeattie
Ever notice how people from the UK tend to generalize in a condescending way
that only really serves to highlight their backward, provincial attitudes?
Sort of like this?

~~~
ppod
It's a cultural difference I have noticed across a lot of copy evaluations.
But you chaps sure seem sensitive about it.

~~~
diminoten
We're not too keen on folks being wrong, it's true.

------
CyberShadow
Solver and solutions:

[https://gist.github.com/CyberShadow/39f43cf25dac0534f8a9](https://gist.github.com/CyberShadow/39f43cf25dac0534f8a9)

The solver uses BFS with delayed duplicate detection for pruning visited
states (instead of, say, hash tables).

The DDD part can be summed up in two lines of code:

    
    
        prevStates = (prevStates ~ states).sort.uniq.array();
        states = nextStates.sort.uniq.setDifference(prevStates).array();
        // ... expand states into nextStates ...
    

These were part of the solver's code at one point, although now I've expanded
them a bit to improve memory efficiency.

I love D.

~~~
andor
DDD was new to me, and I was wondering how sorting all previously visited
states could be faster than checking a hash table. The answer appears to be:

1\. Duplicate detection is done _delayed_ and in bulk, not after expanding
each node

2\. The linear memory access of the bulk check is more cache friendly than
random-like hash table access

Allow me to quote from the first Google result:

 _Surprisingly, delayed duplicate detection is useful even when all nodes fit
in memory, resulting in reduced running time due to improved cache
performance. In the standard implementation of breadth-first search in memory,
the Open list is stored in a hash table. As each new node is generated, it is
looked up in the hash table, which often results in a cache miss, since the
hash function is designed to randomly scatter the nodes._

[http://www.ijcai.org/Past%20Proceedings/IJCAI-2003/PDF/267.p...](http://www.ijcai.org/Past%20Proceedings/IJCAI-2003/PDF/267.pdf)

------
ardemue
Really liked the game, but I'm colorblind and it blocked me on level 20: I
can't tell which square should go on which circle (
[http://imgur.com/CX7XWJ4](http://imgur.com/CX7XWJ4) ). I genuinely played
that level as if the two bottom squares were the same. Maybe you could add
another differentiator, like a different shape.

~~~
pdpi
It's always a bit of a shame when software provides no affordances for the
colourblind. It's not nearly as uncommon as some people think it to be. Games
and visualisation software tend to be particularly bad culprits in this.

(Also, you want the one on the left)

~~~
MattHeard
While software should be designed with accessibility in mind, ideally this
could be managed by the display, allowing applications to be agnostic to the
needs of colour blind users. Would it be possible for displays to insert a
colour-transformation layer to shift all colours to different palettes which
are more distinct for each type of colour blindness? This might only work for
partial colour blindness, but does anybody have an idea of accessibility
software like this?

~~~
pdpi
AFAIK, colour blindness ranges from barely an issue to an almost complete
"grey-scale" style of insensitivity to colour. In general, the only safe
design choice is ensuring that no decision-critical information is conveyed
through colour alone.

~~~
rplnt
So, service idea: pass a complex color-blindness test (on your setup) and it
will generate a color profile suited for you (and your setup).

I wonder if it is possible without ruining the appearance of everything else
(never really looked into how color profiles work).

~~~
gabriel34
The bad thing about this idea is that it wouldn't be reliable for the user's
eye because of the variation of color representation across screens.

The good side is that it would be a correct representation of the accuracy of
color recognition of the system screen-eye, which is much more relevant from a
design perspective.

------
ashishbharthi
Advice to author. Create iOS and Android versions of games ASAP. You are just
hours away from getting cloned on app stores.

~~~
dpcan
I'm hoping the author is way ahead of us. If he were smart, the game should be
approved in iTunes and uploaded to Google Play, just ready for him to click
"Publish" the moment this web version picks up some traffic.

Otherwise, Google Play will have a clone by the weekend if not sooner, and
iTunes, maybe a week or two.

~~~
campugnatus
I'm the author. I'm not very smart...

~~~
Freeboots
You probably should at least phonegap it asap, someone is bound to copy this,
its a good game! well done

------
malvim
Beautiful, polished, fun! Contrary to most people here, I actually like the
comments between levels, and the "no instructions" policy just made it better.
I wish more games were like this.

Nicely done, I have no negative comments to make. I'd totally pay for this.

~~~
panzi
One can argue it isn't "no instructions". The symbols have colors and arrows.
How much more do you want? Someone that can't figure out how it works from
that won't get very far anyway.

------
Monkeyget
There are game stats:
[http://gameaboutsquares.com/statistics.html](http://gameaboutsquares.com/statistics.html)

~~~
henpa
Can someone tell me how those graphs were made? They look cool. I tried
looking into the HTML code, but couldn't find the info "right away".

Edit: got it. [http://www.flotcharts.org/](http://www.flotcharts.org/)

~~~
sanketdasgupta
It's right at the footer of the page, "Using flot 0.8.3"

------
tobias2014
It should be possible to write a solver for this with a "decision tree". There
are decisions where the blocks run out of the screen - you ignore these. You
only take into account "sensible" decisions (this has to be formalized). When
there are multiple possible "sensible" decisions you branch. One decision
consists of an action "click x times on block X and y times on block Y …"

~~~
thomasahle
Any solution is on the form 12232322... where the number expresses what square
to click. It's pretty easy to brute force the game from there. Sure, you can
use tree search and prune the search a bit, but it's still brute force and may
take exponential time for tough levels.

You can also look into some of the research that has been done on Sokoban
AI's.

~~~
Strilanc
There's no need to search all move sequences, because so many of them end up
in the same game state (a game state is a combination of positions and
orientations of arrows, with a cut off on positions because far away ones
because don't affect whether there's a solution or not).

Of the levels I saw (up to 31), the relevant board area was never more than
20x20 and there were never more than 4 arrows. So the state space had size 16
_(20_ 20 choose 4) ~= 17 billion. Of course _most_ of those states won't be
reachable from the starting state... so the actual number of states you need
to explore is probably more like a million or even a thousand.

I think a program could solve all of the game's puzzles in under a second.

~~~
Zimmux
I've written a solver that does exactly that here, it prunes positions whose
blocks are too far outside the bounding rectangle:

[https://gist.github.com/Zimmux/c0fdb3ddad654b6b0ae2](https://gist.github.com/Zimmux/c0fdb3ddad654b6b0ae2)

~~~
Hello71
not quite right; some levels like 18 have loops, so some paths have no end
state.

~~~
Zimmux
Should be fixed now.

------
agumonkey
Suggestion : add keybindings. I'm spoiled by 2048 I want direct repeated
manipulation at my finger tips. :)

~~~
S4M
Maybe tab to change the selected square and enter to make it move, since
there's only one direction?

~~~
agumonkey
For up to four squares (npi) I thought a simple mapping A S D F would do.
Pressing A pushes Square A in its current direction. Squares would have the
letter tagged on them subtly.

------
macu
Cool concept, not a fan of the pointless commentary after the premise was
clear (took two seconds to figure out).

------
k_os
From level 25 forward ( minus 26, spirals seem to be easy to simulate for my
brain ) it's a fascinating example of how your subconscious bruteforces.. I
managed to finish 25 and 27 but I honestly have no idea how I did it and if I
had to do it again it'd take a while.

I was wondering, for you guys out there that went past 25, were you able to
visualise how the puzzle worked and plan out the moves or did you try
different stuff until you got in a situation that seemed solvable and then
baffled at the realization that you actually did it?

~~~
JoshTriplett
I found myself following a constraint-satisfaction approach to prune the
search. I'd quickly work out the unrecoverable conditions to put constraints
on the overall possible moves, then start thinking about possible states both
forward from the start and backward from the solution, and consider the
requirements to reach those states. That tends to produce new unrecoverable
conditions and prune the search further.

Still, even with all of that, there was usually one particularly hard state to
achieve that required some unusual step, and everything else mostly fell into
place afterward.

~~~
k_os
You perfectly described my process so now there's 2 data points. If anyone
else had some different way please share.

~~~
anatoly
Everything you said, plus - in the last levels I usually tried to find "the
difficult thing" first. After looking at the push directions a bit, it becomes
obvious that the difficult thing is going to be to position the red square,
say. Then imagine possible solutions to the difficult thing, and go both
forwards (after it's done the end is usually close) and backwards (how to set
up the solution).

------
Thiz
I love this kind of games. Reminds me of good ol' Sokoban.

Where are the mobile versions? I'd like to play it in my iPad.

Kudos.

~~~
thisjepisje
Sokoban rules, you can get it for free here:
[http://www.abandonia.com/en/games/231/Sokoban.html](http://www.abandonia.com/en/games/231/Sokoban.html)
You need DosBox to play that. But there's probably a multitude of online
clones as well.

~~~
psawaya
I made a web based one a few years ago which I'll take the opportunity to
shamelessly plug: [http://sokobanjs.com](http://sokobanjs.com)

~~~
abecedarius
And here's a text-terminal version in a couple pages of Python:
[https://github.com/darius/sturm/blob/master/sokoban.py](https://github.com/darius/sturm/blob/master/sokoban.py)
\-- I'd like to see more small, readable game implementations to learn from.

~~~
psawaya
Great work!

~~~
abecedarius
Thanks! I liked how your JS one shares solutions.

------
psawaya
This is great. I'm especially impressed with how the game teaches its own
mechanics without ever spelling anything out.

------
coder23
I gave up on level 28. Solving it would require pen and paper or some serious
thought. The difficulty curve is excellent.

~~~
wubbfindel
I've gotten to 31 without the need for pen & paper - but yes, your right, the
difficulty balancing is great. It's had me scratching my head a couple of
times, but not so much to cause me to quit.

Sign of a good game.

~~~
coder23
No idea why you got downvoted.

Such silliness really drives me away from hn.

------
fernandotakai
I'm quite impressed that this works really well on firefox for android. really
smooth and the interface is great.

------
lifeformed
My strategy with the harder levels was to divide it into 2 parts:

1) Ignore the colors and just figure out how to get the pieces on the goal
squares (working backwards helps a lot).

2) Find a cyclical part of the puzzle that lets you swap the order of tiles.

Then you just look for any color-agnostic states in Part 2 that overlap with
Part 1.

------
PeterWhittaker
With cookies disabled, it tells me I have an "old and rusty" browser. How odd.

(FF 31 on OSX, why do you ask?)

~~~
LukeShu
I also got that with FF 31.

For me, it was because I had dom.storage.enabled=false. LocalStorage obeys
cookie settings, so I guess disabling cookies would do that too.

------
devilsbabe
Not working with the mouse on chrome 36. My laptop has a touch screen though
and that's working

~~~
manojlds
I am on 36.0.1985.125 m (Windows 8.1) and it works for me.

~~~
devilsbabe
Same version and OS. 64 bit but I doubt that would change anything. Strange.
Doesn't work with touchpad either

~~~
manojlds
64 bit as well, MBP Retina 2013.

------
remon
A very promising start and I'm very much in favor of the "randomly click to
learn" approach to teaching the game rules. Can do without the comments
between levels though.

~~~
GimbalLock
I like the comments. I look forward to them after each level.

------
joshdance
Cool game. When I saw so many points I immediately thought of 2048 but it is
not that kind of game. But I like the clean look, the fun premise and the
slightly snarky comments. :)

------
uxwtf
Don Quichot spinning effect (level 29) is too much for my eyes...

~~~
Archangelix
Just touch any square and then undo. It will stop the rotation and you're back
at the initial state.

------
geuis
Cool game. The browser interface keeps appearing in ios7 Safari. Add this meta
tag.

<meta name="viewport" content="minimal-ui">

------
klackerz
Finished the game after some two-three hours. The last level and the 31st
level were the most difficult for me. I know that the statistics page that no
identifying information is showed but it would have been interesting to see
some individual stats.

[http://i.imgur.com/BP5dBde.png](http://i.imgur.com/BP5dBde.png)

------
outrightfree
Great game. Was it inspired by the telescope game that was on the Dyson
(vacuum cleaner) website a few years ago? Seems to be gone from the dyson site
now, but I've linked to a copy in a separate submission [1].

[1]
[https://news.ycombinator.com/item?id=8092648](https://news.ycombinator.com/item?id=8092648)

------
maccard
This is a glorious example of how to design a tutorial in a game without
bombarding the user with piles of text! Love it!

------
ugdev
Level 15 drives me nuts

~~~
forgotpasswd3x
I can't seem to get past level 17. The black and red squares always end up on
the wrong sides.

~~~
pbhjpbhj
You're going to love level 18 then!

~~~
pbhjpbhj
If you're really stuck, here's a walkthrough/solutions for levels 0-20,
[https://alicious.com/game-about-squares/](https://alicious.com/game-about-
squares/).

------
RevRal
Since I'm rather arrogant it would be nice to be able to easily compare my
clicks against the statistics.

------
luigisayshello
I'm stuck on the freaking 35, I just want to finish this and go eat something,
any tip for the level?

~~~
thomie
Follow lifeformed's advice:
[https://news.ycombinator.com/item?id=8093977](https://news.ycombinator.com/item?id=8093977)

------
maxtheman
If anyone is looking for puzzlers of similar difficulty to levels 30-35, I
HIGHLY recommend "English Country Tune"
([http://www.englishcountrytune.com/](http://www.englishcountrytune.com/)). It
will turn your brain inside-out.

------
bbayer
I really like the idea and design. I also made a game [1] about squares some
time ago.

[1] : [https://itunes.apple.com/us/app/swap-
boxes/id753811885?mt=8](https://itunes.apple.com/us/app/swap-
boxes/id753811885?mt=8)

------
thret
This game is fun, and cute, I like it.

One problem with puzzles of this type though, the structure of the problem
leads to the solution. If you simply play with the mechanism for re-ordering
boxes, you can 'brute force' the solution fairly easily.

------
edymax
I like that game and enjoying finally it on my mobile
[https://play.google.com/store/apps/details?id=com.funlab.squ...](https://play.google.com/store/apps/details?id=com.funlab.squares)

------
manicmonad
Very enjoyable! Loved the interstitial comments' specialty-barista-like
attitude.

------
wubbfindel
And now it's cloned on Google Play!

[https://play.google.com/store/search?q=%22Game%20about%20Squ...](https://play.google.com/store/search?q=%22Game%20about%20Squares%22&c=apps)

------
prezjordan
Awesome! Add sound, throw this in a PhoneGap container, and take my $2.99.

------
netcraft
I might be dense, but all I see is a square with a triangle in it and a
circle, and can't seem to make it do anything. It is throwing a 408 timeout
though, so maybe its just under load?

~~~
brkn
You have to move the squares on the circle by clicking on the square.

~~~
netcraft
interesting - its working in firefox but not in chrome 36.

~~~
skeletonjelly
As mentioned above, if the game detects touch capable browser (which new
Chrome versions do if you're on Win8 I believe) it'll block mouse input.

~~~
netcraft
i'm on windows 7 and don't have any devices connected that would be considered
touch I don't believe.

------
ryanknapp
Amazing game, loved the stack on level 21. Made it to level 26, will have to
come back and play more later. Go sell it on an app store and make some money
for your time.

~~~
jaachan
How's the stack work? I can't make it do anything else but move the blocks
counterclockwise :/

Edit: Got it with stinos' comment

------
marxshrugged
Level 20 now. I'm a little bit color blind and 2 of the squares look exactly
the same. Higher contrast between colors would be apreciated.

------
sowhatquestion
Is anyone else stuck on level 24? Halp!

Edit: I know this is a terrible comment that contributes nothing, please don't
downvote it just for that... :3

------
l33tfr4gg3r
Has anyone managed to crack level 31? Seems darned impossible, but I'm also
sure I'm missing something obvious :)

------
JeremyMartinez_
Please add a window where it shows you number of clicks. And if you are
revisiting a level, add your previous record

------
poopsintub
Nice job. I will love seeing this type of game over-run the play store
compared to something like 100 falling balls.

------
zwegner
Tiny bug report: after clicking on the levels and going back to level 0, all
of the buttons on the sides disappear.

------
hamai
Simple and engaging. Nice graphics engine.

------
Ardeof
Decided to stop/stuck too long (around 5 minutes) at Level 21, which is pretty
disappointing for me.

------
joallard
Can't click or interact with anything on Firefox 33a. Just an unresponsive
start screen.

------
amenghra
Cool. Reminds me of Boxxle / Sokoban, but adapted for touch screens.

It's PSPACE to solve, right?

~~~
Zimmux
The levels with arrows seem PSPACE complete even. I wonder if the levels
without arrows are in P.

------
aerovistae
I'm stuck on level 3, help please? I seem to be missing something re:
controls.

~~~
gridspy
Squares can push other squares sideways.

~~~
prawn
I think there are those people who persist and work it out, those who politely
ask for help (OP) and those who say "Impossible. Game is broken!" and leave
you a 1* review on the App Store.

We just released our first iOS game and sadly that latter group can be enough
to hurt your ratings!

~~~
frogpelt
Do you ever get constructive feedback from 1* ratings?

I've left 1* ratings for games I play all the time because I absolutely hated
the in-app purchase intrusiveness.

~~~
prawn
I think you can learn something from all feedback, even if it's unfair and
might've been better off sent through a support/feedback form.

I think a 1* rating for a free game relying on ads or IAP is a bit rough
unless the requests are brutally intrusive. In the case of our game, we show
an ad between each game that is instantly dismissible. 10-20% of the time we
show an upgrade modal in case people want to ditch the ads and get extra
features.

One of the ad networks we beta tested had unskippable, 30 second video ads
with sound!

------
MWil
I liked the game until I came here and felt like an idiiot for being stuck at
10

~~~
rkayg
I'm stuck here too :(. EDIT: GOT IT! woot.

------
wcy
Nice game! I keep wanting to call it "Game Of Squares" :)

------
b2themax
I enjoy the game. I just wish it wouldn't talk to me so much.

------
Sami_Lehtinen
Nice simple game. Yet annoyingly unresponsive after level restart.

------
akbarnama
What an idea! Simple but challenging and so much fun!!

------
harpal
Excellent game. So much fun and very addictive.

------
hamidr
I would definitely pay for its android app :P

------
redgetan
this reminds me of Vagrant Story puzzles where you have to move box crates
into the right places.

------
drydot
excelent addictive game, btw, what is the trick in level 15 ? i can't go
beyond

~~~
drydot
ok, idid it!, no on lvl 16

------
Kiro
I don't think this is the next Flappy Birds or 2048. It's just not casual
enough.

------
ndds
I win: window.GAMEABOUTSQUARES.Interface.completeLvl()

------
pawelkomarnicki
Nice game :-)

------
egong82
Fun!

------
pseudometa
And go! Tomorrow this game in full will appear on the Google Play store with
the exact same colors. In 3 days this game will be rewritten in Swift, Erlang,
and have a community based variation. In 4 days someone will find a way to
merge this game with 2048 and Flappy Bird. In a week there will be 20
variations of this game including one called Dodge Squares on the iTunes App
Store. I'm not psychic, I've just seen this script before.

~~~
khoury
In a month, someone writes a QBASIC version with random map generation and a
month later, someone writes a javascript AI that can play it.

~~~
Artemis2
The next day, Twitch will play it.

------
michaelochurch
This is a really elegant game. Kudos to the designer. It's quite admirable. It
has a life/death property like Go: the game seems to be about recognizing
which configurations are dead and avoiding them.

------
dbg31415
The game sucks on a laptop.

~~~
lpeancovschi
[https://itunes.apple.com/us/app/super-game-about-
squares/id9...](https://itunes.apple.com/us/app/super-game-about-
squares/id904056608?mt=8)

