36
CROSSWORDS Nick Doiron - @mapmeld The Asia Foundation B U R M E E

Burmese Crosswords

Embed Size (px)

Citation preview

Page 1: Burmese Crosswords

CROSSWORDS

Nick Doiron - @mapmeld The Asia Foundation

BURME

E

Page 2: Burmese Crosswords

Nick Doiron - @mapmeld The Asia Foundation

Page 3: Burmese Crosswords
Page 4: Burmese Crosswords

This Talk

• Generating crossword puzzles

• Adapting for NodeJS

• Unicode

• Is this a good idea?

Page 5: Burmese Crosswords

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…”

Page 6: Burmese Crosswords

Background: Crosswords• Revisit even a familiar problem with your present

programmer’s mind

Page 7: Burmese Crosswords

Phase 1: the Web

Page 8: Burmese Crosswords

<canvas>1 2

Page 9: Burmese Crosswords

Approach 1

• Add words sequentially

• Start offset from top left

• Alternate across /down

8

1

2 4

7

6

3 5

Page 10: Burmese Crosswords

Approach 2

• Random start position

• Random across / down

Page 11: Burmese Crosswords

Approach 3

• Look for matchin previous words first

• Randomly sort previous words each time

1

4

2

3

5

9

8

6

7

10

Page 12: Burmese Crosswords

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

Page 13: Burmese Crosswords

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

Page 14: Burmese Crosswords

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()

Page 15: Burmese Crosswords

Phase 2: NodeJS

Page 16: Burmese Crosswords

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

Page 17: Burmese Crosswords

<canvas> on NodeJS• npm install canvas

Page 18: Burmese Crosswords

<canvas> on NodeJS

• You need cairo installed

• Special build-pack on Heroku (and maybe other PaaS)

Page 19: Burmese Crosswords

Phase 3: Unicode

Page 20: Burmese Crosswords

the Unicode you know

Page 21: Burmese Crosswords

Unicode: the dark side

• We don’t talk about:

• Unicode often legitimizes bad encodings and characters

• Non-compliant fonts and inputs

• Brahmic Scripts

Page 22: Burmese Crosswords

Brahmic Scripts

Page 23: Burmese Crosswords

“Myanmar” in Burmese

မ ြ န မ ာ

Page 24: Burmese Crosswords

???

မ င' က)

ဒ ဓ = ဒ-

Page 25: Burmese Crosswords

RegEx• Started like this:(\W(?:[ြ|ျ|||ျ|ေ||ာ|||||||း]+)?)

• npm install regenerate

Page 26: Burmese Crosswords
Page 27: Burmese Crosswords

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

Page 28: Burmese Crosswords

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

Page 29: Burmese Crosswords

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က? က?=>

Page 30: Burmese Crosswords

Is it a good idea?

က'က က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>

combined< 0.5%

eကAI eကB ကBA ကFE eကBI <ကiu <ကE eက ;ကu <ကJ eက? က?=>

Page 31: Burmese Crosswords

One more thing:

ဒ=ေနရAမBA ျမMNA language ထညလiuရလA bro တiu ျမMNA languageနE႔သJးခ'ကViuပY Help ပYအJး

Page 32: Burmese Crosswords

How Zawgyi works

Page 33: Burmese Crosswords

Why hate a font?

• Different uses for same code-points

• like Dvorak as a font

• Overwrites minority languages

Page 34: Burmese Crosswords
Page 35: Burmese Crosswords

Fixing Zawgyi

!

(software and

hardware)

Page 36: Burmese Crosswords

Thanks!

npm install crossword

Nick Doiron - @mapmeld The Asia Foundation