1. Engineering
  2. Computer Science
  3. use python...

Question: use python...

Question details

Use PythonTask 1: Build the grid Implement a class named NeighboringNodes with the following parameters: size (a positive int) debug (boolean) Add a method to NeighboringNodes that constructs a grid of size x size nodes. For example, if size 3, NeighboringNodes will instantiate a 3x3 grid. Each node in the grid should have the following features: x: its x-axis coordinate y its y-axis coordinate If the boolean parameter debug is true, the method should print out the (x, y, i) features for each of the nodes after the grid is built. Add a method that accepts the index of a node as its parameter and returns the (x.y) coordinate of that node.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution