crosswords puzzles - queensjs
TRANSCRIPT
Crossword Puzzles
in Burmese and JavaScript
!
Nick Doiron — @mapmeld
About Me
This presentation
• Generating crossword puzzles
• Making it work with Unicode
• … is this a good idea?
Revisiting Crosswords
Data modeling
• Crossword puzzle is a 2D array{ letter: null || String, number: null || String } // accept Unicode numerals
Rendering• <canvas>var canvas = $(‘canvas’).get(0); ctx = canvas.getContext(‘2d’);
• When you set a letter, print embedded white square, then maybe a number
Placing words?
Random?
Seeking out matches
Seeking word matches
• Longest words first
• Shuffle previous words to spread out connections
• No prefixes, suffixes, or going parallel to previous words
NodeJS• npm install canvas!
• (need dependencies / buildpacks on cloud)
NodeJS• Making a Crossword object!
• Pass <canvas> element (Node or client) into Crossword constructor!
• Moving client-side events to function calls!
• CLI!
• npm install crossword -g
Not emoji
yes this talk is secretly about Unicode the not-fun parts
How I got into this
Current State of Burmese• I’m on the Unicode Myanmar workgroup
• iOS 10 supports Burmese!
• The JS Intl API
• Traditional calendar unsupported :-(
• Alphabet Team
Intimidating Linguistics Part
How Burmese works
မန #မန$မ% မ ြ န ် မ ာ
မဂ*လ%ပ-
င ် ္ ဂ ????
Rise of theGrapheme Cluster
RegEx to end all RegExes?
• No, use npm install regenerate
Numerals
• npm install myanmar-numbers block.number = shared_start || i18n_function( clue_number++ )
Is it a good idea?
hypothetical case-sensitive crossword
Is it a good idea? 54 variations
Is it a good idea?
Thank You !!Nick Doiron — @mapmeld