RaijnAU / toy-robot

Deployed:
https://gifted-meninsky-03d86f.netlify.com/
1 stars 0 forks source link

Add wall obstacles on the board #8

Open stevensacks opened 5 years ago

stevensacks commented 5 years ago

Generate wall obstacles on the board and place them in random squares. You can make them look however you want (a black square is fine). Make it so that you can vary the number of walls.

Robots cannot be placed on nor can they walk into a space with a wall present. It should act the same as the board's edge as far as the restriction goes.

Extra Credit: Do not allow wall obstacles to block passage to anywhere on the board completely, such that a robot could not get in or out of an area. Dead ends are fine, but you should be able to access every non-obstacle square as a robot.

stevensacks commented 5 years ago

Here's a hint.

Start with one wall obstacle (a pillar, for example), hard-code place it on the board in a specific spot and then write the rules for the robots to not be able to go into that square.

Once that's working, you can work on the number of wall obstacles and random placement.

After that, you can attempt the extra credit.