------art_52813_27347919.1168174043682
Content-Type: multipart/alternative; 
	boundary---art_52814_7878178.1168174043682"

------art_52814_7878178.1168174043682
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

It just so happened that I was learning ruby last summer and wrote a program
to cheat for me at TextTwist. Needless to say the game got boring really
fast, but it was neat writing the program. I've modified it a bit to instead
play the game, but I'm a fairly new user and would appreciate any feedback,
both ruby related and general programming.

To run this you'll need a dictionary file of words, each on a new line,
called wordlist.txt and you need to require 'dict' and run Dict.reduce(3,6)
before you run the program. This will create a reduced dictionary file of
only words of lengths between 3 and 6. I didn't make this part of my
program's general execution as I figured doing this once was enough and I
could do it manually.

It's got a simple text interface that looks sort of like the TextTwist gui
layout on Yahoo. Sort of. The dictionary I use, which I did not attach
because its size (3 megs, I believe it was the full Scrabble dictionary)
makes for a much harder game than the Yahoo TextTwist as some of the words
are really obscure.

Also, I have the problem that when running this on Windows it doesn't allow
me to manipulate files with Ruby, giving me a Permission Denied error on
File.open. Any idea why this might be? This is if I try to run Dict.reduce(3,6)
for example.

------art_52814_7878178.1168174043682
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

It just so happened that I was learning ruby last summer and wrote a program to cheat for me at TextTwist. Needless to say the game got boring really fast, but it was neat writing the program. I've modified it a bit to instead play the game, but I'm a fairly new user and would appreciate any feedback, both ruby related and general programming.
<br><br>To run this you&#39;ll need a dictionary file of words, each on a new line, called wordlist.txt and you need to require &#39;dict&#39; and run Dict.reduce(3,6) before you run the program. This will create a reduced dictionary file of only words of lengths between 3 and 6. I didn&#39;t make this part of my program&#39;s general execution as I figured doing this once was enough and I could do it manually.
<br><br>It&#39;s got a simple text interface that looks sort of like the TextTwist gui layout on Yahoo. Sort of. The dictionary I use, which I did not attach because its size (3 megs, I believe it was the full Scrabble dictionary) makes for a much harder game than the Yahoo TextTwist as some of the words are really obscure.
<br><br>Also, I have the problem that when running this on Windows it doesn&#39;t allow me to manipulate files with Ruby, giving me a Permission Denied error on File.open. Any idea why this might be? This is if I try to run 
Dict.reduce(3,6) for example.<br>

------art_52814_7878178.1168174043682--

------art_52813_27347919.1168174043682
Content-Type: text/x-ruby-script; name=texttwistGame.rb; 
	charset سContent-Transfer-Encoding: base64
X-Attachment-Id: f_ewngky34
Content-Disposition: attachment; filename="texttwistGame.rb"

cmVxdWlyZSAnZGljdCcNCg0KZGVmIGdldF93b3JkcyhsZXR0ZXJzLCB1c2VkLCB3b3JkcywgZGlj
dF9oYXNoLCBjdXJyZW50KSNGaW5kcyBtYXRjaGluZyB3b3Jkcw0KCWkgPSBEaWN0LmluX2RpY3Q/
KGN1cnJlbnQsIGRpY3RfaGFzaCkNCgl3b3JkcyA8PCBjdXJyZW50IGlmIGkgPT0gMQ0KCXJldHVy
biBpZiBpID09IC0xDQoJKDAuLmxldHRlcnMubGVuZ3RoKS5lYWNoIGRvIHxhfA0KCQlpZiB1c2Vk
W2FdID09IGZhbHNlDQoJCQl1c2VkW2FdPXRydWUNCgkJCWdldF93b3JkcyhsZXR0ZXJzLCB1c2Vk
LCB3b3JkcywgZGljdF9oYXNoLCBjdXJyZW50ICsgbGV0dGVyc1thLDFdKQ0KCQkJdXNlZFthXT1m
YWxzZQ0KCQllbmQNCgllbmQNCmVuZA0KDQpkZWYgcGlja193b3JkIGRpY3RfaGFzaCAjUGlja3Mg
YSByYW5kb20gd29yZCBvZiBsZW5ndGggNg0KCWEgPSBkaWN0X2hhc2hbKCdhJy4uJ3onKS50b19h
W3JhbmQoMjYpXVswXV0uZGVsZXRlX2lme3x3fHcuc2l6ZSE9Nn0NCglhW3JhbmQoYS5zaXplKV0N
CmVuZA0KDQpkZWYgcHJpbnRfa25vd24gd29yZF9hciAjUHJpbnRzIHRoZSB3b3JkcyBvciBibGFu
a3MNCgl3b3JkX2FyWzMuLjZdLmVhY2ggZG8gfHd8DQoJCXcuZWFjaCBkbyB8c3wNCgkJCWlmIHNb
MV0NCgkJCQ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CQllbHNlDQoJ
CQkJcHV0cyAiSW52YWxpZCBpbnB1dCINCgkJCWVuZA0KCQkJcHV0cw0KCQkJcHJpbnRfa25vd24g
d29yZF9hcg0KCQkJYWR2YW5jZSA9IHRydWUNCgkJCXdvcmRfYXJbNl0uZWFjaHt8c3wgYWR2YW5j
ZSA9IGZhbHNlIHVubGVzcyBzWzFdfQ0KCQkJaWYoYWR2YW5jZSkNCgkJCQlwdXRzICJDb25ncmF0
dWxhdGlvbiEgWW91IGFkdmFuY2UgdG8gdGhlIG5leHQgbGV2ZWwiDQoJCQkJYnJlYWsNCgkJCWVs
c2UNCgkJCQlwdXRzICJUaGUgbGV0dGVycyBhcmUgI3tsZXR0ZXJzfSINCgkJCWVuZA0KCQllbmQN
CgllbmQNCglwdXRzICJUaGUgc29sdXRpb24gd2FzIg0KCXdvcmRfYXJbMy4uNl0uZWFjaHt8d3wg
dy5lYWNoe3xzfCBwcmludCBzWzBdICsgIlx0In0gJiYgcHV0cyB1bmxlc3Mgdy5uaWw/fQ0KcmVz
Y3VlIFN5c3RlbUV4aXQNCglwdXRzICJSZXNjdWVkIGEgU3lzdGVtRXhpdCBleGNlcHRpb24iDQoJ
cmFpc2UNCmVuZA------art_52813_27347919.1168174043682
Content-Type: text/x-ruby-script; name=dict.rb; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ewngkz67
Content-Disposition: attachment; filename="dict.rb"

Y2xhc3MgRGljdA0KICAjUmVkdWNlcyB0aGUgZmlsZSAnd29yZGxpc3QudHh0JyB3aGljaCBpcyB0
aGUgbGlzdCBvZiBkaWN0aW9uYXJ5IHdvcmRzDQogICNpbnRvIGEgZmlsZSBvZiB0aGUgc2FtZSB3
b3JkcyBidXQgb2YgbGVuZ3RoIG5vIGxlc3MgdGhhbiBpDQogICNhbmQgbm8gYmlnZ2VyIHRoYW4g
ag0KICBkZWYgRGljdC5yZWR1Y2UoaSwgaikNCiAgICBGaWxlLm9wZW4oJ3dvcmRsa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