There's not too much that's actually wrong with it, but you mislabelled your variables because you put them on a range from 0,...,2 instead of 1,...,3
. And you didn't subtract and add temp to the variable stored either, and you didn't change the variable gold on hand to reflect the fact that temp was just removed or added to it