Difference between revisions of "SeedLands - AS 2017"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "==The Code== <syntaxhighlight lang=Csharp> </syntaxhighlight> ==Explanation==")
 
 
Line 2: Line 2:
  
 
<syntaxhighlight lang=Csharp>
 
<syntaxhighlight lang=Csharp>
 
+
static void SeedLands(char[,] Field, int Row, int Column)
 +
{
 +
    if (Row >= 0 && Row < FIELDLENGTH && Column >= 0 && Column < FIELDWIDTH)
 +
    {
 +
        if (Field[Row, Column] == SOIL)
 +
        {
 +
            Field[Row, Column] = SEED;
 +
        }
 +
    }
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
==Explanation==
 
==Explanation==

Latest revision as of 09:30, 3 March 2017

The Code

static void SeedLands(char[,] Field, int Row, int Column)
{
    if (Row >= 0 && Row < FIELDLENGTH && Column >= 0 && Column < FIELDWIDTH)
    {
        if (Field[Row, Column] == SOIL)
        {
            Field[Row, Column] = SEED;
        }
    }
}

Explanation