Welcome to the Builder Academy

Question weather

More
19 Apr 2018 19:40 #7957 by JTP
Replied by JTP on topic weather
Just tried 1, 10 and a <= 5

that seems to work, just saw the else message
Hope i next time see the if message

Please Log in or Create an account to join the conversation.

More
19 Apr 2018 20:21 #7958 by JTP
Replied by JTP on topic weather
hmm same again

Please Log in or Create an account to join the conversation.

More
19 Apr 2018 20:35 #7959 by lacrc
Replied by lacrc on topic weather
When you say "same again" is it because they repeated or is it because you were expecting them to alternate?

With rand_number() you're not guaranteed to have one outcome after the other, they have a 50% chance of happening but that's it, they can repeat.

If you want to have your code alternating results then you need to set a variable (probably a global in your code?) and have the weather use it as a check as you see necessary.

Please Log in or Create an account to join the conversation.

More
19 Apr 2018 20:40 #7960 by JTP
Replied by JTP on topic weather
yea saw the if message now :)

Please Log in or Create an account to join the conversation.

More
19 Apr 2018 21:20 - 19 Apr 2018 21:22 #7961 by krell
Replied by krell on topic weather
Right, increase the the range between your starting and end values then pick the median as the cutoff point. Nicely done.

Is the "if message" also represented by "..."? I'm a little lost.
Last edit: 19 Apr 2018 21:22 by krell.

Please Log in or Create an account to join the conversation.

More
19 Apr 2018 21:26 #7962 by JTP
Replied by JTP on topic weather
just tried to cut away as much unnessesary stuff as possible for easier reading hense then .... instead of a long line :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.186 seconds