[C# Helper]
Index Books FAQ Contact About Rod
[Beginning Database Design Solutions, Second Edition]

[Beginning Software Engineering, Second Edition]

[Essential Algorithms, Second Edition]

[The Modern C# Challenge]

[WPF 3d, Three-Dimensional Graphics with WPF and C#]

[The C# Helper Top 100]

[Interview Puzzles Dissected]

[C# 24-Hour Trainer]

[C# 5.0 Programmer's Reference]

[MCSD Certification Toolkit (Exam 70-483): Programming in C#]

Title: Puzzle: Find the squares in C#

[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.

© 2009-2023 Rocky Mountain Computer Consulting, Inc. All rights reserved.