Popular Post bwoodhouse729 Posted June 6, 2017 Popular Post Share Posted June 6, 2017 (edited) Updated link (credit to DuDuXu for the speed increase): https://github.com/xuyiqi/EnergyBalance/tree/FixPermatureExit Here's a link to Java code I created to solve these puzzles:https://gist.github.com/bwoodhouse729/a7e26e67b0280933d7851bf090e724bdIt will basically solve all levels in under 30 seconds.Note the numbers in the cells and the row/column sums are randomly generated each time you open a puzzle in-game, thus fixed solutions cannot be posted for each puzzle. There are no time limits for the puzzles. Do not close the game and expect to use a solution for previously generated puzzles when you reopen it!The last square level had too many possibilities for the algorithm to solve the puzzle on its own in a reasonable amount of time, so I had to initialize a row and column with reasonable entries first (roughly proportional to the relevant row/column sums), then the algorithm quickly found a solution.Setup a local Java environment to compile and run the code if necessary, input the parameters for each puzzle at the top of the Energy_Balance class (available numbers, sets of numbers that form rows or columns, and the corresponding row/column sums), then run it. The output explains which number to place in which position in-game. Note it speeds up the process if you list rows and columns with fewer entries first. For the square puzzles, I found the trick to be alternating rows and columns, so that the possibilities are further limited as the algorithm proceeds.I recommend taking a photo of the in-game puzzle and the output of the algorithm to easily transfer data.Good luck! Edited July 10, 2017 by bwoodhouse729 10 Link to comment Share on other sites More sharing options...
WallaceErick_ Posted June 7, 2017 Share Posted June 7, 2017 (edited) Thanks for the solution, bro. i try to run the code, but i got an error... do u know what i can do? https://postimg.org/image/d436pb72z/ Edited June 7, 2017 by WallaceErick2 1 Link to comment Share on other sites More sharing options...
LucasDiasC Posted June 7, 2017 Share Posted June 7, 2017 Not all heroes wear capes, thanks mate, will test it out soon! 1 Link to comment Share on other sites More sharing options...
bwoodhouse729 Posted June 7, 2017 Author Share Posted June 7, 2017 Since there's some interest, I updated with a simple example commented at the top of the program. WallaceErick2, it looks like you didn't make the CombinationGenerator class available to the system when you ran the program. Make sure you downloaded that to the same directory as Energy_Balance. 1 Link to comment Share on other sites More sharing options...
WallaceErick_ Posted June 7, 2017 Share Posted June 7, 2017 (edited) thanks for the answer. For this example: my vars: // original_values = {4, 5, -2, -3, -4, -5, -1, 3, 4, 4, 0, 1, 8} // addends = {{0, 1, 2, 3}, {0, 4, 7, 9}, {3, 6, 8, 12}, {9, 10, 11, 12}} // sums = {-3, 3, 7, 9} returns: Position 0: 4 Position 1: -2 Position 2: -4 Position 3: -1 Position 4: -5 Position 5: 1000 Position 6: 4 Position 7: 1 Position 8: 0 Position 9: 3 Position 10: 5 Position 11: -3 Position 12: 4 why position 5 is 1000? Edited June 7, 2017 by WallaceErick2 Link to comment Share on other sites More sharing options...
LucasDiasC Posted June 7, 2017 Share Posted June 7, 2017 (edited) I'm in the 6th puzzle, this one: The values I put: - {2, -4, 0, -3, 1, -8, 0, -6, -5, -8, -3, 4, -2, -6, -1, -2, -2, 8, -1, 8, 0, 4, -2, 5, 2, 7, 1}; - {{0, 1, 2, 3, 4}, {5, 6, 7}, {8, 9, 10}, {0,7}, {14, 15, 16, 17, 18}, {6, 11, 13, 19, 22}, {21, 22, 23}, {4, 9, 12, 17, 20, 25}, {24, 25, 26}}; - {2, 3, -3, 8, 14, -3, -8, -5, -12}; > Runs program > No solution found ? Edited June 7, 2017 by LucasDiasC Link to comment Share on other sites More sharing options...
bwoodhouse729 Posted June 8, 2017 Author Share Posted June 8, 2017 (edited) WallaceErick2, my default value for solutions was 1000 to indicate the algorithm didn't find a value for it. Here it's because there's no constraint involving position 5. Of course, position 5 just takes the remaining number that doesn't show up in any other position. LucasDiasC, there must be a bug somewhere preventing it from considering all cases. If it continues to be a problem I can debug further. However, when I rearranged the constraints from smallest to largest ({0, 7} first for example, and of course move its sum to the front of the sums, then some 3-length constraints, etc.), it quickly finds a solution. Position 0: 0 Position 1: 1 Position 2: -8 Position 3: 4 Position 4: 5 Position 5: -4 Position 6: -1 Position 7: 8 Position 8: 2 Position 9: -3 Position 10: -2 Position 11: -2 Position 12: -3 Position 13: -1 Position 14: 0 Position 15: -5 Position 16: 8 Position 17: 4 Position 18: 7 Position 19: 1 Position 20: -2 Position 21: -6 Position 22: 0 Position 23: -2 Position 24: -8 Position 25: -6 Position 26: 2 Edited June 8, 2017 by bwoodhouse729 1 Link to comment Share on other sites More sharing options...
LucasDiasC Posted June 8, 2017 Share Posted June 8, 2017 37 minutes ago, bwoodhouse729 said: WallaceErick2, my default value for solutions was 1000 to indicate the algorithm didn't find a value for it. Here it's because there's no constraint involving position 5. Of course, position 5 just takes the remaining number that doesn't show up in any other position. LucasDiasC, there must be a bug somewhere preventing it from considering all cases. If it continues to be a problem I can debug further. However, when I rearranged the constraints from smallest to largest ({0, 7} first for example, and of course move its sum to the front of the sums, then some 3-length constraints, etc.), it quickly finds a solution. Position 0: 0 Position 1: 1 Position 2: -8 Position 3: 4 Position 4: 5 Position 5: -4 Position 6: -1 Position 7: 8 Position 8: 2 Position 9: -3 Position 10: -2 Position 11: -2 Position 12: -3 Position 13: -1 Position 14: 0 Position 15: -5 Position 16: 8 Position 17: 4 Position 18: 7 Position 19: 1 Position 20: -2 Position 21: -6 Position 22: 0 Position 23: -2 Position 24: -8 Position 25: -6 Position 26: 2 Yeah, I was going to try doing that, thanks man, tomorrow I'll probably use it for the remaining levels Link to comment Share on other sites More sharing options...
WallaceErick_ Posted June 8, 2017 Share Posted June 8, 2017 9 hours ago, bwoodhouse729 said: WallaceErick2, my default value for solutions was 1000 to indicate the algorithm didn't find a value for it. Here it's because there's no constraint involving position 5. Of course, position 5 just takes the remaining number that doesn't show up in any other position. Thanks for the solution, bro. I will be create an web interface for this... its ok to use your code? 2 Link to comment Share on other sites More sharing options...
bwoodhouse729 Posted June 8, 2017 Author Share Posted June 8, 2017 Yes, feel free. 1 Link to comment Share on other sites More sharing options...
Kishnabe Posted June 19, 2017 Share Posted June 19, 2017 How do you run Java files? Command Prompt? Tried Javac Energy_Balance.java from CMD stored in C Drive....but it says Javac not recognized as internal or external command. Link to comment Share on other sites More sharing options...
bwoodhouse729 Posted June 19, 2017 Author Share Posted June 19, 2017 You need to install java and a development environment to help run it. Or wait for WallaceErick2 to make it more user friendly? 1 Link to comment Share on other sites More sharing options...
Barriebar17 Posted June 21, 2017 Share Posted June 21, 2017 Yes you need to 'set path' to java JDK in command prompt. Only then you can run the 'javac' command. @bwoodhouse729, thank you very much for the work you have put in to the program. It helped me out on a few of the puzzle which I could not figure out on my own! 1 Link to comment Share on other sites More sharing options...
Narniak Posted June 26, 2017 Share Posted June 26, 2017 I just got the Platinum with no computer help, so now my brain really hurts. Nothing some beers and Rocket League can't cure!! WEEEEEEEEEEEEEEEEEEEEEEEEE!!!! 3 Link to comment Share on other sites More sharing options...
diskdocx Posted June 28, 2017 Share Posted June 28, 2017 Took me a while to figure out how to get this to work. A slightly more detailed explanation would have saved me quite a bit of time, but I did my research and got it sorted. Doesn't seem to work for some of the later puzzles. I couldn't get a solution for Hard 3, so I solved it manually. Now I'm stuck on Hard 4. I've tried several resets, and re-entered the data to make sure it wasn't user error, but I never get a solution. Has anyone successfully used it for the more complex levels? Link to comment Share on other sites More sharing options...
Gage Posted June 28, 2017 Share Posted June 28, 2017 14 minutes ago, diskdocx said: Took me a while to figure out how to get this to work. A slightly more detailed explanation would have saved me quite a bit of time, but I did my research and got it sorted. Doesn't seem to work for some of the later puzzles. I couldn't get a solution for Hard 3, so I solved it manually. Now I'm stuck on Hard 4. I've tried several resets, and re-entered the data to make sure it wasn't user error, but I never get a solution. Has anyone successfully used it for the more complex levels? I used it for every single one except the last square one. Hard 4 was one of the ones that took me the longest, just took a lot of resetting and rearranging the order of the solutions to get it to work. Pretty sure it was one of the ones I let get to a couple million flag calls before it actually worked. 2 Link to comment Share on other sites More sharing options...
bwoodhouse729 Posted June 28, 2017 Author Share Posted June 28, 2017 There can be a very large number of possibilities for Hard 4 and Square 4, especially if you were unlucky in puzzle generation, so the program probably keeps computing without finding a solution. All I can offer without overhauling the program is to make sure you list the row and column constraints in decreasing order, then if it's still not fast enough, try initially arranging the values based roughly on the row sums and column sums (larger sums use larger values, etc.) 1 Link to comment Share on other sites More sharing options...
diskdocx Posted June 29, 2017 Share Posted June 29, 2017 3 hours ago, Gage said: I used it for every single one except the last square one. Hard 4 was one of the ones that took me the longest, just took a lot of resetting and rearranging the order of the solutions to get it to work. Pretty sure it was one of the ones I let get to a couple million flag calls before it actually worked. 3 hours ago, bwoodhouse729 said: There can be a very large number of possibilities for Hard 4 and Square 4, especially if you were unlucky in puzzle generation, so the program probably keeps computing without finding a solution. All I can offer without overhauling the program is to make sure you list the row and column constraints in decreasing order, then if it's still not fast enough, try initially arranging the values based roughly on the row sums and column sums (larger sums use larger values, etc.) Thanks both, I finally got it. I left it runners get and it finally solved it, but I had reset the puzzle. Tried a couple more, then one popped almost immediately. Just square 4 left, and I'm holding that for the weekend plat party ? 1 Link to comment Share on other sites More sharing options...
zombie_ninja_X Posted June 30, 2017 Share Posted June 30, 2017 I don't understand how the the code works can someone explain or show where to find a simple way to do this? 2 Link to comment Share on other sites More sharing options...
Leo_the_Lion25 Posted June 30, 2017 Share Posted June 30, 2017 I've been trying to get the code to work with Notepad but fail. I haven't used Java in years. I forgot how to use Netbeans as well. Link to comment Share on other sites More sharing options...
WallaceErick_ Posted June 30, 2017 Share Posted June 30, 2017 1 hour ago, Leo_the_Lion25 said: I've been trying to get the code to work with Notepad but fail. I haven't used Java in years. I forgot how to use Netbeans as well. use eclipse, its easy. --------- i've finished the interface... integration with backend is coming son... http://www.platinas.com.br/energy-balance/ anyone have a vps server to host? its very expensive. 1 Link to comment Share on other sites More sharing options...
zombie_ninja_X Posted June 30, 2017 Share Posted June 30, 2017 2 hours ago, WallaceErick2 said: use eclipse, its easy. --------- i've finished the interface... integration with backend is coming son... http://www.platinas.com.br/energy-balance/ anyone have a vps server to host? its very expensive. I've tried using your link, but I keep getting an error and doesn't work can you help out with a sample/explanation. Link to comment Share on other sites More sharing options...
r4tb0- Posted June 30, 2017 Share Posted June 30, 2017 i made a example picture for our trophy community at facebook. i have to say, that the java program took realtive long sometimes. sometimes so long, that i solved the puzzle in the meantime. if you use lesser rows, you can get an idea how to solve the puzzle and do the rest on your own. you have to adjust the parameter in the .java file and than compile it with javac. you can run the compiled code with java. it helps alot but it didnt solve everything for you. Link to comment Share on other sites More sharing options...
Leo_the_Lion25 Posted June 30, 2017 Share Posted June 30, 2017 (edited) I'm trying to run the program on this site: http://www.browxy.com/ If we can get it running on their all we have to do is simply click on the get URL option and we can all use the same program. The issue I have is that I cannot get both programs to find each other's locations. My errors reading this Quote Compilation Errors Detected Line: 182 cannot find symbol symbol: class CombinationGenerator location: class Energy_Balance Line: 182 cannot find symbol symbol: class CombinationGenerator location: class Energy_Balance Edited June 30, 2017 by Leo_the_Lion25 Link to comment Share on other sites More sharing options...
WallaceErick_ Posted June 30, 2017 Share Posted June 30, 2017 4 hours ago, zombie_ninja_X said: I've tried using your link, but I keep getting an error and doesn't work can you help out with a sample/explanation. i dont have finished yet. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now