I am trying to create a simple visualization of what my code does. I am making a Poisson-Disk-Distribution class to generate a set of random points in a bounded rectangular region. Basically, what it does is it randomly generates a specified number of points in the bounded region and makes sure that each point is at least a certain distance away from all the other points. The random points will be used later to generate a random maze.
I am finished coding, but I want to perform a quick visual check of whether or not it works. I want to output the points as text on the console. Every point generated has an X-value and a Y-value, so I was hoping that I could output the generated points in the console by somehow marking an x wherever a point may lie.
For example, if I were to have a bounding rectangle of width and height of 4, and the points p1 = (0, 0) and p2 = (2, 2) it could output the following:
----
--x-
----
x---
Where - are empty spaces on the graph and x are the points p1 and p2.
So, I'm kind of stumped as to how to code this printing function. It sounds simple in my head, but I can't seem to implement it.
Oh, I tagged this as homework, but its not really part of my project. I just wanted to check if my code is actually working properly by implementing this quick (well, not so quick for me) function. Any hints/suggestions/solutions are welcome.
Thank you!
--
Edit:
The "points" are Point objects that hold two integer values for their x and y coordinates The poisson-disk-generator generates a specified number of Point objects and places them in a list