-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock.cs
More file actions
32 lines (27 loc) · 784 Bytes
/
Copy pathRock.cs
File metadata and controls
32 lines (27 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Text;
namespace Group1Game
{
class Rock: MapObject
{
public Rock(int length, int height):base(length,height)
{
}
public void Size(Board board)
{
int a, b;
Random myTal = new Random();
a= myTal.Next(1, board.BoardSize-1);
b= myTal.Next(1, board.BoardSize-1);
board.Boardfield[a, b] = "O";
for (int i = 0; i < Height; i++)
for (int j = 0; j < Length; j++)
{
if (i + a >= board.BoardSize || j + b >= board.BoardSize)
continue;
board.Boardfield[i + a, j + b] = "O";
}
}
}
}