4. This Talk
• Generating crossword puzzles
• Adapting for NodeJS
• Unicode
• Is this a good idea?
5. Background: Crosswords
• Popular in 1920s, NY Times started in 1942
• Dec 18, 1941:
“We ought to proceed with the puzzle…
there will now be bleak blackout hours -- or
if not that, then certainly a need for
relaxation…”
11. Approach 3
• Look for match
in previous
words first
• Randomly sort
previous words
each time
1
4
2
3
5
9
8
6
7
10
12. Check word ends
• If I’m going down
• Make sure there’s nothing above the
start or below the end
• If I’m going across
• Make sure there’s nothing left of the
start or right of the end
13. Check the sides
• For each square that I’d place…
• If it’s an existing square
• Only check that the letter matches
• If it’s a new square…
• and word is going across…
• Fail if there’s a letter above or below
• Add a letter
14. Numbering
• Word starts with a number
• That number should be:
• n, for the n-th word
• i18n_function(n), for the n-th word
• shared_start || i18n_function()
16. Moving to NodeJS
• Biggest step: one-time sequential creation to:
• Separate browser input from program I/O:
• Enter a value and clicking button ->
game.addWord( )
• $(“ul.across”).append() ->
Receive clue number and direction (2 Across)
in callback
21. Unicode: the dark side
• We don’t talk about:
• Unicode often legitimizes bad
encodings and characters
• Non-compliant fonts and inputs
• Brahmic Scripts
25. RegEx
• Started like this:
(W(?:[ြ|ျ|ွ|ှ|ျ|ေ|ဲ|ာ|ိ|ူ|ု|ံ|်|့|း]+)?္)
• npm install regenerate
26.
27. Is it a good idea?
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
28. Is it a good idea?
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
29. Is it a good idea?
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
က' က ကiu ;က <က=> က? ကu eကA e;ကA ကB eက?> ကA ကiu> က= ကC ;ကA> ကD> eက?A
ကBE eက?A' ကi ကF ကD <ကiu> <ကi e;က Hက ;ကA က) eကB> က?iu> e;က> ကEI <ကJI ကE ;ကuJ
က?i က?A> eကA' က?K> eကAI eကB ကBA ကFE eကBI <ကiu <ကE eက ;ကu <ကJ eက? က?=>