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
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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)