<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>blog.zephod.com</title><generator>Tumblr (3.0; @zephod)</generator><link>http://blog.zephod.com/</link><item><title>Lego/Raspberry Pi Project, a set on Flickr.I kept a photo diary...</title><description>&lt;img src="http://25.media.tumblr.com/7007f46f268f5244e8a5dbc0add0254b/tumblr_mfa1a03x5z1r33jyxo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div style="padding: 0; overflow: hidden; margin: 10px auto 0 auto;"&gt;&lt;a href="http://www.flickr.com/photos/zephod/8286533599/in/set-72157632285374850/" title="Organising the Lego (#1)"&gt;&lt;img src="http://farm9.staticflickr.com/8222/8286533599_e6e5969149_m.jpg" alt="Organising the Lego (#1)" style="width:240px; display:inline-block; margin-right:2%; padding:0; border:0; overflow:hidden;"/&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/zephod/8287597538/in/set-72157632285374850/" title="Organising the Lego (#2)"&gt;&lt;img src="http://farm9.staticflickr.com/8483/8287597538_8c99f8f955_m.jpg" alt="Organising the Lego (#2)" style="width:240px; display:inline-block; margin-right:2%; padding:0; border:0; overflow:hidden;"/&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/zephod/8286545783/in/set-72157632285374850/" title="Chassis Mk.1"&gt;&lt;img src="http://farm9.staticflickr.com/8213/8286545783_f78510e0e0_m.jpg" alt="Chassis Mk.1" style="width:240px; display:inline-block; margin-right:2%; padding:0; border:0; overflow:hidden;"/&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/zephod/8286540787/in/set-72157632285374850/" title="Mail-order electronics"&gt;&lt;img src="http://farm9.staticflickr.com/8479/8286540787_dfa7349fed_m.jpg" alt="Mail-order electronics" style="width:180px; display:inline-block; margin-right:2%; padding:0; border:0; overflow:hidden;margin-right:0;"/&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.flickr.com/photos/zephod/sets/72157632285374850/"&gt;Lego/Raspberry Pi Project&lt;/a&gt;, a set on Flickr.&lt;/p&gt;I kept a photo diary during the construction of  the Lego/Xbox/Raspberry Pi project.</description><link>http://blog.zephod.com/post/38298299210</link><guid>http://blog.zephod.com/post/38298299210</guid><pubDate>Wed, 19 Dec 2012 11:58:47 +0000</pubDate></item><item><title>Build your own RC Car using Lego, an Xbox Controller and a Raspberry Pi  </title><description>&lt;p&gt;When I was a child I always wanted a remote control car. I never got one &amp;#8212; usually my parents convinced me that the novelty would wear off in an hour, and that it wouldn&amp;#8217;t be worth the expense. (They were probably right). I usually opted for a safer videogame-based option at Christmas time, and on my birthday I&amp;#8217;d ask for Lego. &lt;/p&gt;
&lt;p&gt;&lt;img class="center" src="http://media.tumblr.com/tumblr_megt60Bszk1r0qvs2.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;The Raspberry Pi &amp;#8212; a tiny, low-power computer that fits in the palm of your hand &amp;#8212; provided the inspiration for a project to finally put that right. Using bricks from my childhood Lego collection, and a wireless Xbox 360 controller from my teenage years, at long last I could hack together a remote control car! How hard could it be?&lt;!-- more --&gt;&lt;/p&gt;
&lt;h3&gt;Not exactly simple&lt;/h3&gt;
&lt;p&gt;I&amp;#8217;m a programmer by trade, but any knowledge of electronics learned during University apparently died at graduation. The necessary software configuration and ~200 lines of Python coding took very little time. The fairly simple circuitry took a &lt;em&gt;long&lt;/em&gt; time, and caught fire on several occasions. Your mileage may vary. &lt;/p&gt;
&lt;p&gt;There have been similar attempts to control RC cars from an Xbox controller:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=LHLnw9Yt1rk"&gt;Dan from Chicago&lt;/a&gt; put a Netduino controller on his car which connects via his laptop.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.jedibowler.com/2011/09/24/controlling-an-rc-car-with-an-xbox-360-controller-via-a-netduino/"&gt;Keegan at jedibowler.com&lt;/a&gt; used Netduino on the car as well, and has a PC on the floor issuing commands.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;This project takes it a step further because the Raspberry Pi is a complete computer, so &lt;strong&gt;all the hardware lives on the car&lt;/strong&gt;. There is no need for a laptop issuing commands over Wifi.&lt;/p&gt;
&lt;h3&gt;Building the Chassis&lt;/h3&gt;
&lt;p&gt;The design of the chassis aims to be as simple and robust as possible. &lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_megt5nIl5L1r0qvs2.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;No, really, robustness is key. Some observations:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Use Technic clip-joints and axles through everything. &lt;/li&gt;
&lt;li&gt;Using Lego studs to join any two parts of the chassis was a waste of effort. Shearing stress pulls them apart easily. &lt;/li&gt;
&lt;li&gt;Servos and motors would rather pull the Lego apart than turn the wheels. They need to be very firmly held in place.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Two motors are required:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;The steering is controlled via a high torque &lt;a href="http://adafruit.com/products/155"&gt;180 degree Towerpro servo from AdaFruit&lt;/a&gt;. A Lego gear is attached with superglue.&lt;/li&gt;
&lt;li&gt;The rear axle is attached to a &lt;a href="http://shop.lego.com/en-US/LEGO-Power-Functions-XL-Motor-8882"&gt;Lego Power Functions XL-Motor&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;img class="pull-right" src="http://media.tumblr.com/tumblr_megt8tTcW31r0qvs2.jpg"/&gt;Originally I used an old 9V Technic motor, but it wasn&amp;#8217;t strong enough to turn the rear axle. There&amp;#8217;s a fascinating &lt;a href="http://www.philohome.com/motors/motorcomp.htm"&gt;analysis of Lego motors on philohome.com&lt;/a&gt; which suggests that the newer motor has around 40 times more torque. I purchased one online for just $10.&lt;/p&gt;
&lt;h3&gt;Electronics and Soldering&lt;/h3&gt;
&lt;p&gt;The motors are controlled via PWM (&lt;em&gt;Pulse Width Modulation&lt;/em&gt;) using the excellent &lt;a href="http://adafruit.com/products/815"&gt;Adafruit 16-channel PWM driver&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img class="center" src="http://media.tumblr.com/tumblr_megto9y85g1r0qvs2.png"/&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi"&gt;tutorials on Adafruit&amp;#8217;s website&lt;/a&gt; are truly exemplary, and in less than an hour I had the Raspberry Pi controlling motor speed and servo rotation. &lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_megts93Eni1r0qvs2.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;The above shot demonstrates circuitry mounted onto the chassis.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Adafruit&amp;#8217;s &lt;a href="http://adafruit.com/products/914"&gt;Cobbler Breakout Kit&lt;/a&gt; is used to connect the Raspberry Pi to a prototyping plug-board.&lt;/li&gt;
&lt;li&gt;The i2c connectors (&lt;code&gt;SDA0&lt;/code&gt; and &lt;code&gt;SCL0&lt;/code&gt;, &lt;code&gt;3v3&lt;/code&gt; and &lt;code&gt;GND&lt;/code&gt;) are then connected to the PWM driver.&lt;/li&gt;
&lt;li&gt;GPIO pins &lt;code&gt;21&lt;/code&gt; and &lt;code&gt;17&lt;/code&gt; are connected to a cheap &lt;a href="http://en.wikipedia.org/wiki/H_bridge"&gt;H Bridge&lt;/a&gt; chip, specifically the &lt;a href="http://www.pololu.com/catalog/product/713"&gt;TB6612FNG from pololu.com&lt;/a&gt;. This will drive the main motor forwards or backwards. &lt;/li&gt;
&lt;li&gt;Output &lt;code&gt;0&lt;/code&gt; on the PWM driver runs into the H Bridge. This controls the main motor&amp;#8217;s speed.&lt;/li&gt;
&lt;li&gt;Output &lt;code&gt;1&lt;/code&gt; on the PWM driver runs to the steering servo.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Software&lt;/h3&gt;
&lt;p&gt;Finally, the Raspberry Pi must be loaded with some software which translates Xbox controller buttons into motor speed, motor direction, and steering rotation. &lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_megtapIwDB1r0qvs2.png"/&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.amazon.co.uk/Xbox-Wireless-Gaming-Receiver-Windows/dp/B000MGVAAQ"&gt;Xbox 360 Wireless Gaming Receiver for Windows&lt;/a&gt; is required to connect the controller. Microsoft use a custom wireless protocol, so a regular Bluetooth modem will not work. This bulky device consumes quite a lot of power, but at least it is relatively inexpensive.&lt;/p&gt;
&lt;p&gt;&amp;#8220;For Windows&amp;#8221; should not be taken too seriously. Ingo Ruhnke&amp;#8217;s excellent &lt;a href="http://pingus.seul.org/~grumbel/xboxdrv/"&gt;Xbox/Xbox 360 USB Gamepad Driver for Linux&lt;/a&gt; is a perfect solution for hooking up the wireless USB device, and it installs in seconds on a Raspberry Pi running Ubuntu.&lt;/p&gt;
&lt;p&gt;At last, I can get back to programming! I hacked together a couple of Python modules to:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Run &lt;code&gt;xboxdrv&lt;/code&gt; as a subprocess, which connects to the controller.&lt;/li&gt;
&lt;li&gt;Read from the &lt;code&gt;stdout&lt;/code&gt; pipe as it constantly prints out the controller state.&lt;/li&gt;
&lt;li&gt;Watch for changes in &lt;code&gt;LT&lt;/code&gt; (left trigger), &lt;code&gt;RT&lt;/code&gt; (right trigger) and &lt;code&gt;X1&lt;/code&gt; (left thumbstick).&lt;/li&gt;
&lt;li&gt;Update the outputs as appropriate through Adafruit&amp;#8217;s libraries.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For example, to control the steering:&lt;/p&gt;
&lt;pre&gt;# Left thumbstick controls the steering
if event.key=='X1':
    steer = int( servoMid + (servoWidth*-event.value)/32768 )
    pwm.setPWM(1, 0, steer)&lt;/pre&gt;
