Difference between revisions of "InitialiseField - 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 InitialiseField(char[,] Field)
 +
{
 +
    string Response = "";
 +
    Console.Write("Do you want to load a file with seed positions? (Y/N): ");
 +
    Response = Console.ReadLine();
 +
    if (Response == "Y")
 +
    {
 +
        ReadFile(Field);
 +
    }
 +
    else
 +
    {
 +
        CreateNewField(Field);
 +
    }
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
==Explanation==
 
==Explanation==

Latest revision as of 09:27, 3 March 2017

The Code

static void InitialiseField(char[,] Field)
{
    string Response = "";
    Console.Write("Do you want to load a file with seed positions? (Y/N): ");
    Response = Console.ReadLine();
    if (Response == "Y")
    {
        ReadFile(Field);
    }
    else
    {
        CreateNewField(Field);
    }
}

Explanation