Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

[First time post] Adding a "max number" to variables?

Hi,

Long time forum searcher, first time poster. I'm working in Harlowe (version 2.0.8, if that matters). Forgive me if I've missed the following question get answered somewhere, but so far I haven't found it.

So, basically, I'm working on a kind of board game with die rolls. This is what I've been using so far to propel the players up the board:

(set: $event to (random: 1, 6))(if: $event is 1)[1! (set: $Player1 to $Player1+1)You're moving to Square $Player1.](if: $event is 2)[2! (set: $Player1 to $Player1+2)You're moving to Square $Player1.](if: $event is 3)[3! (set: $Player1 to $Player1+3)You're moving to Square $Player1.](if: $event is 4)[4! (set: $Player1 to $Player1+4)You're moving to Square $Player1.](if: $event is 5)[5! (set: $Player1 to $Player1+5)You're moving to Square $Player1.](if: $event is 6)[6! (set: $Player1 to $Player1+6)You're moving to Square $Player1.]

Works great. The game is completely playable as it is now, but there's an aesthetic issue I want to get rid of. So, the board is meant to have 100 squares and when you reach the end, you win. The way it is now though, the $Player1 number can go above 100, making for an inaccurate message. So, yeah, what do I add so that $Player1 doesn't go higher than 100?

Thanks!
Sign In or Register to comment.