title: Monopoly Implementing Rules
body: <p>I have created this Monopoly board using a linked list.</p>
  
  <p>have assigned values to the squares but need to be able to add or take away these value's form the integer assigned in the player classes.</p>
  
  <p>Any help or advice would be appreciated (I apologise now for the comments they have to be revised yet) the code is below:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using MonoPolyFin;
  
  namespace MonoPolyFin
  {
  
  public class Square//Creating Squares for the board
  {
  
      public Square next;//Declaring the Square as the next node
      public string g;//String to store the Square data
  
      public Square(string g)//assigning the string to g
      {
          this.g = g;
      }
  
  
  
      public class Board/*The Board class creating the linked list and printing it out to                        the console window*/
      {
  
          public Square head;//Declaring as the head 
          Square current;//and current 
  
          public void Add(Square s)/*The Add method for adding nodes in order to the linked list checking each time to see if the head of 
           the list is empty */
          {
              if (head == null)//if the head is empty
              {
                  head = s;//the head equals the string
                  current = head;//the current node is the head
              }
              else
              {
                  current.next = s;//if not empty the current node is the next node
                  current = current.next;//then the next
                  current.next = head;//keep going round the board through the linked list
              }
          }
  
          public void Writeline(ref Square gamesquare)//The writeline method to print out in the console
          {
              Random r = new Random();//Creates a new object using the random method
              int n = r.Next(1, 6);//Creates a random number between 1-6
              Console.WriteLine(n);//Writes the stored number to the console
              Console.WriteLine("Player moves to " + gamesquare.g);//write the gamesquare to the console that is saved in the string g
              Console.ReadKey();//read whats in the console and throw it out
  
  
              if (n &lt;= 1)//If the number is less than 1
              {
  
                  head = current
                      ;//Move one positions down the list
  
              }
              else if (n &lt;= 2)//If the number is less than 2
              {
  
                  head = head.next.next;//Move two positions down the list
  
              }
  
              else if (n &lt;= 3)//If the number is less than 3
              {
  
                  head = head.next.next.next;//Move three positions down the list
  
              }
              else if (n &lt;= 4)//If the number is less than 4
              {
  
                  head = head.next.next.next.next;//Move four positions down the list
  
              }
              else if (n &lt;= 5)//If the number is less than 5
              {
  
                  head = head.next.next.next.next.next;//Move five positions down the list
  
              }
              else if (n &lt;= 6)//If the number is less than 6
              {
  
                  head = head.next.next.next.next.next.next;//Move six positions down the list
  
              }
          }
      }
  
  
    public class Player1
          {
  
              public string Dog;
              public int Money = 2000;
              public Square position = null;
  
             }
  
  
    public class Player2
    {
  
        public string Car;
        public int Money = 2000;
        public Square position = null;
  
    }
  
  
    static void Main(string[] args)//Main method
          {
              int go = 200;//Value of the square in the linked list
              int strand = 220;//Value of the square in the linked list
              int trafalger_square = 220;//Value of the square in the linked list
              int leicester_square = 280;//Value of the square in the linked list
              int piccadilly = 280;//Value of the square in the linked list
              int regent_street = 300;//Value of the square in the linked list
              int oxford_street = 300;//Value of the square in the linked list
              int mayfair = 400;//Value of the square in the linked list
              int park_lane = 400;//Value of the square in the linked list
              int whitechapel = 60;//Value of the square in the linked list
              int old_kent_road = 60;//Value of the square in the linked list
              int euston = 100;//Value of the square in the linked list
              int islington = 100;//Value of the square in the linked list
              int pall_mall = 140;//Value of the square in the linked list
              int whitehall = 140;//Value of the square in the linked list
              int vine_street = 180;//Value of the square in the linked list
              int bow_strett = 180;//Value of the square in the linked list
  
              Board list = new Board();//constructor to create the list
              list.Add(new Square("Go Collect £" + go));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Strand £" + strand + " Black"));//Add to the linked list using the Add method also assigning the int value
              list.Add(new Square("Trafalger Square £" + trafalger_square + " Black"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Gas"));//Add to the linked list
              list.Add(new Square("Leicester Square £" + leicester_square + " Aqua"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Piccadilly £" + piccadilly + " Aqua"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Card"));//Add to the linked list
              list.Add(new Square("Regent Street £" + regent_street + " Yellow"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Oxford £" + oxford_street + " Yellow"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Electric" ));//Add to the linked list
              list.Add(new Square("Mayfair £" + mayfair + " Green"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Park Lane £" + park_lane + " Green"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Jail"));//Add to the linked list
              list.Add(new Square("Old Kent Road £" + old_kent_road + " Blue"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Whitechapel £" + whitechapel + " Blue"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Water"));//Add to the linked list
              list.Add(new Square("Islington £" + islington + " Red"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Euston £" + euston + " Red"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Card"));//Add to the linked list
              list.Add(new Square("Pall Mall £" + pall_mall + " Pink"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Whitehall £" + whitehall + " Pink"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Phone" ));//Add to the linked list
              list.Add(new Square("Bow Street £" + bow_strett + " Brown"));//Add to the linked list using the Add method also assigning the int value 
              list.Add(new Square("Vine Street £" + vine_street + " Brown"));//Add to the linked list using the Add method also assigning the int value 
  
              for (int i = 0; i &lt;= 10; i++)
              {
  
                  Player2 car = new Player2();
                  car.position = list.head;
                  Console.WriteLine("Car roles the dice and roles");
                  list.Writeline(ref car.position);
  
                  Player1 dog = new Player1();
                  dog.position = list.head;
                  Console.WriteLine("Dog roles the dice and roles");
                  list.Writeline(ref dog.position);
              }
  
            }
  
          }
      }
  </code></pre>