"SOL" wrote:
hort = RND(3)
if hort = 1
printMsg("Heads")
else if hort = 2
printMsg("Tails")
end if
So that should work, if you wrap it up:
sub main()
hort = RND(2)
if hort = 1 then
printMsg("Heads")
else if hort = 2 then
printMsg("Tails")
end if
while true
end while
end sub
The "while" loop is to keep your channel from exiting when it finishes.
FYI rnd(3) output will be 1, 2 or 3. For two value pseudo-random number generation you would do rnd(2). This may be different from what you see on other platforms.
Also, me, personally, I prefer to tack a "then" on the end of my if statements, as a habit, as there are some conditions under which the statement will fail if you leave it off.
- Joel