Live data from Hacker News

Game about squares

gameaboutsquares.com

61–70 of 208 posts

Re: Game about squares

#61

Earlier quoted context omitted.

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.

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…

Shouldn't that 16 be a 256? 4 squares with 4 orientations each = 4^4 = 256.

But yeah, definitely pretty doable with a brute-force memoized search. I imagine a lot of state space could be pruned by doing some analysis of when squares can only move further away from their home dots (and not be turned around or pushed back or anything).

Re: Game about squares

#63
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, 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.

Re: Game about squares

#67
post #63

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 , beautified): (function($) { try { document.createEvent("TouchEvent"); return; } catch (f) {} var eventMap = { mousedown : "touchstart", mouseup : "touchend", mousemove : "tou…

Further more it is completely unusable on some touch devices, I tried iPad 4 and iPhone 5. They both scroll the page (better: bump to the top, as if you wanted to scroll past the end of a page) instead of moving the blocks. :-/
Post reply on HN