You are setting you're $days to 0 at the beginning of the passage. Which would reset the days to 0 every time the passage is loaded. Maybe move this part into an init passage?
Oops that was not how I meant to write it. I actually do have it in an init passage. I was trying to show that $days was set to 0. But even if I did have it in this passage, wouldn't clicking "Rest" still update the variable?
Clicking on Rest will update the variable but it will not update the "Day $day" part of the page, if you want that to happen then you need to do it yourself using code like:
Here you can rest, eat, or reassess your inventory.
Rest(click: "Rest")[(set: $days to $days + 1)(replace: ?days)[$days]]
Day |days>[$days]
Comments
Or maybe this helps:
[exampleClick]<Example|
(click: ?Example)[
You clicked exampleClick.
]
What you are missing might be a clickable Link. I could be wrong though. Still new myself.