473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Puzzle program

HI I M ASHISH I WANT ALGORYTHMUS OF THIS PROBLEM

Jigsaw puzzles. You would have solved many in your childhood and many people still
like it in their old ages also. Now what you have got to do is to solve jigsaw puzzles
using the computer. The jigsaw puzzle here is a square of dimension d (a puzzle with
d^2 pieces) and the jigsaw pieces (all same dimensions) are of dimensions H x W
(Which means the pieces have ‘H’ rows of ‘W’ characters.
The pieces will be given as ( For eg a piece of 2 x 3 )
ABC
DEF
5 0 0 -2
Where the pieces is having 2 rows of 3 characters (ABC DEF ) and the corners have
directions 5 0 0 -2.
These numbers (between –cons and +cons) will indicate the shape of the top, left,
bottom and right edges of the puzzle piece, respectively. A value of 0 indicates a
straight edge. Positive and Negative edges of same values are an interlock. The pieces
can NOT be rotated and all pieces will be unique.
Note : All characters can be a part of the puzzle piece.
Your Job
The puzzle will have one and only one solution and you have to find it. If the puzzle
is not possible then return an error.
Mar 7 '07 #1
5 4435
DeMan
1,806 1GB
Have we started?
Mar 7 '07 #2
Have we started?
yes we can man plz answer it
Mar 7 '07 #3
Ganon11
3,652 Expert 2GB
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidlines.

Then when you are ready post a new question in this thread.

MODERATOR
Mar 7 '07 #4
when i want to calculate for d>3 i have problem

for d =2 and for d=3 i first asign the position to the pieces according to thier shape indicating no.(which are top bottom left and right) and then i check whether they satisfiy the given condition of intrerlocking or not ! but for d>3 the algorithm is quite complex
Mar 7 '07 #5
DeMan
1,806 1GB
There are many ways to approach this, but I would start by fining one of the corners. (luckily we can't rotate the pieces).
Having found the corner (Let's say the top L (which I assume is 0 x y 0))
Now we search for all pieces that will link with either x or y (let's say x (0 v, w, -x))....
For each of these pieces, we repeat the problem and since there are a limited number of pieces accross this row, the answer should fall out reasonably simply.

You can then try in another direction along an edge....

Once you have completed the border, you try to find the corner pieces INSIDE your new frame (a little harder, but with some thought you could generalise the staright edged algorithm) And work around again......

It might help to represent the pieces in a Graph where each node has 4 Arcs (one or two of which are NULL for edge pieces). You can also verify the datas validity, since you know how many pieces there are, and how many should be edges/corners.
Mar 7 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: Edward K. Ream | last post by:
I've just about convinced myself there is no good, clean solution to the following puzzle. I wonder if you agree. 1. My app has a module called leoGlobals that contains often-used global...
1
by: xavier vazquez | last post by:
I have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of...
0
by: xavier vazquez | last post by:
have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of the...
0
by: biya | last post by:
hey all!!! can anybody help me???i have to make a program of a puzzle game...there would be numbers from 1 to 15 randomly shown...n user have to make there sequence by using arrow keys...now problem...
7
tpgames
by: tpgames | last post by:
I've tried to get a PHP cookie to work in php game, no luck. I've tried to get a JS cookie to work. NO luck. I can't even get a response in the php forum, so gave up! I've posted 6 or 7 times and...
3
by: oncue01 | last post by:
Word Puzzle Task You are going to search M words in an N × N puzzle. The words may have been placed in one of the four directions as from (i) left to right (E), (ii) right to left (W), (iii) up...
6
by: Phoe6 | last post by:
Hi All, I would like to request a code and design review of one of my program. n-puzzle.py http://sarovar.org/snippet/detail.php?type=snippet&id=83 Its a N-puzzle problem solver ( Wikipedia page...
3
by: ayiha | last post by:
Problem statement: You might have come across a puzzle which contains 15 numbered square pieces, which can be moved horizontally or vertically. A possible arrangement of these pieces is shown...
4
by: honey777 | last post by:
Problem: 15 Puzzle This is a common puzzle with a 4x4 playing space with 15 tiles, numbered 1 through 15. One "spot" is always left blank. Here is an example of the puzzle: The goal is to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.