Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

if anyone have finish retrice 6 , Problem #3: Computer Player. could you please show me some light how to write this?

OpenStudy (anonymous):

Practrice 6 i mean..

OpenStudy (anonymous):

say you have a hand with 5 letters. you have to make permutations of those letters with lengths of 1 - 5; check to see if a permutation is in the wordlist, if it is in the wordlist get its score, 'save it' if it has the highest score below is a partial list of two letter and 3 letter permutations for a hand with 'abcde' for each one, search the wordlist and see if it has the highest score - you would also need 4 and 5 letter permutations ab ac ad ae ba bc bd be ca cb cd ce da db dc de ea eb ec ed abc abd abe acb acd ace adb adc ade aeb aec aed bac bad bae bca bcd bce bda bdc bde bea bec bed cab

OpenStudy (anonymous):

thanks bwCA, thats exactly where i got stuck. wondering how to do 3 letters list? i can do one , word= 'abc' : for letter in range(3): print word[letter] but how to it 2 or 3? thanks in advance

OpenStudy (anonymous):

The net is an excellent resource as well as the Python documentation. Once you have an idea of what you want to do, more likely than not someone has done it or something similar to it before (at least at this stage of the game) - which is great cause you don't have to reinvent stuff. in this case you could search for "permutation Python". I have also found wikipedia a great help - it explains algorithms so you can try to 'build-your-own'..And while I usually find what I want elsewhere, I stumbled across this and it looks interesting http://xlinux.nist.gov/dads/. Python v2.6+ has a permutations function in the itertools module that works great. http://docs.python.org/library/itertools.html

OpenStudy (anonymous):

thanks above..i didn't know how to call it until u show me "permutation". i guess i should i ask this instead, nextime :) cheers

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!