Git Product home page Git Product logo

crossword's People

Contributors

jweisbeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crossword's Issues

Sandstorm Support

Thank you for releasing your fun crossword code under a free licence.

Please consider supporting deployment of this application on Sandstorm:

http://sandstorm.io

Sandstorm is a SaaP (Software as a Platform) for easily deploying server applications.

This would mean that it would be very simple for somebody unskilled in computers to enjoy using your work.

PS

Non-Free Javascript test

If you have time, could you please check whether your code passes the GNU IceCat browser non-free javascript check, that would be great. Thank you.

show stored puzzle attempts

Hi folks
Not an issue, but PR's don't seem to be looked at - hope this helps.
Tell me if I'm doing this wrong - very new to GH. Just want to share my solution.

Have been working on this over last couple of days, and needed a way to show the attempts made on the puzzle.

If you paste this function into the puzInit var, as the puzzle is generated, it'll fill in the user's attempts.

    showAttempts: function() {
    
	    //console.log("entries",entries);		// co-ords of cell - col,row, ["1,1", "2,1", "3,1", "4,1"]
    
	    for (var x=1, p = entryCount; x <= p; ++x) {
		    //var letters = puzz.data[x-1].answer.split('');
		    var attempt = puzz.data[x-1].attempt.split('');		// retrieved user's attempt - useful when rebuilding puzzle with user attempts
		    console.log(attempt);
    
		    console.log("entries["+(x-1)+"]",entries[x-1]);		// co-ords of cell - col,row, ["1,1", "2,1", "3,1", "4,1"]
    
		    var y = 0;
		    for (var i=0; i < entries[x-1].length; ++i) {
			    var selector =  '.position-' + (x-1) + ' input';
			    //console.log(selector);
			    
			    var co = entries[x-1][i].split(",");
			    console.log("co:",co);
    
			    var c0 = co[0];
			    var c1 = co[1];
			    var r = 0;
			    if(c0>=c1) {
				    r = c0;
				    // try to normalise what we have
				    // col value appears first, and 
				    // has the column value of the <td> element across the row
				    // to target it properly, if it's at say, col 6 (and its the 1st letter position of the word),
				    // we need to force it back to 1
				    var t1 = r;		// could be 6
				    var t2 = t1 - 1;	// whatever value is one less ie: 5
				    var t3 = (t1 - t2) + y;	// ie: 6 - 5 = 1
				    y++;
				    r = t3;
											    
			    } else {
				    r = co[1];
			    }
    
			    console.log("r:",r,"t1:",t1, "t2:",t2, "t3:",t3,"attempt[r-1]",attempt[r-1],"attempt[t3-1]",attempt[t3-1]);	
    
				    
				    $(selector)[r-1].value = attempt[r-1];
			    
		    }
	    }
    
    },

This bit:

var attempt = puzz.data[x-1].attempt.split('');		// retrieved user's attempt - useful when rebuilding puzzle with user attempts
						console.log(attempt);

requires that a key in the json puzzleData variable called "attempt" have the users attempt at this clue.

So, for example:

    var puzzleData = [
        {
            clue: "my first name",
            answer: "brad",
            attempt: "blah",
            position: 1,
            orientation: "across",
            startx: 1,
            starty: 1
        },
        {
            clue: "my wife's first name",
            answer: "nottellingyou",
            attempt: "abcdefghijklm",
            position: 2,
            orientation: "across",
            startx: 6,
            starty: 1
        },
        {
            clue: "opposite of above",
            answer: "below",
            attempt: "below",
            position: 1,
            orientation: "down",
            startx: 1,
            starty: 1
        },
    
    ] 

Oh! One last thing:
In var puzInit = {, right at the bottom, add puzInit.showAttempts() as below:

	puzInit.buildTable();
	puzInit.buildEntries();
	puzInit.showAttempts();

If you edit the puzzle data in this repo and add a key called "attempt" with some value in each json entry, give it a whirl! It worked for me.

Hope this helps!

Crossword Generator

You done a very good work. Do you have some clue to develop a "puzzleData" (from script.js) generator

How to build puzzleData.

Hi,

i liked your your crossword thing, i have list of questions with answers to make crossword puzzle. so, how i can generate puzzleData which is you prepared in script.js file.

How to disable ALT key?

Hello, I want to disable ALT key in crossword. ALT is using for make polish letter. When I am make polish letter the spaces move about 3 field.

Positions not matching

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?

Error: Syntax error, unrecognized expression: [object Object][data-coords="1,1"]

at Function.Sizzle.error (jquery-7d5ba98….js?body=1:1492)
at Sizzle.tokenize (jquery-7d5ba98….js?body=1:2109)
at Sizzle.select (jquery-7d5ba98….js?body=1:2513)
at Function.Sizzle [as find] (jquery-7d5ba98….js?body=1:889)
at jQuery.fn.init.find (jquery-7d5ba98….js?body=1:2729)
at jQuery.fn.init (jquery-7d5ba98….js?body=1:2846)
at jQuery (jquery-7d5ba98….js?body=1:74)
at Object.buildEntries (jquery.crossword-39e9068….js?body=1:244)
at Object.init (jquery.crossword-39e9068….js?body=1:171)
at jQuery.fn.init.$.fn.crossword (jquery.crossword-39e9068….js?body=1:551)

make multi player

Hello, I am trying to make an upgraded version of this game where players can log in and play a multi player game. I am not sure how to do this. I would really appreciate if someone could guide me on this by suggesting some code snippet or tutorial.
Thanks.

Hey!

Thanks for sharing this!
I wonder about the license. Is it GPL?
Would been nice with a quick answer, so I maybe can start having some fun.

Best regards!

don't run on jquery 3.x

Hi,
I see this like give me an error on jquery 3.x
light = $(puzzCells + '[data-coords="' + entries[x - 1][i] + '"]');

I can't correct, do you ?

Add a winning Message

Please can someone says how to add a winning message after the puzzle completed?
Thank you!

How to save input actions?

How can I save the data entered in this game while playing the game LocalStorage ? To prevent the data entered from being updated while the page is up.

typing problem from iPad safari browser, iOS 8

work awesome in desktop browser, but in iPad Safari browser there is a severe problem when re-filling letter to input box (type - delete - type again), the new letter doesn't show at all.

jQuery 2.0.0 support

Hi, is there a way to get this working for jQuery 2.0.0 ?

I get this error :

Uncaught Error: Syntax error, unrecognized expression: [object Object][data-coords="2,1"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.