0

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.

James Z
  • 12,209
  • 10
  • 24
  • 44
YPower
  • 1
  • 1
  • [How do I format my posts using Markdown or HTML?](https://stackoverflow.com/help/formatting) – Luuk Nov 19 '22 at 14:11
  • Welcome! StackOverflow is not a free coding service. You're expected to [try to solve the problem first](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-uhttps://stackoverflow.com/q/5741187sers). Please update your question to show what you have already tried in a [mre]. For further information, please see [How to Ask](https://stackoverflow.com/questions/how-to-ask), and take the [tour](https://stackoverflow.com/tour). – Luuk Nov 19 '22 at 14:13

0 Answers0