CreateNewField - AS 2017

From TRCCompSci - AQA Computer Science
Revision as of 09:25, 3 March 2017 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Code

static void CreateNewField(char[,] Field)
{
    int Row = 0;
    int Column = 0;
    for (Row = 0; Row < FIELDLENGTH; Row++)
    {
        for (Column = 0; Column < FIELDWIDTH; Column++)
        {
            Field[Row, Column] = SOIL;
        }
    }
    Row = FIELDLENGTH / 2;
    Column = FIELDWIDTH / 2;
    Field[Row, Column] = SEED;
}

Explanation