Created
December 23, 2015 13:08
-
-
Save butchi/1d46a01f5e915ea5fb5c to your computer and use it in GitHub Desktop.
ツインドラゴンに関する発見と実装 ref: http://qiita.com/butchi_y/items/4f0bd72f4b322d4943b6
This file contains hidden or 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
var i, j; | |
var x = [0]; | |
var y = [0]; | |
var nextX = []; | |
var nextY = []; | |
for(j=0; j<4; j++) { | |
l = x.length-1; | |
for(i=0; i<x.length; i++) { | |
nextX[i] = x[i] + 1 - y[l]; | |
nextY[i] = y[i] + x[l]; | |
} | |
x = x.concat(nextX); | |
y = y.concat(nextY); | |
} | |
console.log(x); | |
console.log(y); |
This file contains hidden or 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
Graphics[Point[ | |
Transpose[{Re[#], Im[#]} &[ | |
Nest[Join[#, # + 1 - Im[Last[#]] + Re[Last[#]] I] &, {0}, 10] | |
]] | |
]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment