tynation.com

Monday, January 30, 2012

Back to programming!

Alright. After a little hiatus, I've decided to once again delve into Python. Armed with a book titled Learning Python by Mark Lutz I am determined to create a program that will help you cheat at scrabble.


What I want this program to do is take the letters of all the tiles you have as well as the letters from any playable tile on the board and compare them against the scrabble dictionary. It will use all possible letters from the former category and only one letter from the latter, unless they are grouped together. I might even find fancy ways to make it so you can indicate spaces between letters so you can fill in those really complicated areas.


However we're starting small. Tonight I created a simple script that tells you how long a word and separates the letters of that word.



print "Insert a word"
wordInput = raw_input()
wordLength = len(wordInput)
wordChar = 1
print "Your word is", wordLength, "letters long."
while ( wordChar <= wordLength):
     print wordInput[wordChar-1]
     wordChar = wordChar + 1

Simple stuff right?

No comments: