Can someone help me with this coding please i keep getting errors

i am currently making the boardmanager script off the unity tutorial 2d roguelike i keep getting errors
(8,13) error CS1519: Unexpected symbol ‘using’
(8,26) error CS1519: Unexpected symbol ‘;’
(9,21) error CS1519: Unexpected symbol ‘;’
(10,41) error CS1519: Unexpected symbol ‘;’
(11,22) error CS1519: Unexpected symbol ‘=’
(11,42) error CS1519: Unexpected symbol ‘;’
(15,9) error CS1519: Unexpected symbol ‘{’
and last one
Assets/Scripts/BoardManager.cs(17,30): error CS0542: `BoardManager.BoardManager’: member names cannot be the same as their enclosing type

using UnityEngine;
using System;
using System.Collections.Generic;
using Random = UnityEngine.Random;

public class BoardManager : MonoBehaviour
public class Count
public int minimum;
public int maximum;

public Count (int min, int max)
minimum = min;
maximum = max;

public int columns = 8;
public int rows = 8;
public Count wallCount = new Count (5,9);
public Count foodCount = new Count (1,5);
public GameObject exit;
public GameObject floorTiles;
public GameObject wallTiles;
public GameObject foodTiles;
public GameObject enemyTiles;
public GameObject outerWallTiles;

private Transform boardHolder;
private List gridPositions = new List();

void InitialiseList()

for (int x = 1; x < columns - 1; x++)
for (int y = 1; y < rows - 1; y++)
gridPositions.Add(new Vector3(x,y,0f));

void BoardSetup ()
boardHolder = new GameObject (“Board”).transform;

for (int x = -1; x < columns + 1; x++)
for (int y = -1; y < rows + 1; y++)
GameObject toInstantiate = floorTiles[Random.Range (0, floorTiles.Length)];
if (x == -1 || x == columns || y == -1 || y == rows)
toInstantiate = outerWallTiles[Random.Range (0, outerWallTiles.Length)];

GameObject instance = toInstantiate(toInstantiate, new Vector3 (x,y,0f), Quaternion.identity) as GameObject;



Vector3 RandomPosition()
int randomIndex = Random.Range (0, gridPosition.Count);
Vector3 randomPosition = gridPosition [randomIndex];
gridPositions.RemoveAt (randomIndex);
return randomPosition;

void LayoutObjectAtRandom(GameObject tileArray, int minimum, int maximum)
int objectCount = Random.Range (minimum, maximim + 1);

for (int i = 0; i < objectCount; i++)
Vector3 randomPositions = RandomPosition();
GameObject tileChoice = tileArray[Random.Range (0, tileArray.Length)];
Instantiate (tileChoice, RandomPosition, Quaternion.identity);

public void SetupScene (int level)
BoardSetup ();
InitialiseList ();
LayoutObjectAtRandom (wallTiles, wallCount.minimum, wallCount.maximum);
LayoutObjectAtRandom (foodTiles, foodCount.minimum, foodCount.maximum);
int enemyCount = (int)Mathf.Log (level, 2f);
LayoutObjectAtRandom (enemyTiles, enemyCount, enemyCount);
Instantiate (exit, new Vector3 (columns - 1, rows - 1, 0f), Quaternion.identity);


This answer depends a bit on if you are using MonoDevelop or Visual Studio. Visual studio gives you all the normal debug information, but I’m going to suggest you open MonoDevelop (the default script editor for Unity) to rework this.

First off, you’re going to have an easier time tracking down issues in your code if you space things out more: new lines, indents, etc. (Although now that I’m typing, I realize that might be just because you didn’t mark it as a code sample when you posted)

Secondly, on the top left of the MonoDevelop window, beneath File, you’ll see a Play button. It doesn’t have any lettering, but it’s the classic “Play” symbol. Next to it are a couple of drop downs. Leave them at their defaults: Debug and Unity Editor. Now press that play button and give it a minute to build your code. When it has finished, it actually marks each line of code where you have an error, and gives you a pop up message describing the nature of the error when you hover close to the source of the problem.

Third, I didn’t find the source of any issues you listed above, but I found the reasons why your code will not compile as-is. Essentially, you have a collection of small mistakes in your way, such as:

private List gridPositions = new List (); should be

private List <Vector3> gridPositions = new List <Vector3> ();

GameObject instance = toInstantiate(toInstantiate, new Vector3 (x,y,0f), Quaternion.identity) as GameObject; should be

GameObject instance = Instantiate(toInstantiate, new Vector3 (x,y,0f), Quaternion.identity) as GameObject;

Random.Range (0, gridPosition.Count) should be

Random.Range (0, gridPositions.Count)

I’m using the error codes from your code and comparing them against the example code to find where they differ. You can also try re-watching portions of the tutorial covering the exact code that the compiler is flagging to see if you missed something. There were a few other typos, but once I cleared them, your code compiled fine, so you should be good to go after combing back through it.

Good luck!

EDIT As a side note, those initial errors look exactly like punctuation errors in your first few lines. Like you were missing a semi-colon for one of your “using” statements, and the trickle down issue just didn’t stop. But it seems to be fixed in the code you posted here.

@Tain_M i done what you asked me to do it worked :slight_smile: now when i followed what you told me to do i now only have one error it says
Assets/Scripts/BoardManager.cs(71,23): error CS1525: Unexpected symbol `Vector3’