&lt;p&gt;The complete software kit is available in &lt;a href="http://github.com/zephod/lego-pi"&gt;a repository on Github&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Completion&lt;/h3&gt;
&lt;p&gt;Here&amp;#8217;s my DIY-RC-Car in action. Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="284" src="http://www.youtube.com/embed/X7YRqCCBDBU" width="505"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt; &lt;/h3&gt;
&lt;p&gt;&lt;img class="pull-left" src="http://media.tumblr.com/tumblr_megv8mFGhM1r0qvs2.png"/&gt;Tom Rees is a freelance hacker, developer, and code poet. You can &lt;a href="http://twitter.com/zephod"&gt;follow him on Twitter&lt;/a&gt; if you like this sort of thing.&lt;/p&gt;</description><link>http://blog.zephod.com/post/37120089376</link><guid>http://blog.zephod.com/post/37120089376</guid><pubDate>Mon, 03 Dec 2012 17:41:00 +0000</pubDate></item><item><title>Hacking Scrabble</title><description>&lt;p&gt;&lt;strong&gt;For the lazy:&lt;/strong&gt; Not interested in all this data wrangling? Skip straight to these summary graphics to improve your Scrabble game:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://24.media.tumblr.com/tumblr_m7op8keoIy1r33jyxo1_r1_1280.png"&gt;&lt;img alt="US/Canadian Version" src="http://24.media.tumblr.com/tumblr_m7op8keoIy1r33jyxo1_r1_250.png"/&gt;&lt;/a&gt;&lt;a href="http://25.media.tumblr.com/tumblr_m7oqnan1JR1r33jyxo1_1280.png"&gt;&lt;img alt="International version" src="http://25.media.tumblr.com/tumblr_m7oqnan1JR1r33jyxo1_250.png"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;A while ago I was &lt;a href="http://blog.zephod.com/post/14167418899/hacking-scrabble-part-1"&gt;blogging about&lt;/a&gt; a little research project I called Hacking Scrabble, which received a lot of interest and was &lt;a href="http://lifehacker.com/5868095/hacking-scrabble-part-one"&gt;published on LifeHacker&lt;/a&gt;. I was trying to get better at the game by using the kind of memory tricks we learned in school:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“My Very Easy Method Just Speeds Up Naming Planets”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I’m a programmer by trade so inevitably I wrote &lt;a href="http://github.com/zephod/scrabble-tools"&gt;Mnemonic Finder&lt;/a&gt;, a Python program to quickly search the dictionary looking for these kinds of phrases. The idea was to memorise all &lt;strong&gt;two-letter words&lt;/strong&gt;, which I’m targeting because:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;They are vital. Games become stagnant when the board is full up and nobody can play in the tight corners without creating a string of two-letter words.&lt;/li&gt;
&lt;li&gt;There aren’t actually that many of them: 124 in the international rules, 101 in the US rules.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;!-- more --&gt;&lt;/div&gt;
&lt;h3&gt;The Solution (First Attempt)&lt;/h3&gt;
&lt;p&gt;My &lt;a href="http://blog.zephod.com/post/14167418899/hacking-scrabble-part-1"&gt;first attempt at writing this column&lt;/a&gt; arrived at a technique which &lt;em&gt;sort of&lt;/em&gt; worked.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Every 2 letter word is a &lt;strong&gt;prefix&lt;/strong&gt; and a &lt;strong&gt;suffix&lt;/strong&gt;.
&lt;ul&gt;&lt;li&gt;&lt;em&gt;eg. &lt;strong&gt;“&lt;code&gt;at&lt;/code&gt;”&lt;/strong&gt; has a prefix &lt;strong&gt;“&lt;code&gt;a&lt;/code&gt;”&lt;/strong&gt; and a suffix &lt;strong&gt;“&lt;code&gt;t&lt;/code&gt;”&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;So every &lt;strong&gt;prefix&lt;/strong&gt; can have a few different &lt;strong&gt;suffixes&lt;/strong&gt;.
&lt;ul&gt;&lt;li&gt;&lt;em&gt;The prefix &lt;strong&gt;&lt;code&gt;a&lt;/code&gt;&lt;/strong&gt; can have suffix &lt;strong&gt;&lt;code&gt;t&lt;/code&gt;&lt;/strong&gt; but not suffix &lt;strong&gt;&lt;code&gt;q&lt;/code&gt;&lt;/strong&gt;, because &lt;strong&gt;&lt;code&gt;aq&lt;/code&gt;&lt;/strong&gt; is not a word.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;For each letter, list &lt;em&gt;all&lt;/em&gt;its possible suffixes.
&lt;ul&gt;&lt;li&gt;&lt;em&gt;&lt;strong&gt;&lt;code&gt;a&lt;/code&gt;&lt;/strong&gt; can have any of: &lt;strong&gt;&lt;code&gt;abdeghilmnrstwxy&lt;/code&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Use Mnemonic Finder to look for a phrase which &lt;strong&gt;contains all those letters&lt;/strong&gt; but &lt;strong&gt;no other letters&lt;/strong&gt;.
&lt;ul&gt;&lt;li&gt;&lt;em&gt;“&lt;strong&gt;&lt;code&gt;birthdays mangle wax&lt;/code&gt;&lt;/strong&gt;” will help you remember all the letters that can go after &lt;strong&gt;&lt;code&gt;a&lt;/code&gt;&lt;/strong&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Why Doesn’t It Work?&lt;/h3&gt;
&lt;p&gt;First, it’s not &lt;em&gt;that&lt;/em&gt; great. I still need to memorise twenty six phrases and know which letter they each apply to.&lt;/p&gt;
&lt;p&gt;Second, the suffixes of &lt;strong&gt;&lt;code&gt;u&lt;/code&gt;&lt;/strong&gt; are &lt;strong&gt;&lt;code&gt;ghmnprst&lt;/code&gt;&lt;/strong&gt;. Can you see the problem? There are no vowels! &lt;strong&gt;&lt;code&gt;ua&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;ue&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;ui&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;uo&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;code&gt;uu&lt;/code&gt;&lt;/strong&gt; are not words. So Mnemonic Finder can’t find a single thing in the dictionary. Maybe you can learn it by saying it out loud: “Gahumnapurst”. Maybe not.&lt;/p&gt;
&lt;p&gt;In fact, out of twenty six attempts, I only succeeded in finding about ten useful phrases. Okay, it’s better than learning over a hundred words, but we can do better still with a little lateral thinking.&lt;/p&gt;
&lt;h3&gt;Restructuring The Problem&lt;/h3&gt;
&lt;p&gt;Many astute readers emailed me to point out that &lt;strong&gt;nearly all two-letter words contain a vowel&lt;/strong&gt;. Instead of memorising the suffixes of every letter, we could memorise the &lt;strong&gt;suffixes and prefixes of every vowel&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;               &amp;lt;&amp;lt; prefixes    vowel   suffixes &amp;gt;&amp;gt;
           ------------------------------------------
            ztnlkjhdbfypmae     a     aeibdghlmnrstwxy
             ywtrpnmhfdbaeo     e     aedfhlmnrstx
             xtsqpmlhkdgboa     i     odfnst
          zywtsmlkjhbdgnpio     o     eioubdfhmnprswxy
                     gmnxyo     u     ghmnprst
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;This is a great idea: We only have to memorise &lt;em&gt;ten phrases&lt;/em&gt;… plus a few words containing no vowels.&lt;/li&gt;
&lt;li&gt;However, the computer still has trouble finding words in the dictionary… “&lt;strong&gt;&lt;code&gt;ghmnprst&lt;/code&gt;&lt;/strong&gt;” is still up there.&lt;/li&gt;
&lt;li&gt;There’s a bit of redundant information in there. &lt;strong&gt;&lt;code&gt;o&lt;/code&gt;&lt;/strong&gt; is both a &lt;strong&gt;prefix&lt;/strong&gt; and a &lt;strong&gt;suffix&lt;/strong&gt; of itself because &lt;strong&gt;&lt;code&gt;oo&lt;/code&gt;&lt;/strong&gt; is a word.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;We’re on the right path. A final step is needed to make this work.&lt;/p&gt;
&lt;h3&gt;Just The Consonants, Please&lt;/h3&gt;
&lt;p&gt;The problem is that it’s hard to find mnemonics if you don’t have many vowels. I experimented with a tweak to Mnemonic Finder allowing it to use &lt;em&gt;all the vowels it likes&lt;/em&gt;, and once again gave it &lt;strong&gt;&lt;code&gt;ghmnprst&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;    "prognathism"
    "graph mints"
    "hemp string"
    "nightmare gasp"
    ...
