Created
July 31, 2016 12:48
-
-
Save kdrnic/83371701f0fcd78023d3654f9e18a781 to your computer and use it in GitHub Desktop.
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
nicks=[]; | |
for(var inv=0; inv<2; inv++){ | |
for(var dir=0; dir<2; dir++){ | |
for(var rots=0; rots<6; rots++){ | |
var a="drnick".split(""); | |
if(inv)a.reverse(); | |
for(var r=0; r<rots; r++){ | |
dir?a.unshift(a.pop()):a.push(a.shift()); | |
} | |
if(a.join("")!="drnick"&&nicks.indexOf(a.join(""))<0)nicks.push(a.join("")); | |
} | |
} | |
} | |
console.log(nicks) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment