Repetition - 2017

From TRCCompSci - AQA Computer Science
Revision as of 12:35, 7 February 2017 by 000025845 (talk | contribs) (Created page with "Repeats a section of code until a set of parameters are met (or one parameter).<br /> From Warren; Line 16: <syntaxhighlight lang="csharp"> for (int r = 0; r < RabbitCo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Repeats a section of code until a set of parameters are met (or one parameter).
From Warren; Line 16:

 
      for (int r = 0; r < RabbitCount; r++)
      {
        Rabbits[r] = new Rabbit(Variability);
      }


The for loop creates a new entry in the Rabbits array, using the Rabbit class, until the variable r reaches the RabbitCount variable.