Last active
August 29, 2015 14:19
-
-
Save nbqx/f345f1417dfa6996d8d0 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
// run with `--harmony` | |
var ucs2 = require('punycode').ucs2; | |
function food(){ | |
function *foodz(){ | |
var s = 0x1F354, | |
e = 0x1F37B, | |
c = s; | |
for(;;){ | |
if(c>e){ c = s; }; | |
yield ucs2.encode([c]); | |
c++; | |
} | |
}; | |
var gen = foodz(); | |
return function(){ | |
return gen.next().value; | |
} | |
}; | |
var f = food(); | |
for(;;){ console.log(f()) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment