Using arrays instead of loops in ICE


Here’s a simple example of using an array instead of a loop in an ICE tree.
In general, for performance, you’d like to avoid repeats and loops in ICE.
This post is in repsonse to this thread.

var u = 4;
var x = -.05;
for (i=1; i <= u-1; i++) {
	x = x + 1/u ;
	LogMessage( x );
}
// INFO : 0.2
// INFO : 0.45
// INFO : 0.7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s