Best option to use?

Hi guys, I am creating a number generating game, with three difficulties each leading to a different branch. The number guessed has to be between 1-1000

My problem comes here, on the “Hard” branch, the user has to be told whether they are within 10, 50, or 100 of the correct number, If I use too many if statements I cannot loop it back around, what is best to complete this task?

Try to use flowchart and use flow decisions instead of IF statements… It would be easier to visualize the flow of the logic and looping it back

Hi @Ryan_Green

There is more one practice to implement many if statements. The VB If operator is very useful for minor local conditions or data computing, and it can sometimes reduce a whole block to a single activity.
For example:
If(number<10, “0-9”, _
If(number<50, “10-49”, _
If(number<100, “50-99”,“100+”)))

1 Like