Skip to content

Instantly share code, notes, and snippets.

@nbqx
Last active August 29, 2015 14:19
Show Gist options
  • Save nbqx/f345f1417dfa6996d8d0 to your computer and use it in GitHub Desktop.
Save nbqx/f345f1417dfa6996d8d0 to your computer and use it in GitHub Desktop.
// 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