<div>In the London Dojo last month, we worked on Word Chains or Word Ladders.</div><div><br></div>I have finally got round to implementing the breadth first algorithm:<div><a href="https://github.com/c4m3lo/word-chains/blob/master/team_1/wordchain_bf.py" target="_blank">https://github.com/c4m3lo/word-chains/blob/master/team_1/wordchain_bf.py</a> <br>
<div><br></div><div>It seems to perform reasonably well:</div><div><div><font face="courier new, monospace">$ python wordchain_bf.py ape man</font></div><div><font face="courier new, monospace">Using a dictionary with 585 3-letter words</font></div>
<div><span style="font-family:'courier new',monospace">Solution in 5 steps: ['ape', 'apt', 'opt', 'oat', 'mat', 'man']</span></div><div><span style="font-family:'courier new',monospace"><br>
</span></div><div><span style="font-family:'courier new',monospace">$ time python wordchain_bf.py flour bread</span></div><div><font face="courier new, monospace">Using a dictionary with 4607 5-letter words</font></div>
<div><span style="font-family:'courier new',monospace">Solution in 6 steps: ['flour', 'floor', 'flood', 'blood', 'brood', 'broad', 'bread']</span></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">real 0m0.588s</font></div><div><font face="courier new, monospace">user 0m0.320s</font></div><div><font face="courier new, monospace">sys 0m0.090s</font></div>
</div><div><br></div><div>Using Ubuntu's <font face="courier new, monospace">/usr/share/dict/words</font></div><div><div><font face="courier new, monospace">$ time python wordchain_bf.py seven eight</font></div><div><font face="courier new, monospace">Using a dictionary with 4608 5-letter words</font></div>
<div><span style="font-family:'courier new',monospace">No solution</span></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">real 0m13.318s</font></div><div>
<font face="courier new, monospace">user 0m13.020s</font></div><div><font face="courier new, monospace">sys 0m0.110s</font></div></div><div><br></div><div>Using SOWPODS:</div><div><div><font face="courier new, monospace">$ time python wordchain_bf.py -d sowpods seven eight</font></div>
<div><font face="courier new, monospace">Using a dictionary with 12478 5-letter words</font></div><div><font face="courier new, monospace">Solution in 9 steps: ['seven', 'semen', 'samen', 'sames', 'sanes', 'sines', 'sinhs', 'sighs', 'sight', 'eight']</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">real 1m10.842s</font></div><div><font face="courier new, monospace">user 1m10.500s</font></div><div><font face="courier new, monospace">sys 0m0.120s</font></div>
</div><div><br></div><div>See you tomorrow for the next one!</div><div><br></div><div>Dave</div><div><br></div><div><br></div><div><div class="gmail_quote">On 8 June 2012 14:47, Nicholas H.Tollervey <span dir="ltr"><<a href="mailto:ntoll@ntoll.org" target="_blank">ntoll@ntoll.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div>Hi Dave,<br>
<br>
See <a href="https://github.com/ntoll/word-chains" target="_blank">https://github.com/ntoll/word-chains</a> (the team_1 folder).<br>
<br>
Enjoy your weekend hack! ;-)<br>
<br>
N.<br>
<div><br>
On 08/06/12 14:44, David Walker wrote:<br>
> Nick,<br>
><br>
> Did you manage to get the code we wrote last night onto Github? I<br>
> fancy trying to fix my bugs.<br>
><br>
> Cheers,<br>
><br>
> Dave<br>
><br>
> On 31 May 2012 11:04, Nicholas H.Tollervey <<a href="mailto:ntoll@ntoll.org" target="_blank">ntoll@ntoll.org</a><br>
</div><div>> <mailto:<a href="mailto:ntoll@ntoll.org" target="_blank">ntoll@ntoll.org</a>>> wrote:<br>
><br>
> Hi,<br>
><br>
> Carles has booked two slots for a 10minute talk on, well, let's<br>
> just say it'll be fun to watch and smell his presentation.<br>
><br>
> One more space left... any takers..?<br>
><br>
> :-)<br>
><br>
</div>> N. _______________________________________________ python-uk<br>
> mailing list <a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a> <mailto:<a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a>><br>
> <a href="http://mail.python.org/mailman/listinfo/python-uk" target="_blank">http://mail.python.org/mailman/listinfo/python-uk</a><br>
<div>><br>
><br>
><br>
><br>
> _______________________________________________ python-uk mailing<br>
> list <a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-uk" target="_blank">http://mail.python.org/mailman/listinfo/python-uk</a><br>
<br>
</div><div>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
</div>iQEcBAEBAgAGBQJP0gKFAAoJEP0qBPaYQbb6OQAIAJOZDTAMI87RmS5Xrr2cltqV<br>
zLvAq0NFVzXqm48/6C5UKsqJXA+ib9Qs1c+gy+QkwBvwe4qswC6VbJ3evzKmXV4e<br>
6iRZh50+ZEpWqidNzrrw6+wRv65CeTXk2L2YOo05klmtW2drylHCAvCWRe8vB/Si<br>
dYZ53mFavcEjxDQbanfG0SZwDOuI81znDVnU5TdSSGqUZiJCiq/t7s2RIkmbw8cc<br>
PSds6EohbS4wJIlizfermG6ZYjvlVykiJqjrKxh1VCExsCmm88C0wF+1YTrc0QOr<br>
i9UrKCJyx/fSq3XnimMUIdflteO5NInSlzxDZM5eHgTLHT8pRV2uMxhTouTXbuc=<br>
=Zz+0<br>
<div><div>-----END PGP SIGNATURE-----<br>
_______________________________________________<br>
python-uk mailing list<br>
<a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-uk" target="_blank">http://mail.python.org/mailman/listinfo/python-uk</a><br>
</div></div></blockquote></div><br></div></div>