Puzzle: Find the squares in C#

[puzzle]

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 below to download a version of the program that is ready for you to fill in the solutions.


Download Example   Follow me on Twitter   RSS feed   Donate




This entry was posted in algorithms, games, graphics, mathematics and tagged , , , , , , , , , , , . Bookmark the permalink.

One Response to Puzzle: Find the squares in C#

  1. Pingback: Find and display solutions to the "find the squares" puzzle in C# - C# HelperC# Helper

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.