Talk:Speech Server

From OLPC
Revision as of 16:36, 24 December 2007 by Tomhannen (talk | contribs) (speak n spell suggestion)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This looks really good. I`d like to use this in Pippy - is it possible? I`d love to make a Speak n Spell type activity...

import random
wordlist = [ "hello","children","of","the","world" ]
 
size = len(wordlist)
index = random.randint(0, size-1)
elem = wordlist[index] 

for x in range(size):
    print "Can you spell: " + elem
    answer = raw_input("Your answer: ")
    print "You typed", answer
    if answer == elem:
         print "Correct!"
         break
    print "Incorrect answer."

--Tomhannen 11:36, 24 December 2007 (EST)