I've been playing Computercraft and decided to create a simplified version of its Parallel API for Pico-8. This code introduces two functions:
waitforany and waitforall, which lets you run multiple functions in parallel using coroutines.
Actually, the entered functions don't all run at the same time; functions will run in sequence and switch between themselves whenever they yield(). The above cart shows an example usage of both functions.
waitforany()
Takes functions as parameters, and runs each one in parallel.
Returns the index of the first function that finishes.
usage:
waitforany(func1, func2, ...)
code:
function waitforany(...)
colist = {...}
[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=174466#p) |
by Verb
Also known as Insanity or Madness. Peg Twister is a simple board game where a single player moves red and blue pegs from opposite ends of the board to the other side, switching their positions. The player can only move forward one space at a time or jump over another peg.







0 comments