For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more alnis's commentsregister

This seems to be tied to a bug some other people have experienced where new levels don't load correctly and are overwritten with existing levels.

Try going to level 15 and resetting the level (Ctrl-4). Does that help at all?


It does! Thanks, and thanks for a fun, engrossing diversion on a rainy Monday afternoon.

(Update: Each time I enter a level, it loads as level 13, and I have to reset it to get the correct map and code -- just a heads-up in case it helps with debugging. Chrome 33.something, Windows 7 x64.)


I'm really surprised that we never thought of that. We'll try to prevent this exploit soon :-)


This might be tied to the issue that mandlar, pokpokpok, and valgaze have been having, but I haven't been able to reproduce it yet.

Does resetting these levels (Ctrl-4) help at all?


Yes, Ctrl-4 does work, thanks for the tip!


A few people have reported a similar bug. I don't think that it's level specific but has something to do with the next level not leading correctly upon completing a level.

We're still not sure why it happens or when (it seems to only affect a few people), but we'll try to figure it out.

There aren't any errors you can see in the JavaScript console, are there?


It happened twice to me, once on 4 once on 8 I think. Both times it happened when I went through the exit then went back to it.


We're glad you like it!

No clue why that's happening, but we'll continue to investigate.


Thanks!

Does your level 7 not look like http://i.imgur.com/AFTxPWC.png ?


He means level 8, I think. Or at least I have the same problem with level 8 (intoTheWoods)


Oh, there's a small bit of editable text at the bottom of level 8 (line 100). Sorry if it's not very clear - we may work on the color scheme a little.


It's from a combination of electronic sub-genres by some independent artists. You can see the full list of tracks here: https://github.com/AlexNisnevich/untrusted#soundtrack


Bizarre! I haven't been able to reproduce it. Can you share your code for that level (if it's been modified at all)?


Unmodified. Chrome 33 on Linux


Multiplying the exits is useful ;-)


Heh but then what was the real intention of the earlier maze level? I already multiplied the exit there :)

Anyway, really nice work with the game!


Thanks! The intended solution to the maze level was commenting everything out. But of course, all of these have multiple solutions :-)


Good catch! We haven't been checking yet for tampering with functions, but we probably should. Don't think of it as a bug so much as a cheatcode you discovered :-)


First of all, this is absolutely impressive in concept.

Yes, it's too easy that way:

    map.pO = map.placeObject;
    map.placeObject = function(x, y, w){
        return map.pO(x, y, w=='block'?'empty':w);
    }
Does not even need call. But while you cannot protect from `Function['p'+'rototype']['c'+'all']`, I think using `defineProperty` to stop mucking with the code would go a long way into preventing blatant cheating at little cost. That or enclosed reference funcs.

Btw, you trust the level increment counter before succeeding in loading the level. Right now calls are 503ing, so basically I'm [gisting bogus solutions](https://gist.github.com/anonymous/f1b06d63848d6d013e26) but it's also saving those bogus level ups in localstorage...


Aww, I thought that was to easy. That trick works for basically any level.

Also, is there a good way to completly prevent tampering with functions, or is this just going to be an arms race?


> Also, is there a good way to completly prevent tampering with functions, or is this just going to be an arms race?

Let's hope for an arms race - it will be far more fun and educating at the same time.


hmm a multi player javascript API tampering arms race game would be pretty awesome too.


Object.defineProperty with 'writable' = false?


Object.freeze?


I just added a feature to the game that watches certain functions and compares them to what they were at the start of the game (during the level validation phase). I'm sure this can still be gamed though.


Don't use the functions from the map object, but keep a separate function reference for validation?

I mean if you want to cheat you always can. But that's not the point. Right now you can cheat using official apis.

Just use map._blah() for internal use

By the way: Same trick works for keys.


I did a similar thing for level 6: http://pastebin.com/aScFtgK8


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You