Limit dropdown options based on variable?

Twine Version: 2.3.5
Story Format: Harlowe 3.1.0

I am wondering if there is a way to provide numeric dropdown options up to the value of a variable? So, if $Energy is 3, the dropdown would be (dropdown: bind $Spend, 0, 1, 2, 3). Whereas, if $Energy is 6, the dropdown would be (dropdown: bind $Spend, 0, 1, 2, 3, 4, 5, 6). Or perhaps there is a better way to do this than a dropdown, to have the user make a choice from 0 to the value of a variable? Thanks for any hints! I’m still a newbie and trying to figure it all out. :slight_smile:

I supplied a solution to this question on the Twine Discord service, if required I can also re-iterate that answer here.