I wasn't sure how to show all the mines on the minesweeper map, so I just place them all at the top... was this supposed to be the point? :) Anyhoo, nice game, it doesn't matter how you solve it, as it still proves that eval is evil ;)
Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
31–40 of 246 posts
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#32Earlier quoted context omitted.
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!
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#33Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#34Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#35This worked for the whole first chapter for me (and has some obvious further applications): startLevel["constructor"]("m", "console.log(m);" + "var old = m.placeObject;\n" + "m.placeObject = function(x,y,t) { \n" + "console.log(t);\n" + "if (t === 'exit' || t === 'computer') {\n" + "console.log('adding' + t);\n" + "return old['ca' + 'll'](m, x,y,t) }};")(map); EDIT: I wonder if you could wrap the user's code in, e.g.…
similarly,
var oldPlaceObject = map.placeObject;
var newPlaceObject = function(x, y, type) {
if (type !== 'block') {
map.placeObject = oldPlaceObject;
map.placeObject(x, y, type);
map.placeObject = newPlaceObject;
}
};
map.placeObject = newPlaceObject;
was my solution to multiple levels ;).Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#36You should reinit the map though, otherwise doing this on level 2 causes funny bugs (and makes the game rather easy ;) maze.create = function() {}; var tmp = map.placeObject; map.placeObject = function(x, y, t) { if(t == 'exit') tmp(x,y,t); };
level 2 can be solved by using the two "unlocked" lines to comment out the whole maze.create call, too.
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#37stupid drones, me.selfDestruct (tableflip)
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#38Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#39Love that you're auto-gisting solutions. That was clever - I presume you are browsing through searching for the common description tag? I also like the API popup, although I didn't see it until I got stuck on the (uneditable) level 7. I verified this because $('.editableLines') == [] in console! Perhaps this is a very fancy meta-game that you can only win with a pull request? :)
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#40stupid drones, me.selfDestruct (tableflip)