Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positions not matching #13

Open
kittykatattack opened this issue Aug 15, 2017 · 8 comments
Open

Positions not matching #13

kittykatattack opened this issue Aug 15, 2017 · 8 comments

Comments

@kittykatattack
Copy link

kittykatattack commented Aug 15, 2017

Hello!

I'm noticing a strange bug where the clue/answer positions don't match up.
Although the linked demo works fine, when I clone the repo and run it locally I get this:

screen shot 2017-08-15 at 2 54 19 pm

You'll notice that the across and down numbers don't match the clues.

Attempting to create my own crossword gives me this:

screen shot 2017-08-15 at 3 01 11 pm

Here's the data I'm using:

testData = [
			 	{
					clue: "Rogers and Samsung collaborating to sell mobile devices to Canadian consumers is an example of a ___ ___ (two words, use a space as separator).",
					answer: "strategic alliance",
					position: 1,
					orientation: "down",
					startx: 8,
					starty: 1
				},
			 	{
					clue: "HBC sells clothing that are brought in from other countries. This is an example of an ______ business.",
					answer: "import",
					position: 2,
					orientation: "down",
					startx: 15,
					starty: 3
				},
			 	{
					clue: "Domtar Inc. sells paper and pulp products made from its Canadian plants to overseas customers. This is an example of an ______ business.",
					answer: "export",
					position: 3,
					orientation: "down",
					startx: 17,
					starty: 4
				},
			 	{			
					clue: "A country has a trade ______ when imports exceed exports.",
					answer: "deficit",
					position: 4,
					orientation: "down",
					startx: 15,
					starty: 13
				},
			 	{			
					clue: "Jaguar Land Rover Limited expanded into the Chinese luxury car market by partnering with local auto maker, Chery. Together, they formed a new company called Chery Jaguar Land Rover Automotive Company Limited. This is an example of a ___ ___ (two words, use a space as separator).",
					answer: "joint venture",
					position: 5,
					orientation: "across",
					startx: 6,
					starty: 8
				},
			 	{			
					clue: "Walmart Canada would be considered a ___________ of Wal-Mart Stores Inc. in the United States.",
					answer: "subsidiary",
					position: 6,
					orientation: "across",
					startx: 1,
					starty: 11
				},
			 	{	
					clue: "A business ______ refers to recurring periods of increased and decreased economic activity, or expansions and contractions.",
					answer: "cycle",
					position: 7,
					orientation: "across",
					startx: 5,
					starty: 13
				},
			 	{	
					clue: "Acronym for the monetary value of all goods and services produced within a country in a given period of time.",
					answer: "gdp",
					position: 8,
					orientation: "across",
					startx: 14,
					starty: 13
				},
			 	{	
					clue: "Any attempt to increase a business's effectiveness or overall efficiency. E.g. downsizing, cutbacks, relocating to cheaper places of labour.",
					answer: "rationalization",
					position: 9,
					orientation: "across",
					startx: 3,
					starty: 16
				},
			 	{	
					clue: "The bottom of the business cycle.",
					answer: "trough",
					position: 10,
					orientation: "across",
					startx: 15,
					starty: 19
				},
			 	
			] 

Is there a simple solution to this bug?

@MichaelWehar
Copy link

I've been having this issue as well! I don't quite understand it. Hope that someone out there can help us. :)

@didinium
Copy link

I'm having the exact same issue. Did either of you end up figuring it out?

@didinium
Copy link

The solution to this is more or less just to download this fork: https://github.com/konst2/Crossword

It's significantly improved.

@HoldOffHunger
Copy link

If you'd like to try something that accepts a list of words and a list of clue as arguments, and makes the puzzle for you, then check out this Crossword Puzzle Generator and Game I cooked up in JavaScript:

https://github.com/HoldOffHunger/jquery-crossword-puzzle-generator

Demo: http://www.earthfluent.com/crossword-puzzle-demo.html

Hope this helps!

@bradzo
Copy link

bradzo commented Feb 27, 2021

Here's how I fixed it:

In the CalcCoords function, after the for (var x=0; j = puzz,data[i].answer.length; x < j; ++x) loop:

// while we're in here, add clues to DOM!
						if(i===0) {
							z = 1;
						} else {
							z = i;
						}
						$('#' + puzz.data[i].orientation).append('<li value="' + z + '" tabindex="1" data-position="' + i + '">' + puzz.data[i].clue + '</li>'); 

Try that - it worked for me.

Cheers

@vidyeshranade
Copy link

Hello Mr. Bradzo,

It is working perfectly.
You are genius!!!
Thanks once again.

Do you have any idea on how to accept the input non-English characters (multi-byte characters) into the single cell (td)?
Suppose I want to enter answer as 'भारत'. So here letter is made up of two characters: भ +ा
In Indic languages, single "letter" can be made maximum up to 3 characters.

best regards,
Vidyesh

@bradzo
Copy link

bradzo commented Mar 2, 2021 via email

@vidyeshranade
Copy link

Hello Brad,

Thanks for the reply.
I will try to figure out and if found, will post here.
Best wishes for your project to complete it before time.

regards,
vidyesh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants