Created
June 5, 2020 08:27
-
-
Save gonzaloruizdevilla/8edd7a5c37e74fb1891a8333f92516d4 to your computer and use it in GitHub Desktop.
Fibonacci secuence as letters
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
function* fibletter() { | |
let a = 0; | |
let b = 1; | |
while(true) { | |
yield String.fromCharCode(97 + ((b-1)%26)); | |
[a,b] = [b,b+a] | |
} | |
} | |
gen = fibletter(); for(let a = 1; a < 10; a++) {console.log(Array(6).fill(1).map(v => gen.next().value).join``)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment