Software Secret Weapons™

Gang Of Four Software Design Patterns Java Script Crossword
by Pavel Simakov on 2007-05-07 16:14:42 under AJAX, view comments
Bookmark and Share

Couple of month ago I have finished the JavaScript Crossword puzzle engine. It is a complete JavaScript application generator that takes a list of words and their definitions and spits out a working JavaScript crossword. You can see how the engine works by playing with Gang Of Four Software Design Patterns Crossword for example.

UPDATE -    Source Released LGPL!   

The JavaScript crossword engine is a closed-source at the moment. I was planning to collaborate with some folks from the Ontario Private School system as we did on the Google maps JavaScript framework for the Ontario Private and the Public schools. The project did not go forward as planned and I now plan to license, sell, or donate the JavaScript crossword engine to good folks for a good cause. Please drop me a line if you are one of those.

The JavaScript crossword engine was an attempt to create an interactive competitive educational product for a school. The children of various ages (and native languages) could solve the crossword and other educational puzzles while being in the class in the real-time. They could even compete with each other by solving one large puzzle collaboratively, while keeping the individual scores. The crossword competition concept is very cool! I might tell you a bit about this in some future posts.

Another application was considered in the creative advertising. One can create a crossword that, instead of the textual questions, shows the product pictures and asks the player to spell out the product names. You can see how we use the colored boxes instead of images in the Basic Colors Crossword . Check out Big Names in Fashion Are Puzzled Again types of questions that one might put together trying to appeal to the female audience.

The technology of choice is JavaScript. I continue to invest in the design and the architecture of the JavaScript applications. It seems to me that a lot of leverage can be gained in development of e-commerce and web applications by finding and reusing the proper abstractions in the user interface alone. The development cost of web apps can be reduced and the quality can be improved - dramatically!

On this path, the JavaScript allows me to practice the XML DOM GUI programming, without the need to actually deploy Microsoft XAML or Adobe Flex & MXML. I like the XML DOM for GUI development, which is the basis for JavaScript crossword engine described here. I think this new programming model might work very well, especially for the web apps. You can use it now, not waiting for the XAML or MXML or whatever, with the plain JavaScript and the HTML DOM, both of which have 100% browser market penetration.

The effective use of CSS was another area to practice in this project. Being in HTML and JavaScript since 1994, I used to leave CSS to the designers to worry about. Now I try to design the general approach to using CSS and the application skinning as a part of overall design of JavaScript application. As a result, the crosswords are styled exclusively with CSS and fully support skinning. I still have a little bit of work to do on using Attribute Acquisition in CSS to its fullest.

The words weaving turned out to be a very hard algorithmic problem and I am very happy that it is all solved now. I did not find any good recent open-source implementations, only an ancient one in C. I hope to see new crossword words weaving interview questions to replace the string reversal.

Comments (17)

  • Comment by Gavin Vincent — August 9, 2007 @ 11:34 pm

    I am completely blown away by your javascript crossword.

    I thought I would e-mail you after reading your passage and see if you would allow me to use your engine for my site. I am the lone developer of a quiz site I have created called QuiZium ( If you would let me use your generator this would greatly compliment my site.

    Thanks and great work. I really admire your skills.

    Gavin Vincent

  • Comment by rex nedoil — December 12, 2007 @ 12:50 pm

    his is an excellent app. I too would love to use this on my blog, if you let me. After reading your bit about Javascript, I am now seriously contemplating crossing over to the development side of town :)

  • Comment by Horst Reinelt — December 27, 2007 @ 5:31 pm

    Hi, this Crossword Puzzle is really great! We would like to use the game adapted on our non-commercial volunteer fire fighter website.
    With hope of a response

  • Comment by Shorty — February 5, 2008 @ 2:51 pm

    Hi! I have searched for more time a script to create a crossword online but nothing is perfect like your script!! I would like to use this for my non-commercial website, only for fun and learn!
    Bye :)

  • Comment by Reni — February 22, 2008 @ 7:21 am

    We´ve just found your script. We would like to use your script on our german non comercial kids page.

  • Comment by Thomas Johnson — May 8, 2008 @ 10:47 pm

    You guys are my heros, I would love to read your beautiful source code so I can learn and become a better person.

    Thanks so much!

  • Comment by tony — July 14, 2008 @ 10:13 pm

    I ‘ve been written to you for awhile for the crossword generator code but have no response from you. I am sure if you get my email so i di it again. Sorry to bother you.

  • Comment by raffy — January 29, 2009 @ 3:47 am

    hello there!
    hmmm ..i’m just asking for a sample javascript code for crossword puzzle..
    thanks a lot..

  • Comment by raffy — January 29, 2009 @ 3:48 am

    just send to my e-mail..tnx!

  • Comment by Prashant — June 3, 2009 @ 2:53 pm

    Can you provide me complete PHP and Javascript script of crossword puzzle. Please?

  • Comment by Yavuz Tor — August 24, 2009 @ 4:26 pm

    This is a great script. I just wanted to give you the kudos. Great work.

    I enjoyed playing it a little, too. :)

  • Comment by Vishal — November 7, 2009 @ 7:30 am

    I like this.How can i get the code for this

  • Comment by Amit — November 17, 2009 @ 1:39 pm

    I really enjoyed playing GoF crossword. I would like to use the js code to create more puzzle. Could you please provide me the scripts.

  • Comment by carte sd 2gb — December 14, 2009 @ 7:26 am

    I was talking to Doug about his keynote at Add-on-Con tomorrow, and asked him what the motivation was for this alert message. It turns out his webhosting service had contacted him about the unusually high amount of traffic on

  • Comment by german — March 1, 2010 @ 3:44 pm

    I've just found your script. I would like to use your script as a bday gift crossword to my friend, obviously in the non comercial kids page.

  • Comment by Brij Bhushan Huria — September 12, 2012 @ 8:51 am

    It's a free edutainment site and I have published thousands of educative vocabulary based crossword puzzles. But I am fascinated to test your javascript design. I intend to use this one for my site forgetting all other designs. Can you allow me to do so?

  • Comment by FFRK?? — November 6, 2014 @ 1:53 pm

    FFRK I think a lot of fun

Leave a comment

  Copyright © 2004-2015 by Pavel Simakov
any conclusions, recommendations, ideas, thoughts or the source code presented on this site are my own and do not reflect a official opinion of my current or past employers, partners or clients