Question: Use Python Task 1: Build the grid Implement a class named NeighboringNodes with the following parameters: size (a positive int) debug (boolean) Add a method
Use Python
Task 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
