4

Solution to level 4 in Untrusted: http://alex.nisnevich.com/untrusted/

 2 years ago
source link: https://gist.github.com/Untrusted-Game/6d90a06a1315dd41777cdd88f456197f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
http://alex.nisnevich.com/untrusted/ · GitHub

Instantly share code, notes, and snippets.

Solution to level 4 in Untrusted: http://alex.nisnevich.com/untrusted/

/******************* * multiplicity.js * ******************* * * Out of one cell and into another. They're not giving you * very much to work with here, either. Ah, well. * * Level filenames can be hints, by the way. Have I * mentioned that before? * * No more cells after this one. I promise. */

function startLevel(map) {

map.placePlayer(map.getWidth()-5, map.getHeight()-4);

for (y = 7; y <= map.getHeight() - 3; y++) { map.placeObject(7, y, 'block'); map.placeObject(map.getWidth() - 3, y, 'block'); } map.placeObject(map.getWidth() - 10, 10, 'exit'); for (x = 7; x <= map.getWidth() - 3; x++) { map.placeObject(x, 7, 'block'); map.placeObject(x, map.getHeight() - 3, 'block'); }

map.placeObject(map.getWidth() - 5, 5, 'exit'); }


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK