This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url'] | |
npm ERR! 404 'npm-test' is not in the npm registry. | |
npm ERR! 404 You could maybe bug the author to publish it | |
npm ERR! 404 Note that you can also install from a tarball or folder. | |
npm ERR! | |
npm ERR! System Darwin 11.4.0 | |
npm ERR! command "node" "/usr/local/bin/npm" "install" "--link" | |
npm ERR! cwd /Users/per/prog/node/npm-test2 | |
npm ERR! node -v v0.6.15 | |
npm ERR! npm -v 1.0.106 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
____ = <<EOS | |
Welcome to the amazing maze! | |
You can go in these directions: | |
* North | |
* South | |
* East | |
* West |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
the largest number in the square of (odd) width x is a(x) = x^2 | |
the smallest number in the square of (odd) width x is b(x) = a(x-2)+1 = (x-2)^2+1 = x^2 - 4x5 | |
the number x is in the square of width c(x) = ceil((x^0.5-1)/2)*2+1 | |
the number of steps that x is from the smallest number in its square is d(x) = x - b(c(x)) | |
assuming the number x is on the top row, its distance from the rightmost number is e(x) = d(x) - c(x) + 2 | |
the distance from the centermost number out to the edge is then h(x) = floor(c(x)/2)) |