(May-09-2022, 03:56 PM)deanhystad Wrote: You have an error computing the heuristic value.Yes, I am aware. I am doing this instead but it is not the solution.
if self.pancake_stack[3][1] == 'b' or self.pancake_stack[3][0] == 4: self.heuristic = 0 elif self.pancake_stack[3][1] != 'w' or self.pancake_stack[3][0] != 4: self.heuristic = 4 elif (self.pancake_stack[2][1] != 'w') or (self.pancake_stack[2][0] != 3): self.heuristic = 3 elif (self.pancake_stack[1][1] != 'w') or (self.pancake_stack[1][0] != 2): self.heuristic = 2 elif (self.pancake_stack[0][1] != 'w') or (self.pancake_stack[0][0] != 1): self.heuristic = 1Because when I am using this input 1b2b3w4b-a all the h values are 0
1b|2b3w4b g:0, h:0 1w2b3w4b| g:1, h:0 4w|3b2w1b g:5, h:0 4b3b2w1b| g:6, h:0 1w2b|3w4w g:10, h:0 2w|1b3w4w g:12, h:0 2b1b|3w4w g:13, h:0 1w2w3w4w g:15, h:0Actually I am expected this output
1b2b|3w4b g:0, h:0 2w|1w3w4b g:2, h:2 2b1w3w4b| g:3, h:2 4w|3b1b2w g:7, h:4 4b3b1b2w| g:8, h:4 2b1w|3w4w g:12, h:2 1b|2w3w4w g:14, h:0 1w2w3w4w g:15, h:0