Created
January 24, 2013 01:04
-
-
Save tos-kamiya/4616551 to your computer and use it in GitHub Desktop.
A Javascript code-golf code. This script generates a maze text.
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<body> | |
</body> | |
<script> | |
function yourCode() { | |
function a(b,c){for(x in d)y?c|=0>b.indexOf(x)&&!a(b+x):m[c=b-2*d[p[7*(b%w+3)*(0|b/w+5)%24][x]]]&&a(c,r=m[c]=m[b+c>>1]="");c||p.push(b)}for(d=[1,w=56,-1,-w],p=[],m=[],y=-1848,a(r="");1960>y;r+="■ \n"[!m[y++]+!(y%w)])y?m[w-2-y]=-2>y%w:a(274);return r | |
} | |
document.write("<pre>" + yourCode() + "</pre>"); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment