jueves, 31 de octubre de 2013

For function

Re: [Help] "FOR" function

Postby Kilinich » Mon Mar 12, 2012 12:39 pm
Buil-in "for":
It's function for(n, what) with 2 arguments:
1) integer - number of iteration
2) function - function which you need to call few times with one argument - number of call

Example:

scene.my.show = (i) => {scene.addbox({pos := [i,0]; text := (""+ i)})};
for(5, scene.my.show);
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 1502
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

No hay comentarios:

Publicar un comentario