![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 323
Rep Power: 4
![]() |
matching squares
Alright heres the problem. I recieved a puzzle for christmas to try and solve. Its not a programming puzzle or anything but i want to make a program to solve it. The puzzle contains 9 squares. Each square has 4 pictures on it. The goal is to match up the pictures on all the squares. here is a link to the website of the company that makes the puzzle because i'm not that good at explaining.
http://www.b-dazzle.com/scramble.asp The one i have compares different sharks. Basically the side of the square either has a top or a bottom and then the correct top must match the correct bottom. I am thinking a Square class and have 4 labels in the constructor and then in main create 9 instances of the Square class to match the 9 puzzle pieces i have. I also am thinking in the Square class to have a SquareAmount method that says how many squares are left and accessor methods for the 4 labels to compare them. I want the end result to be a grid of numbers saying which Square goes where and then each square from the puzzle would match a number that the computer program spits out. I do not know how to compare all of these possible combinations though. I thought about just comparing sides of the squares until there is a match but i need to check all sides of every square every time and thats a lot. |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 323
Rep Power: 4
![]() |
i think i figured it out. I am gonna use a 2D array implementation of a graph making it 36 by 36 since there are 36 total sides. Then fill out a 0 if those 2 sides match and a 1 if those 2 sides dont match. Then traverse the graph finding all combinations with a 0 as the value and those are the sides that have to be matched up. Also, i am switching to C++ because i have some graph comparisons in C++ before.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sudoku program info & description | Adak | Software Design and Algorithms | 4 | Jul 2nd, 2006 12:49 PM |
| need pattern matching help | larry | Java | 6 | Jun 7th, 2006 11:23 AM |
| perl tricky pattern matching | ktsirig | Perl | 2 | May 13th, 2006 6:48 AM |
| ocaml pattern matching | Sysop_fb | Other Programming Languages | 0 | Mar 28th, 2006 11:49 AM |
| Break Point Problem on VC++ 6.0 | chanwing | C++ | 4 | Feb 8th, 2006 3:42 AM |