Beispiel #1
0
 def word_bank(self): 
     outStr = ''
     temp_list = duplicate(self.current_word_list)
     random.shuffle(temp_list) # randomize word list
     for word in temp_list:
         outStr += '%s\n' % word.word
     return outStr
Beispiel #2
0
 def print_word_bank(self):
     print('== Word Bank ==')
     temp_list = duplicate(self.current_word_list)
     random.shuffle(temp_list) # randomize word list
     for w in temp_list:
         print(w.original.strip())
     print
Beispiel #3
0
 def word_bank(self):
     out_str = ''
     temp_list = duplicate(self.current_word_list)
     random.shuffle(temp_list)  # randomize word list
     for word in temp_list:
         out_str += '%s\n' % word.word
     return out_str
Beispiel #4
0
	def word_bank(self): 
		outStr = ''
		temp_list = duplicate(self.current_word_list)
		random.shuffle(temp_list) # randomize word list
		for word in temp_list:
			outStr += '%s\n<br/>' %(word.word)
		return outStr.encode('utf-8')
Beispiel #5
0
def append( collection, toAppend ):
    from copy import copy as duplicate
    """
    Appends the second argument to a copy of the first and returns the appended list.
    This uses a shallow copy operation.
    """
    copy = duplicate( collection )
    copy.append( toAppend )
    return copy
 def get_shuffled_word_list(self): 
     """Returns a string of (shuffled) words (solutions)"""
     
     outStr = ''
     tmplist = copy.duplicate(self.crossword.placed_words)
     random.shuffle(tmplist) # randomize word list
     for word in tmplist:
         outStr += '%s\n' % word.word
     return outStr
Beispiel #7
0
def append(collection, toAppend):
    from copy import copy as duplicate
    """
    Appends the second argument to a copy of the first and returns the appended list.
    This uses a shallow copy operation.
    """
    copy = duplicate(collection)
    copy.append(toAppend)
    return copy
Beispiel #8
0
 def word_bank(self):
     outStr = ''
     temp_list = duplicate(self.current_word_list)
     random.shuffle(temp_list)  # randomize word list
     for word in temp_list:
         outStr += '%s\n' % word.word
     fo = open("foo.txt", "a")
     fo.write(outStr)
     # Close opend file
     fo.close()
     return outStr