我想使用this website作爲幫助,但代碼似乎不工作了,所以我正在修復它,現在我得到一個C#標識符預期錯誤C#XNA標識符預計
public Point PickRandomCellAndMarkItVisited()
{
Random rnd = new Random();
Point randomLocation = new Point(rnd.Next(1, 10), rnd.Next(1, 10));
this.[randomLocation] = true;
return randomLocation;
}
'this。[randomLocation] = true;'是無效的代碼。你可能的意思是'this [randomLocation] = true;'請注意,在你連接的代碼中,'PickRandomCellAndMarkItVisited'方法在'this'之後沒有'.' ... –