Lemon Posted May 7, 2016 Share Posted May 7, 2016 (edited) So I've been working on this for awhile, and just recently I realized how many people that play also program. I was wondering if one of you would take a look at this code and let me know if you can figure out why it (runs forever, or returns false immediately). It's suppose to be a hill climb search. Python 2.7 code # feedingCharts[magName][itemName] = (sync,iq,def,pow,dex,mind) from collections import deque import copy FeedingChart = { "Mag":{ "Monomate":(3,3,5,40,5,0), "Dimate":(3,3,10,45,5,0), "Trimate":(4,4,15,50,10,0), "Monofluid":(3,3,5,0,5,40), "Difluid":(3,3,10,0,5,45), "Trifluid":(4,4,15,0,10,50), "Antidote":(3,3,5,10,40,0), "Antiparalysis":(3,3,5,0,44,10), "Sol atomizer":(4,1,15,30,15,25), "Moon atomizer":(4,1,15,25,15,30), "Star atomizer":(6,5,25,25,25,25) }, "Varuna":{ "Monomate":(0,0,5,10,0,-1), "Dimate":(2,1,6,15,3,-3), "Trimate":(3,2,12,21,4,-7), "Monofluid":(0,0,5,0,0,8), "Difluid":(2,1,7,0,3,13), "Trifluid":(3,2,7,-7,6,19), "Antidote":(0,1,0,5,15,0), "Antiparalysis":(2,0,-1,0,14,5), "Sol atomizer":(-2,2,10,11,8,0), "Moon atomizer":(3,-2,9,0,9,11), "Star atomizer":(4,3,14,9,18,11) }, "Vrita":{ "Monomate":(0,0,5,10,0,-1), "Dimate":(2,1,6,15,3,-3), "Trimate":(3,2,12,21,4,-7), "Monofluid":(0,0,5,0,0,8), "Difluid":(2,1,7,0,3,13), "Trifluid":(3,2,7,-7,6,19), "Antidote":(0,1,0,5,15,0), "Antiparalysis":(2,0,-1,0,14,5), "Sol atomizer":(-2,2,10,11,8,0), "Moon atomizer":(3,-2,9,0,9,11), "Star atomizer":(4,3,14,9,18,11) }, "Kalki":{ "Monomate":(0,0,5,10,0,-1), "Dimate":(2,1,6,15,3,-3), "Trimate":(3,2,12,21,4,-7), "Monofluid":(0,0,5,0,0,8), "Difluid":(2,1,7,0,3,13), "Trifluid":(3,2,7,-7,6,19), "Antidote":(0,1,0,5,15,0), "Antiparalysis":(2,0,-1,0,14,5), "Sol atomizer":(-2,2,10,11,8,0), "Moon atomizer":(3,-2,9,0,9,11), "Star atomizer":(4,3,14,9,18,11) }, "Ashvinau":{ "Monomate":(0,-1,1,9,0,-5), "Dimate":(3,0,1,13,0,-10), "Trimate":(4,1,8,16,2,-15), "Monofluid":(0,-1,0,-5,0,9), "Difluid":(3,0,4,-10,0,13), "Trifluid":(3,2,6,-15,5,17), "Antidote":(-1,1,-5,4,12,-5), "Antiparalysis":(0,0,-5,-6,11,4), "Sol atomizer":(4,-2,0,11,3,-5), "Moon atomizer":(-1,1,4,-5,0,11), "Star atomizer":(4,2,7,8,6,9) }, "Sumba":{ "Monomate":(0,-1,1,9,0,-5), "Dimate":(3,0,1,13,0,-10), "Trimate":(4,1,8,16,2,-15), "Monofluid":(0,-1,0,-5,0,9), "Difluid":(3,0,4,-10,0,13), "Trifluid":(3,2,6,-15,5,17), "Antidote":(-1,1,-5,4,12,-5), "Antiparalysis":(0,0,-5,-6,11,4), "Sol atomizer":(4,-2,0,11,3,-5), "Moon atomizer":(-1,1,4,-5,0,11), "Star atomizer":(4,2,7,8,6,9) }, "Namuci":{ "Monomate":(0,-1,1,9,0,-5), "Dimate":(3,0,1,13,0,-10), "Trimate":(4,1,8,16,2,-15), "Monofluid":(0,-1,0,-5,0,9), "Difluid":(3,0,4,-10,0,13), "Trifluid":(3,2,6,-15,5,17), "Antidote":(-1,1,-5,4,12,-5), "Antiparalysis":(0,0,-5,-6,11,4), "Sol atomizer":(4,-2,0,11,3,-5), "Moon atomizer":(-1,1,4,-5,0,11), "Star atomizer":(4,2,7,8,6,9) }, "Marutah":{ "Monomate":(0,-1,1,9,0,-5), "Dimate":(3,0,1,13,0,-10), "Trimate":(4,1,8,16,2,-15), "Monofluid":(0,-1,0,-5,0,9), "Difluid":(3,0,4,-10,0,13), "Trifluid":(3,2,6,-15,5,17), "Antidote":(-1,1,-5,4,12,-5), "Antiparalysis":(0,0,-5,-6,11,4), "Sol atomizer":(4,-2,0,11,3,-5), "Moon atomizer":(-1,1,4,-5,0,11), "Star atomizer":(4,2,7,8,6,9) }, "Rudra":{ "Monomate":(0,-1,1,9,0,-5), "Dimate":(3,0,1,13,0,-10), "Trimate":(4,1,8,16,2,-15), "Monofluid":(0,-1,0,-5,0,9), "Difluid":(3,0,4,-10,0,13), "Trifluid":(3,2,6,-15,5,17), "Antidote":(-1,1,-5,4,12,-5), "Antiparalysis":(0,0,-5,-6,11,4), "Sol atomizer":(4,-2,0,11,3,-5), "Moon atomizer":(-1,1,4,-5,0,11), "Star atomizer":(4,2,7,8,6,9) }, "Surya":{ "Monomate":(0,-1,0,3,0,0), "Dimate":(2,0,5,7,0,-5), "Trimate":(3,1,4,14,6,-10), "Monofluid":(0,0,0,0,0,4), "Difluid":(0,1,4,-5,0,8), "Trifluid":(2,2,4,-10,3,15), "Antidote":(-3,3,0,0,7,0), "Antiparalysis":(3,0,-4,-5,20,-5), "Sol atomizer":(3,-2,-10,9,6,9), "Moon atomizer":(-2,2,8,5,-8,7), "Star atomizer":(3,2,7,7,7,7) }, "Tapas":{ "Monomate":(0,-1,0,3,0,0), "Dimate":(2,0,5,7,0,-5), "Trimate":(3,1,4,14,6,-10), "Monofluid":(0,0,0,0,0,4), "Difluid":(0,1,4,-5,0,8), "Trifluid":(2,2,4,-10,3,15), "Antidote":(-3,3,0,0,7,0), "Antiparalysis":(3,0,-4,-5,20,-5), "Sol atomizer":(3,-2,-10,9,6,9), "Moon atomizer":(-2,2,8,5,-8,7), "Star atomizer":(3,2,7,7,7,7) }, "Mitra":{ "Monomate":(0,-1,0,3,0,0), "Dimate":(2,0,5,7,0,-5), "Trimate":(3,1,4,14,6,-10), "Monofluid":(0,0,0,0,0,4), "Difluid":(0,1,4,-5,0,8), "Trifluid":(2,2,4,-10,3,15), "Antidote":(-3,3,0,0,7,0), "Antiparalysis":(3,0,-4,-5,20,-5), "Sol atomizer":(3,-2,-10,9,6,9), "Moon atomizer":(-2,2,8,5,-8,7), "Star atomizer":(3,2,7,7,7,7) }, "Apsaras":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Vayu":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Varaha":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Ushasu":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Kama":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Kaitabha":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Kumara":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Bhirava":{ "Monomate":(2,-1,-5,9,-5,0), "Dimate":(2,0,0,11,0,-10), "Trimate":(0,1,4,14,0,-15), "Monofluid":(2,-1,-5,0,-6,10), "Difluid":(2,0,0,-10,0,11), "Trifluid":(0,1,4,-15,0,15), "Antidote":(2,-1,-5,-5,16,-5), "Antiparalysis":(-2,3,7,-3,0,-3), "Sol atomizer":(4,-2,5,21,-5,-20), "Moon atomizer":(3,0,-5,-20,5,21), "Star atomizer":(3,2,4,6,8,5) }, "Ila":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Garuda":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Sita":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Soma":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Durga":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Nandin":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Yaksa":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Ribhava":{ "Monomate":(2,-1,-4,13,-5,-5), "Dimate":(0,1,0,16,0,-15), "Trimate":(2,0,3,19,-2,-18), "Monofluid":(2,-1,-4,-5,-5,13), "Difluid":(0,1,0,-15,0,16), "Trifluid":(2,0,3,-20,0,19), "Antidote":(0,1,5,-6,6,-5), "Antiparalysis":(-1,1,0,-4,14,-10), "Sol atomizer":(4,-1,4,17,-5,-15), "Moon atomizer":(2,0,-10,-15,5,21), "Star atomizer":(3,2,2,8,3,6) }, "Rati":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Andhaka":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Kabanda":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Naga":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Naraka":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Bana":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Marica":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Madhu":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Ravana":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Andhaka":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Bana":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Bhima":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Kabanda":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Madhu":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Marica":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Naga":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Naraka":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Pushan":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) }, "Ravana":{ "Monomate":(-1,1,-3,9,-3,-4), "Dimate":(2,0,0,11,0,-10), "Trimate":(2,0,2,15,0,-16), "Monofluid":(-1,1,-3,-4,-3,9), "Difluid":(2,0,0,-10,0,11), "Trifluid":(2,0,-2,-15,0,19), "Antidote":(2,-1,0,6,9,-15), "Antiparalysis":(-2,3,0,-15,9,6), "Sol atomizer":(3,-1,9,-20,-5,17), "Moon atomizer":(0,2,-5,20,5,-20), "Star atomizer":(3,2,0,11,0,11) } } class mag(): def __init__(self): self.sync = 40 self.iq = 0 self.d = 500 # For normal mags 500. For PPP mags 000. self.p = 0 self.x = 0 self.m = 0 self.type = "Mag" self.pb = [None,None,None] self.history = [] self.spentMaseta = 0 # this is for when we add weights def __repr__(self): return '{} {}/{}/{}/{}'.format(self.type,self.d,self.p,self.x,self.m) def incressSync(self, n): self.sync = self.sync+n if (self.sync > 120): self.sync = 120 def incressIQ(self, n): self.iq = self.iq+n if (self.iq > 200): self.iq = 200 def feed(self,itm): if (self.level() < 200): self.history.append(itm) inc = FeedingChart[self.type][itm] self.incressSync(inc[0]) self.incressIQ(inc[1]) self.d+=inc[2] self.p+=inc[3] self.x+=inc[4] self.m+=inc[5] if (self.d < 0): self.d = 0 if (self.p < 0): self.p = 0 if (self.x < 0): self.x = 0 if (self.m< 0): self.m = 0 def level(self): return (self.d/100 + self.p/100 + self.x/100 + self.m/100) def addPB(self,pb): if (self.pb[0] == None): self.pb[0] = pb if (self.pb[1] == None and self.pb[0] <> pb): self.pb[1] = pb if (self.pb[2] == None and self.pb[0] <> pb and self.pb[1] <> pb): self.pb[2] = pb def EvolveMags(m): if (m.type == "Mag" and m.level() >= 10): m1 = copy.deepcopy(m) m2 = copy.deepcopy(m) m3 = copy.deepcopy(m) m1.type = "Varuna" m1.addPB("Farlla") m2.type = "Kalki" m2.addPB("Estlla") m3.type = "Vrita" m3.addPB("Leilla") return [m1,m2,m3] if (m.level() >= 35 and (m.type == "Varuna" or m.type == "Kalki" or m.type == "Vritra")): if (m.type == "Varuna"): if (((m.p/100) >= (m.x/100) and (m.p/100) >= (m.m/100)) or (m.x/100) == (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Rudra" m1.addPB("Golla") return [m1] if ((m.x/100) > (m.p/100) and (m.x/100) > (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Marutah" m1.addPB("Pilla") return [m1] if ((m.m/100) > (m.p/100) and (m.m/100) > (m.x/100)): m1 = copy.deepcopy(m) m1.type = "Vayu" m1.addPB("Mylla & Youlla") return [m1] if (m.type == "Kalki"): if ((m.p/100) > (m.x/100) and (m.p/100) > (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Surya" m1.addPB("Golla") return [m1] if (((m.x/100) >= (m.p/100) and (m.x/100) >= (m.m/100)) or (m.p/100) == (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Mitra" m1.addPB("Pilla") return [m1] if ((m.m/100) > (m.p/100) and (m.m/100) > (m.x/100)): m1 = copy.deepcopy(m) m1.type = "Tapas" m1.addPB("Mylla & Youlla") return [m1] if (m.level() >= 100 and ((m.level() % 10) == 0)): if ((m.d/100) + (m.p/100) == (m.x/100) + (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Rati" m2 = copy.deepcopy(m) m2.type = "Savitri" m3 = copy.deepcopy(m) m3.type = "Pushan" m4 = copy.deepcopy(m) m4.type = "Diwari" m5 = copy.deepcopy(m) m5.type = "Nidra" m6 = copy.deepcopy(m) m6.type = "Bhima" return [m1,m2,m3,m4,m5,m6] if ((m.d/100) + (m.x/100) == (m.p/100) + (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Deva" m2 = copy.deepcopy(m) m2.type = "Savitri" m3 = copy.deepcopy(m) m3.type = "Pushan" m4 = copy.deepcopy(m) m4.type = "Rukmin" m5 = copy.deepcopy(m) m5.type = "Nidra" m6 = copy.deepcopy(m) m6.type = "Sato" return [m1,m2,m3,m4,m5,m6] if ((m.d/100) + (m.m/100) == (m.p/100) + (m.x/100)): m1 = copy.deepcopy(m) m1.type = "Rati" m2 = copy.deepcopy(m) m2.type = "Savitri" m3 = copy.deepcopy(m) m3.type = "Pushan" m4 = copy.deepcopy(m) m4.type = "Rukmin" m5 = copy.deepcopy(m) m5.type = "Nidra" m6 = copy.deepcopy(m) m6.type = "Bhima" return [m1,m2,m3,m4,m5,m6] if (m.level() >= 50 and ((m.level() % 5) == 0)): # fourth forms can't evolve for x in ("Rati","Savitri","Pushan","Diwari","Nidra","Bhima","Deva","Rukmin","Sato"): if (m.type == x): return [m] # check for ties counter=0 for x in (((m.p/100) > (m.x/100) and (m.x/100) >= (m.m/100)),((m.p/100) > (m.m/100) and (m.m/100) > (m.x/100)),((m.x/100) > (m.p/100) and (m.p/100) > (m.m/100)),((m.x/100) > (m.m/100) and (m.m/100) >= (m.p/100)),((m.m/100) > (m.p/100) and (m.p/100) >= (m.x/100)),((m.m/100) > (m.x/100) and (m.x/100) > (m.p/100))): if x: counter+=1 if (counter > 1 or counter == 0): lst = [] if ((m.x/100) >= (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Varaha" m1.addPB("Golla") m2 = copy.deepcopy(m) m2.type = "Kama" m2.addPB("Pilla") lst.append(m1) lst.append(m2) if ((m.p/100) > (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Bhirava" m1.addPB("Pilla") m2 = copy.deepcopy(m) m2.type = "Kaitabha" m2.addPB("Mylla & Youlla") lst.append(m1) lst.append(m2) if ((m.m/100) > (m.x/100)): m1 = copy.deepcopy(m) m1.type = "Bhirava" m1.addPB("Pilla") m2 = copy.deepcopy(m) m2.type = "Apsaras" m2.addPB("Estlla") lst.append(m1) lst.append(m2) if ((m.m/100) >= (m.p/100)): m1 = copy.deepcopy(m) m1.type = "Kama" m1.addPB("Pilla") m2 = copy.deepcopy(m) m2.type = "Varaha" m2.addPB("Golla") lst.append(m1) lst.append(m2) if ((m.d/100) < 45): if ((m.p/100) >= (m.x/100)): m1 = copy.deepcopy(m) m1.type = "Naga" m1.addPB("Mylla & Youlla") m2 = copy.deepcopy(m) m2.type = "Kumara" m2.addPB("Golla") lst.append(m1) lst.append(m2) if ((m.x/100) > (m.p/100)): m1 = copy.deepcopy(m) m1.type = "Kabanda" m1.addPB("Mylla & Youlla") m2 = copy.deepcopy(m) m2.type = "Ila" m2.addPB("Mylla & Youlla") lst.append(m1) lst.append(m2) else: m1 = copy.deepcopy(m) m.type = "Bana" m.addPB("Estlla") lst.append(m1) return lst if ((m.p/100) > (m.x/100) and (m.x/100) >= (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Varaha" m1.addPB("Golla") m2 = copy.deepcopy(m) m2.type = "Kama" m2.addPB("Pilla") m3 = copy.deepcopy(m) m3.type = "Madhu" m3.addPB("Mylla & Youlla") m4 = copy.deepcopy(m) m5 = copy.deepcopy(m) if ((m.d/100) < 45): m4.type = "Naraka" m4.addPB("Golla") m5.type = "Marica" m5.addPB("Pilla") return [m1,m2,m3,m4,m5] else: m4.type = "Andhaka" m4.addPB("Estlla") return [m1,m2,m3,m4] if ((m.p/100) > (m.m/100) and (m.m/100) > (m.x/100)): m1 = copy.deepcopy(m) m1.type = "Bhirava" m1.addPB("Pilla") m2 = copy.deepcopy(m) m2.type = "Apsaras" m2.addPB("Estlla") m3 = copy.deepcopy(m) m3.type = "Kaitabha" m3.addPB("Mylla & Youlla") m4 = copy.deepcopy(m) m5 = copy.deepcopy(m) if ((m.d/100) < 45): m4.type = "Ravana" m4.addPB("Farlla") m5.type = "Naga" m5.addPB("Mylla & Youlla") return [m1,m2,m3,m4,m5] else: m4.type = "Andhaka" m4.addPB("Estlla") return [m1,m2,m3,m4] if ((m.x/100) > (m.p/100) and (m.p/100) > (m.m/100)): m1 = copy.deepcopy(m) m1.type = "Ila" m1.addPB("Mylla & Youlla") m2 = copy.deepcopy(m) m2.type = "Garuda" m2.addPB("Pilla") m3 = copy.deepcopy(m) m3.type = "Bhirava" m3.addPB("Pilla") m4 = copy.deepcopy(m) m4.type = "Kaitabha" m4.addPB("Mylla & Youlla") m5 = copy.deepcopy(m) m6 = copy.deepcopy(m) if ((m.d/100) < 45): m5.type = "Ribhava" m5.addPB("Farlla") m6.type = "Garuda" m6.addPB("Pilla") return [m1,m2,m3,m4,m5] else: m5.type = "Bana" m5.addPB("Estlla") return [m1,m2,m3,m4] if ((m.x/100) > (m.m/100) and (m.m/100) >= (m.p/100)): m1 = copy.deepcopy(m) m1.type = "Nandin" m1.addPB("Estlla") m2 = copy.deepcopy(m) m2.type = "Yaksa" m2.addPB("Golla") m3 = copy.deepcopy(m) m3.type = "Kama" m3.addPB("Pilla") m4 = copy.deepcopy(m) m4.type = "Varaha" m4.addPB("Golla") m5 = copy.deepcopy(m) m6 = copy.deepcopy(m) if ((m.d/100) < 45): m5.type = "Sita" m5.addPB("Pilla") m6.type = "Bhirava" m6.addPB("Pilla") return [m1,m2,m3,m4,m5] else: m5.type = "Bana" m5.addPB("Estlla") return [m1,m2,m3,m4] if ((m.m/100) > (m.p/100) and (m.p/100) >= (m.x/100)): m1 = copy.deepcopy(m) m1.type = "Kabanda" m1.addPB("Mylla & Youlla") m2 = copy.deepcopy(m) m2.type = "Bana" m2.addPB("Estlla") m3 = copy.deepcopy(m) m3.type = "Varaha" m3.addPB("Golla") m4 = copy.deepcopy(m) m4.type = "Kabanda" m4.addPB("Mylla & Youlla") m5 = copy.deepcopy(m) m6 = copy.deepcopy(m) if ((m.d/100) < 45): m5.type = "Naga" m5.addPB("Mylla & Youlla") m6.type = "Kumara" m6.addPB("Golla") return [m1,m2,m3,m4,m5] else: m5.type = "Bana" m5.addPB("Estlla") return [m1,m2,m3,m4] if ((m.m/100) > (m.x/100) and (m.x/100) > (m.p/100)): m1 = copy.deepcopy(m) m1.type = "Ushasu" m1.addPB("Golla") m2 = copy.deepcopy(m) m2.type = "Soma" m2.addPB("Estlla") m3 = copy.deepcopy(m) m3.type = "Apsaras" m3.addPB("Estlla") m4 = copy.deepcopy(m) m4.type = "Durga" m4.addPB("Estlla") m5 = copy.deepcopy(m) m6 = copy.deepcopy(m) if ((m.d/100) < 45): m5.type = "Kabanda" m5.addPB("Mylla & Youlla") m6.type = "Ila" m6.addPB("Mylla & Youlla") return [m1,m2,m3,m4,m5] else: m5.type = "Bana" m5.addPB("Estlla") return (m1,m2,m3,m4) return [m] def sortKey(e): return (m.d - e.d) + (m.p - e.p) + (m.x - e.x) + (m.m - e.m) def find(m,que): # base case while(len(que) > 0): que = sorted(que, key = sortKey) que.reverse() cur = que.pop() que.reverse() if (m.d/100 == cur.d/100 and m.p/100 == cur.p/100 and m.x/100 == cur.x/100 and m.m/100 == cur.m/100): if (m.pb[0] == None or m.pb[0] == cur.pb[0]): if (m.pb[1] == None or m.pb[1] == cur.pb[1]): if (m.pb[2] == None or m.pb[2] == cur.pb[2]): # we have our mag print "DEF = "+str(cur.d/100), print " =? "+str(m.d/100) print "POW = "+str(cur.p/100), print " =? "+str(m.p/100) print "DEX = "+str(cur.x/100), print " =? "+str(m.x/100) print "MND = "+str(cur.m/100), print " =? "+str(m.m/100) print cur.history return # check to see if we're done with this mag if ((cur.level() >= 200) or (cur.m > m.m) or (cur.x > m.x) or (cur.m > m.m) or (cur.p > m.p)): continue # otherwise, keep looking # check every feed option for x in ("Monomate","Dimate","Monofluid","Difluid","Trifluid","Antidote","Antiparalysis","Sol atomizer","Moon atomizer","Star atomizer"): # on a new copy of the mag c = copy.deepcopy(cur) c.feed(x) for e in EvolveMags(c): print "\r \r"+str(len(que))+"\t"+str(e), if (not(e in que)): que.append(e) print "could not create mag" return # Main if __name__ == "__main__": q = deque() name = "" print "Enter DEF level desired" DEF = int(raw_input(">"))*100 print "Enter POW level desired" POW = int(raw_input(">"))*100 print "Enter DEX level desired" DEX = int(raw_input(">"))*100 print "Enter MIND level desired" MIND = int(raw_input(">"))*100 # add pb specifications later m = mag() m.m = MIND m.d = DEF m.x = DEX m.p = POW m.type = name start = mag() q.append(start) find(m,q) tmp = raw_input("Press Enter to exit") Edited May 7, 2016 by Lemon Quote Link to comment Share on other sites More sharing options...
Soly Posted May 7, 2016 Share Posted May 7, 2016 No idea what language is lol, but surely that looks like a giant mess . Was gonna ask you about why and stuff like that but might not be the best to do atm. So back to your original question.... can you debug/trace it? Quote Link to comment Share on other sites More sharing options...
Lemon Posted May 7, 2016 Author Share Posted May 7, 2016 No idea what language is lol, but surely that looks like a giant mess . Was gonna ask you about why and stuff like that but might not be the best to do atm. So back to your original question.... can you debug/trace it? Oh, it's in python 2.7, I'll edit my post to include that. As for the tracing, I'm not sure what you mean by this. It doesn't crash or error ever, it just doesn't seem to be doing what it's suppose to. If you edit line 1018 to have a \n right before the first \r it will print out every mag that it adds to the queue. (not sure if that's what you mean though) As for the mess part, it kind of is. The first 980 lines all have to deal with how mags progress (600 of that is just the feeding charts). I want to say the problem is in the find() function. That or my heuristic sortKey() is wrong. Quote Link to comment Share on other sites More sharing options...
Soly Posted May 7, 2016 Share Posted May 7, 2016 With tracing/debugging I mean to debug the code step by step to see what it actually does. That will help you see what's going on (obviously) and find anything obviously faulty (if there is anything like that). Quote Link to comment Share on other sites More sharing options...
Larva Posted May 7, 2016 Share Posted May 7, 2016 Pyton is knows to be simpler than most of the languages. But seeing that make me cry xD. Cant see the output of this code clearly. 1 Quote Link to comment Share on other sites More sharing options...
mudkipzjm Posted May 7, 2016 Share Posted May 7, 2016 I'd try to help, but that's just too much for me to handle, lol. From what I skimmed through, I didn't notice anything. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.