Title: Puzzle: Find the squares in C#
The example Puzzle: Find the equilateral triangles in C# was fun (at least for me) so here's another puzzle. This time your goal is find all of the squares that you can make using the red dots shown here. If you look at the solutions to the triangle puzzle, you can probably use the lessons you learn there to find the squares manually.
The trick is figuring out how to find the squares programmatically. Determining whether three points make up an equilateral triangle is fairly easy, but how do you determine whether four points make up a square?
This program has the same structure as the previous one, so all you need to do is plug in the code to find the squares. Click the Download button to download a version of the program that is ready for you to fill in the solutions.
Download the example to experiment with it and to see additional details.
|