473,775 Members | 2,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Puzzle program

3 New Member
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 4471
DeMan
1,806 Top Contributor
Have we started?
Mar 7 '07 #2
ashish0799
3 New Member
Have we started?
yes we can man plz answer it
Mar 7 '07 #3
Ganon11
3,652 Recognized Expert Specialist
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
ashish0799
3 New Member
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 Top Contributor
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
1946
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 functions. All of Leo's source files start with: from leoGlobals import * I don't want to discuss whether this is good style: it is simple and it works well for me :-)
1
13107
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 the other....how i can fix this the program look like this import java.util.ArrayList; import java.util.Random;
0
2026
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 other....how i can fix this this run the random words for the program import javax.swing.JOptionPane; import java.util.ArrayList; import java.util.Random; public class CrossWordPuzzleTester {
0
1527
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 is this i have to make it in full c++ concepts...not C...n one more thing...it will be user's problem to make sequence of number...i just have to provide them with a game...can anybody give me some kind of hint...i dont know how to write code for...
7
2826
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 NO REPLY! Am I tired? yes! All I wish is the stupid code for cookies to do something! What do I want it to do? Save the page exactly how the user left it, so they can come back and finish the jigsaw puzzle at a later time. What happens? I...
3
3208
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 to bottom (S), or (iv) bottom to up (N). The program will print the starting place and the direction of each word. Limitations The number of words to be searched can be at most 100, the size of the puzzle N can be minimum 5 maximum 20....
6
2577
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 and http://norvig.com/ltd/test/n-puzzle.lisp ) I have used OO Python for the above program and would like comments on my approach as I am just starting with OOP.
3
1739
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 below: 11 43 15 76 87 120 12 1 66 22 43 4 21 89 93 As you can see, there is a blank at the bottom right corner. Implement the following program: Numbers should be displayed in the above fashion. Allow the user to hit any of the arrow...
4
19995
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 get the tiles in order, 1 through 15, from left to right, top to bottom, by just sliding tiles into the empty square. In this configuration, the goal would be to get the 14 and 15 to switch places, without affecting any of the other squares. Your...
0
9622
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10048
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4017
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.