Got the following task:
create a prototype of the game - get the code below to work. Game is the class of the game, and Tile is a tile in the game (an individual area that has coordinates). Implement the missing classes and methods so that the result is a playing field as in the comments (there should be a house, trees, lawn and flowers).
class Game
{
}
class Tile
{
}
$game = new Game([
new House(0,0), //house
new Tree(1,0), //tree
new Tree(2,0), //tree
new Lawn(0,1), //lawn
new Lawn(0,2), //lawn
new Lawn(0,3), //lawn
new Lawn(0,3), //lawn
new Flower(3,0), //flower
new Flower(1,3), //flower
]);
/*
0 1 2 3
0
1
2
3
*/"
Could you please suggest what method can be used to display the specified playing field?
I suppose that this task can be solved by specific method but I have no clue.