I'm trying to write the code to throw empty vials at random squares, map looks like this (x - can't throw there, o - able to throw, c - character):
xooooo
ooooco
So basicly I can throw max 4 sqm to the left and 1 to the right, 1 to the up and 1 down so I tried to make it random:
But Misc.Random() is returnings numbers like 1336611564.
Can someone fix this and my if...else statements? I'm not sure how to do them in BBot.
xooooo
ooooco
So basicly I can throw max 4 sqm to the left and 1 to the right, 1 to the up and 1 down so I tried to make it random:
Code:
X:=Self.X()
Y:=Self.Y()
Z:=Self.Z()
RX:=Misc.Random(0,4)
if(!RX!==4)
Y:=Self.Y()
else
Dec(Y, 1)
if(!RX!>1) Dec(X, RX)
else Inc(X, RX)
Map.Thrown(285, 100, X, Y, Z)
But Misc.Random() is returnings numbers like 1336611564.
Can someone fix this and my if...else statements? I'm not sure how to do them in BBot.