C# for Grasshopper

Page 15

ITERATIONS LOOP TYPE

SYNTAX

FOR iterating number of times

for (var i = 0; i < 10; i++) { … }

FOREACH iterating over a list of objects, but they cannot be changed

foreach (var numbers in numbers) { … }

WHILE while (i < 10) when you do not know how { many iterations you will have … i++; } DO-WHILE

do { … i++; } while (i < 10);


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.