def firstpart(inputstring): inputstring_mv = convert_class_to_letters.convert_back_letter_to_classes(inputstring) a = check_word.possibleid(inputstring_mv) if a == None: return None g,s = a bm = data_structures.BoardManager(handlejson.parse_to_dictionary(data.datas[g])) score = bm.calc_board_state(bm.get_initial_board(s),inputstring_mv).move_score if score <0: return None handlejson.send_response(g,[allseeds[g][s]],inputstring,'qwe') return (g,s,inputstring,score)
def send(gid,sid,mvlist,tag): print "send_to_server = " print mvlist conv = convert_class_to_letters.convert_greedy(mvlist) handlejson.send_response(gid,[sid],conv,tag)
9:[0, 26637, 10998, 4150, 23855], 10:[0], 11:[0, 12877, 20528, 16526, 19558], 12:[0, 24762, 24103, 12700, 5864, 1155, 24803, 29992, 18660, 19102], 13:[0], 14:[0], 15:[0], 16:[0], 17:[0], 18:[0], 19:[0], 20:[0], 21:[0], 22:[0], 23:[0], 24:[18]} a = handlejson.get_dictionary_of_all_solutions() for gid in range(25): for s in allseeds[gid]: handlejson.send_response(gid,[s],'','zero') # b = [i for i in a if i['problemId']==gid and i['seed']==s] # m = max(b,key=lambda x:x['score']) # print gid,s,m['score'],m['solution'] # handlejson.send_response(gid,[s],str(m['solution']),'')