5 ms·
Here's a project that simulates the "yield" keyword with current version of JavaScript: https://bitbucket.org/balpha/lyfe/wiki/Home https://bitbucket.org/balpha
by buddydvd 15y ago
Here's a project that simulates the "yield" keyword with current version of JavaScript: https://bitbucket.org/balpha/lyfe/wiki/Home https://bitbucket.org/balpha/lyfe/wiki/Home
- ajuc 15y agoThanks for this link, I've been looking for something like that. Generators like in Python allow for nice AI scripting with explicite time-sharing - each AI actor is generator function, that in main loop has yield statement. That way it all works in one thread, and ai code can be written straightforward, like each actor had it's own thread.