Oopsi. I saw your code with hardcoded values, the fact it works for only two cases, and your question about the update of the test variable, and I extrapolated a little. Sorry for that. ^^’
EDIT:
Since I haven’t done this puzzle, I’m not the more qualified to help you with the details…
N. B In the future avoid to share complete code publicly. This one is not a probleme since it’s not fully working and need somme work. But pay attention.