Skip to content

Instantly share code, notes, and snippets.

@vitaliy-evsyukov
Created August 28, 2012 11:53
Show Gist options
  • Save vitaliy-evsyukov/3497496 to your computer and use it in GitHub Desktop.
Save vitaliy-evsyukov/3497496 to your computer and use it in GitHub Desktop.
Tiny JavaScript brutforce
var n, al = ['A', 'B', 'C', 'D'], r = ['', '', ''], linesCount = 100;
for (var i = 0; i < linesCount; i++) {
n = i;
r = ['', '', '',];
for (var j = r.length - 1; j >= 0; j--) {
r[j] = al[n % al.length];
n = Math.floor(n / al.length);
}
console.log(r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment