Hello! I’m making a game for my thesis and part of it is a weights-in-scale puzzle. What I want to achieve with this puzzle is a) for the player always to be able to see the state of the scales (equal, leaning on the right, leaning on the left) according to their weights and b) for the puzzle to be solved when the weights are equal. I can’t think of a way to add the values of each container(scale pans), and the documentation on lists wasn’t very helpful. The way I thought I’d achieve it is brute forcing it with ifs, but before I do that, is there something I’m missing? This is my (relevant) code so far:
A mass is a kind of value. 1dr specifies a mass. The plural of mass is masses.
A weight is a kind of thing. The plural of weight is weights. A weight has a mass. Definition: A weight is heavy if its mass is 1dr or more.
A compartment is a closed unopenable container. (It is in the room).
A weight1 is a weight. It is in the compartment. The mass of weight1 is 2dr.
A weight2 is a weight. It is in the compartment. The mass of weight2 is 5dr.
A weight3 is a weight. It is in the compartment. The mass of weight3 is 3dr.
A weight4 is a weight. It is in the compartment. The mass of weight4 is 4dr.
A scale is a thing in (the room). It is fixed in place.
A left pan is part of the scale. It is a container.
A right pan is part of the scale. It is a container.
By adding Definition: A weight is heavy if its mass is 1dr or more.
I have realized it recognizes if one weight is heavier than the other, but I can’t find a way to do that with a sum of weights. Thank you in advance!