&lt;/pre&gt;
&lt;p&gt;Thousands of phrases tumbled out! This is the key to the solution: Let’s seperate the vowels from the consonants. Here’s the table again with &lt;strong&gt;only consonants&lt;/strong&gt; in the left and right columns.&lt;/p&gt;
&lt;pre&gt;                &amp;lt;&amp;lt; prefixes   vowel   suffixes &amp;gt;&amp;gt;
            ------------------------------------------
              ztnlkjhdbfypm     a     bdghlmnrstwxy
                ywtrpnmhfdb     e     dfhlmnrstx
               xtsqpmlhkdgb     i     dfnst
            zywtsmlkjhbdgnp     o     bdfhmnprswxy
                      gmnxy     u     ghmnprst
&lt;/pre&gt;
&lt;p&gt;The words we had to remove were the &lt;strong&gt;double vowels&lt;/strong&gt;. A shame that they didn’t fit, but they won’t be too difficult to memorise: There’s only nine of them (or just five for players in the USA).&lt;/p&gt;
&lt;pre&gt;    aa ae ai ee ea io oo ou oe 
&lt;/pre&gt;
&lt;p&gt;Finally, I’ve avoided telling you about the &lt;strong&gt;double consonants&lt;/strong&gt;. They never fitted onto that table anyway, and must also be memorised the hard way:&lt;/p&gt;
&lt;pre&gt;    sh ch st mm hm my ky fy by ny
&lt;/pre&gt;
&lt;h3&gt;Through the Mnemonic Machine&lt;/h3&gt;
&lt;p&gt;Using Mnemonic Finder in “free vowels mode” produces hundreds (usually thousands) of dictionary words for each entry in the table. At last, we can replace ugly blocks such as &lt;strong&gt;&lt;code&gt;ghmnprst&lt;/code&gt;&lt;/strong&gt; with meaningful, memorable phrases like &lt;strong&gt;&lt;code&gt;hemp string&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;                    &amp;lt;&amp;lt; prefixes   vowel   suffixes &amp;gt;&amp;gt;
      ------------------------------------------------------------
  the band played folk jazz metal   a   birthdays mangle wax
             thumbprint fade away   e   tax his farmland
     exquisite godlike humble pie   i   infested
      mask playing with jazz band   o   six dumb hippy windsurfers
                         onyx gem   u   hemp string
