Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 7th, 2007, 10:22 PM   #1
cwl157
Professional Programmer
 
Join Date: Feb 2005
Posts: 323
Rep Power: 4 cwl157 is on a distinguished road
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.
cwl157 is offline   Reply With Quote
Old Jan 7th, 2007, 11:55 PM   #2
cwl157
Professional Programmer
 
Join Date: Feb 2005
Posts: 323
Rep Power: 4 cwl157 is on a distinguished road
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.
cwl157 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:29 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC