Difference between revisions of "Loop.R"

From Organic Design wiki
m (formatting)
m
Line 8: Line 8:
 
comp    <- 5
 
comp    <- 5
 
# seq makes a sequence from 1 to 8+5-1
 
# seq makes a sequence from 1 to 8+5-1
# %% yields he remainder of a division
+
# %% yields the modulus remainder of a division
 
loops <- seq(loop + comp - 1) %% loop
 
loops <- seq(loop + comp - 1) %% loop
  

Revision as of 22:26, 11 December 2005

  1. ==============================================================================
  2. Loop evaluation e.g. 8 parts, 5 comparisons
  3. ==============================================================================


start <- 1 loop <- 8 comp <- 5

  1. seq makes a sequence from 1 to 8+5-1
  2.  %% yields the modulus remainder of a division

loops <- seq(loop + comp - 1) %% loop

for(i in seq(loop)){

 print(loops[seq(from=i, length=comp)])

}