&lt;/pre&gt;
&lt;p&gt;You can generate your own if these aren’t to your taste. I prefer phrases with a powerful (if absurd) mental image. I’ve logged my development in a public gist for both the &lt;a href="https://gist.github.com/3141231"&gt;International version&lt;/a&gt; and the &lt;a href="https://gist.github.com/3141380"&gt;US/Canada version&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is important to remember that we are &lt;strong&gt;just memorising consonants&lt;/strong&gt;. The suffixes of &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt; are &lt;strong&gt;“&lt;code&gt;infested&lt;/code&gt;”&lt;/strong&gt;, meaning &lt;strong&gt;&lt;code&gt;n&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;f&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;s&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;t&lt;/code&gt;&lt;/strong&gt;, or &lt;strong&gt;&lt;code&gt;d&lt;/code&gt;&lt;/strong&gt;. Ignore the vowels; &lt;strong&gt;&lt;code&gt;ie&lt;/code&gt;&lt;/strong&gt; is not a word.&lt;/p&gt;
&lt;p&gt;Once you understand and memorise that table, you know &lt;strong&gt;one hundred and four&lt;/strong&gt; words! The remaining twenty I leave to you. Did you think it was all going to be that easy?&lt;/p&gt;
&lt;pre&gt;    aa ae ai ee ea io oo ou oe 
    sh ch st mm hm my ky fy by ny
