• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Asset - Scripts Iterators

T

thijsmie

Guest
Iterators provides easy iteration over any type of collection. This includes arrays, lists, queues, maps, stacks, priority-queues, grids, strings, instances, ranges, files, binary files and more. A universal way to write loops makes it easy to switch data-structures when you need to. Together with some utility functions and more iterators this will make writing clean loopcode easier then ever. More iterator types are coming soon, and suggestions are also much appreciated.

Code:
var it = choose(
    it_range(3, 14),
    it_object(oTest),
    it_string("Hello!"),
    it_array(array(6)),
    it_list(mydslist),
    it_map(async_load),
    it_file(file_text_open_read("myfile.txt")));

while (it_next(it))
    show_debug_message(it[IT_VAL])
https://marketplace.yoyogames.com/assets/4296/iterators
 
Top