&lt;/pre&gt;
&lt;h3&gt;In A Real Life Battle Situation..&amp;#46;&lt;/h3&gt;
&lt;p&gt;So you want to play a two-letter-word, but you’re not sure it exists?&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;If it’s a &lt;strong&gt;double consonant&lt;/strong&gt;, you should know it by heart.&lt;/li&gt;
&lt;li&gt;If it’s a &lt;strong&gt;double vowel&lt;/strong&gt;, you should also know it by heart!&lt;/li&gt;
&lt;li&gt;If it &lt;strong&gt;starts with a vowel&lt;/strong&gt;, think of the &lt;strong&gt;right hand column&lt;/strong&gt;.
&lt;ul&gt;&lt;li&gt;&lt;em&gt;Eg. The first letter is &lt;strong&gt;&lt;code&gt;e&lt;/code&gt;&lt;/strong&gt;, the second letter must be in &lt;strong&gt;&lt;code&gt;tax his farmland&lt;/code&gt;&lt;/strong&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;If it &lt;strong&gt;ends with a vowel&lt;/strong&gt;, think of the &lt;strong&gt;left hand column&lt;/strong&gt;.
&lt;ul&gt;&lt;li&gt;&lt;em&gt;Eg. if the last letter is &lt;strong&gt;&lt;code&gt;e&lt;/code&gt;&lt;/strong&gt;, the first letter must be in &lt;strong&gt;&lt;code&gt;thumbprint fade away&lt;/code&gt;&lt;/strong&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Fortunately, I have turned all of this into a beautiful infographic that you can print out and treasure forever.&lt;/p&gt;
&lt;p&gt;For players using the North American rules (US, Canada, and Thailand): &lt;a href="http://24.media.tumblr.com/tumblr_m7op8keoIy1r33jyxo1_r1_1280.png"&gt;&lt;img alt="The US version of the Scrabble memory technique I have been researching. (Valid in the US, Canada and Thailand).
Source data here: https://gist.github.com/3141380" src="http://24.media.tumblr.com/tumblr_m7op8keoIy1r33jyxo1_r1_500.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For players using the International rules (everywhere &lt;em&gt;except&lt;/em&gt; the US, Canada and Thailand): &lt;a href="http://25.media.tumblr.com/tumblr_m7oqnan1JR1r33jyxo1_1280.png"&gt;&lt;img alt="The International version of the Scrabble memory technique I have been researching. (Valid everywhere except the US, Canada and Thailand).
Source data here: https://gist.github.com/3141231" src="http://25.media.tumblr.com/tumblr_m7oqnan1JR1r33jyxo1_500.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;&lt;p&gt;I am Tom Rees, a freelance hacker and engineer. I write &lt;a href="http://github.com/zephod"&gt;lots of code&lt;/a&gt; for the &lt;a href="http://okfn.org"&gt;Open Knowledge Foundation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You should &lt;a href="http://twitter.com/zephod"&gt;follow me on Twitter&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.zephod.com/post/28118665268</link><guid>http://blog.zephod.com/post/28118665268</guid><pubDate>Fri, 27 Jul 2012 10:41:00 +0100</pubDate></item><item><title>The International version of the Scrabble memory technique I...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m7oqnan1JR1r33jyxo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The International version of the Scrabble memory technique I have been researching. (Valid everywhere except the US, Canada and Thailand).&lt;/p&gt;
&lt;p&gt;Source data here: &lt;a href="https://gist.github.com/3141231" title="https://gist.github.com/3141231" target="_blank"&gt;&lt;a href="https://gist.github.com/3141231"&gt;https://gist.github.com/3141231&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.zephod.com/post/27935087126</link><guid>http://blog.zephod.com/post/27935087126</guid><pubDate>Tue, 24 Jul 2012 23:04:22 +0100</pubDate></item><item><title>The US version of the Scrabble memory technique I have been...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_m7op8keoIy1r33jyxo1_r1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The US version of the Scrabble memory technique I have been researching. (Valid in the US, Canada and Thailand).&lt;/p&gt;
&lt;p&gt;Source data here: &lt;a href="https://gist.github.com/3141380" title="https://gist.github.com/3141380" target="_blank"&gt;&lt;a href="https://gist.github.com/3141380"&gt;https://gist.github.com/3141380&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.zephod.com/post/27933044619</link><guid>http://blog.zephod.com/post/27933044619</guid><pubDate>Tue, 24 Jul 2012 22:33:00 +0100</pubDate></item><item><title>Hacking Scrabble (part 1)</title><description>&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; See &lt;a href="http://blog.zephod.com/post/28118665268/hacking-scrabble" target="_self"&gt;this article&lt;/a&gt; for the final result of this project!&lt;/p&gt;
&lt;p&gt;This post isn&amp;#8217;t really about Scrabble. It&amp;#8217;s about taking a load of ugly data and hacking around with some scripts to refine it into something I can commit to memory. &lt;em&gt;Then&lt;/em&gt; its about Scrabble. Winning at Scrabble.&lt;/p&gt;
&lt;h3&gt;The Problem&lt;/h3&gt;
&lt;p&gt;Knowing exactly which two-letter words exist gives a player a sizeable advantage because it opens up tight corners of the game board and allows them to run two words side-by-side. Sadly most of us only know a handful, and beyond that we&amp;#8217;re guessing. Then we&amp;#8217;re arguing. And then (inevitably) looking on Google for a list of valid words. &lt;/p&gt;
&lt;p&gt;Personally I&amp;#8217;m all for having the 2-letter-word-list on display during play to help us out of tight spots and to keep things fair. But I&amp;#8217;ve had plenty of opponents object to this, saying that if I really want to play like that I should &lt;em&gt;memorize the list&lt;/em&gt;. How hard can it be?&lt;!-- more --&gt;&lt;/p&gt;
&lt;div class="cutout"&gt;&lt;code&gt;aa ab ad ae ag ah ai al am an ar as at aw ax ay ba be bi bo by ch da de di do ea ed ee ef eh el em en er es et ex fa fe fy gi go gu ha he hi hm ho id if in io is it ja jo ka ki ko ky la li lo ma me mi mm mo mu my na ne no nu ny ob od oe of oh oi om on oo op or os ou ow ox oy pa pe pi po qi re sh si so st ta te ti to ug uh um un up ur us ut we wo xi xu ya ye yo yu za zo&lt;/code&gt;&lt;/div&gt;
&lt;div class="cutout"&gt;(source: &lt;a href="http://en.wiktionary.org/wiki/Appendix:Official_English_Scrabble_2-letter_words"&gt;SOWPODS&lt;/a&gt;, used for British tournament play)&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s 124 words! More than a hundred arbitrary letter-pairs, with no connecting pattern and most of which I don&amp;#8217;t recognise. Committing that to memory is better left to sauvants who can happily recall the order of a shuffled deck of cards.&lt;/p&gt;
&lt;p&gt;I had already given up with the problem, and I was writing the list out on paper to be kept in the game box. To make it easier to fit on a page, I tried to compress the information, producing a table like this:&lt;/p&gt;
&lt;pre&gt;a: abdeghilmnrstwxy   j: ao                 s: hiot
b: aeioy              k: aioy               t: aeio
c: h                  l: aio                u: ghmnprst
d: aeio               m: aeimouy            w: eo
e: adefhlmnrstx       n: aeouy              x: iu
f: aey                o: bdefhimnoprsuwxy   y: aeou
g: iou                p: aeio               z: ao
h: aeimo              q: i                 
i: dfnost             r: e&lt;/pre&gt;
&lt;p&gt;Suddenly it&amp;#8217;s not so terrifying, is it? The data has some structure. Every &lt;strong&gt;prefix&lt;/strong&gt; has a number of possible &lt;strong&gt;suffixes.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;b&lt;/strong&gt; can be followed by &lt;strong&gt;a&lt;/strong&gt;, &lt;strong&gt;e&lt;/strong&gt;, &lt;strong&gt;i&lt;/strong&gt;, &lt;strong&gt;o&lt;/strong&gt;, or &lt;strong&gt;y&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;But &lt;strong&gt;c&lt;/strong&gt; can only be followed by &lt;strong&gt;h&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;It&amp;#8217;s still a lot to commit to memory. Too much: &lt;strong&gt;a&lt;/strong&gt; and &lt;strong&gt;o&lt;/strong&gt; each have sixteen possible suffixes!&lt;/p&gt;
&lt;h3&gt;The Mnemonic Method&lt;/h3&gt;
&lt;p&gt;I still believe it can be done! The key is in finding an appropriate mnemonic to help us remember arbitrary sets of letters.&lt;/p&gt;
&lt;p&gt;So let&amp;#8217;s begin with all the two-letter-words starting with &lt;strong&gt;a&lt;/strong&gt;. If I can memorize the set of letters &amp;#8216;&lt;strong&gt;abdeghilmnrstwxy&lt;/strong&gt;&amp;#8217; then I can mentally verify any word that starts with &lt;strong&gt;a&lt;/strong&gt; by asking, &amp;#8216;is the &lt;strong&gt;suffix&lt;/strong&gt; in that set?&amp;#8217;&lt;/p&gt;
&lt;h4&gt;The Mnemonic Method: Anagrams&lt;/h4&gt;
&lt;p&gt;Your first thought might be to search for anagrams of the string. Mine was too. You&amp;#8217;re out of luck - just try asking Wolfram Alpha for &lt;a href="http://www.wolframalpha.com/input/?i=anagrams+of+abdeghilmnrstwxy" title="Wolfram Alpha query" target="_blank"&gt;anagrams of abdefhilmnrstwxy&lt;/a&gt;. The problem is simply that there are too few vowels available to build good words. &lt;/p&gt;
&lt;h4&gt;The Mnemonic Method: Word Subsets&lt;/h4&gt;
&lt;p&gt;Try asking Wolfram Alpha for &lt;a href="http://www.wolframalpha.com/input/?i=word+subsets+of+abdeghilmnrstwxy" title="Wolfram Alpha query" target="_blank"&gt;word subsets of abdeghilmnrstwxy&lt;/a&gt;. Now we&amp;#8217;re on to something - it returns 4243 results. &lt;/p&gt;
&lt;div&gt;
&lt;blockquote&gt;a  |  Abe  |  abed  |  Abel  |  abet  |  abets  |  abide  |  abides  |  able  |  abler  |  ables  |  ablest  |  ably  |  Abner  |  abridge  |  abridges  |  abridgment  |  abridgments  |  abs  |  ABS  |  abseil  |  absent  |  absently  |  absinthe  |  &amp;#8230;   (total: 4243)&lt;/blockquote&gt;
&lt;/div&gt;
&lt;p&gt;These are words containing only those letters. If we can memorize enough of those words to cover all sixteen letters (&amp;#8216;axe labs abridgements&amp;#8230;&amp;#8217;) then we can mentally verify any two-letter-word starting with &lt;strong&gt;a&lt;/strong&gt; by asking &amp;#8216;is the &lt;strong&gt;suffix&lt;/strong&gt; in any of those words?&amp;#8217;.&lt;/p&gt;
&lt;p&gt;A couple of observations at this point:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Hand-picking the right words from 4243 results is painful.&lt;/li&gt;
&lt;li&gt;Words like &lt;strong&gt;beer&lt;/strong&gt; are missing because they re-use the letter &lt;strong&gt;e&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For the purpose of this memory-check, we don&amp;#8217;t care if a letter appears more than once. To memorize the letters &lt;strong&gt;elh&lt;/strong&gt;, we might remember it as &amp;#8216;&lt;strong&gt;hell&lt;/strong&gt;&amp;#8217; - but this method will not suggest that word.&lt;/p&gt;
&lt;h3&gt;The Solution&lt;/h3&gt;
&lt;p&gt;Wolfram Alpha&amp;#8217;s algorithm is based around the following operation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Find every word in the list of letters, and check it is in the dictionary.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We can find many more words by reversing the process:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Find every word in the dictionary, and check only uses letters in the list.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I went on to &lt;a href="https://github.com/zephod/scrabble-tools" title="GitHub Scrabble Tools link" target="_blank"&gt;hack together this Python script&lt;/a&gt; which does exactly this. It allows us to control specific things like &lt;strong&gt;minimum and maximum word length&lt;/strong&gt; and allows &lt;strong&gt;reuse of letters&lt;/strong&gt;, so finds many more words than Wolfram Alpha can.&lt;/p&gt;
&lt;p&gt;Armed with this huge number of words, we can programatically look for groups of them which cover all the letters, and save them as mnemonic devices.&lt;/p&gt;
&lt;p&gt;The 100-line algorithm runs as follows:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Load up a good &lt;a href="http://wordlist.sourceforge.net/" title="Word lists"&gt;British word list&lt;/a&gt; (obtained from anywhere on the internet).&lt;/li&gt;
&lt;li&gt;Filter the list to remove words which contain the wrong letters. Using the letters &amp;#8216;&lt;strong&gt;abdeghilmnrstwxy&lt;/strong&gt;&amp;#8217;, &lt;strong&gt;beer&lt;/strong&gt; remains in the list while &lt;strong&gt;vodka&lt;/strong&gt; is removed.&lt;/li&gt;
&lt;li&gt;Find the word which uses &lt;em&gt;as many different letters as possible&lt;/em&gt;. Eg &lt;strong&gt;&amp;#8216;nearsightedly&lt;/strong&gt;&amp;#8217; which uses twelve of the letters. This is the start of the mnemonic.&lt;/li&gt;
&lt;li&gt;Keep finding words which use up the remaining letters.&lt;/li&gt;
&lt;li&gt;Loop until all letters are covered. Eg. &amp;#8220;&lt;strong&gt;nearsightedly wax balm&lt;/strong&gt;&amp;#8221;.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Demonstration &lt;/h3&gt;
&lt;p&gt;This is it! Here I am, searching for mnemonics to help me remember the two-letter-words starting with &lt;strong&gt;a&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;$ python mnemonicfinder.py abdeghilmnrstwxy --minlen 3 --maxlen 9
==&amp;gt; MnemonicFinder v1.0
--&amp;gt; Loading dictionary...
--&amp;gt; Search string: abdeghilmnrstwxy
--&amp;gt; Generating...
--&amp;gt; Mnemonic: ['bearishly', 'midwing', 'tax']
--&amp;gt; Mnemonic: ['berthings', 'madly', 'wax']
--&amp;gt; Mnemonic: ['betraying', 'mildews', 'hex']
--&amp;gt; Mnemonic: ['birthdays', 'mangle', 'wax']
    (output clipped)&lt;/pre&gt;
&lt;p&gt;Okay, some are better than others. By scanning the output for a sentence or phrase which I can attach to a mental image, I can make it memorable: &amp;#8220;&lt;strong&gt;birthdays mangle wax&lt;/strong&gt;&amp;#8221; means candles on a birthday cake. Is &lt;strong&gt;ap&lt;/strong&gt; a word? No, because there&amp;#8217;s no &lt;strong&gt;p&lt;/strong&gt; in that phrase.&lt;/p&gt;
&lt;p&gt;Hooray! I am one twenty-sixth of the way towards memorising all of the two-letter-words permitted in Scrabble. Have a look at &lt;a href="https://github.com/zephod/scrabble-tools" title="GitHub link" target="_blank"&gt;the files on GitHub&lt;/a&gt; if you want to try out the script for yourself. In Part 2, I&amp;#8217;ll develop 26 mnemonics and work on a technique for memorising them.&lt;/p&gt;</description><link>http://blog.zephod.com/post/14167418899</link><guid>http://blog.zephod.com/post/14167418899</guid><pubDate>Tue, 13 Dec 2011 15:11:00 +0000</pubDate></item></channel></rss>
