07-16-2023, 09:42 PM
Your code now work
i changed 80 to 8 ...smaller scale
i changed 80 to 8 ...smaller scale
Code: (Select All)
var i, x, y, coord
wcolor 0,0,0
'DIM scre(1 to 30, 1 to 80) as string
var scre[2400]
'you fill array with zeros
i = 1
while i < 2401
scre[i] = 0
i = i + 1
wend
'put something in center of screen
x = 40
y = 15
coord = (y - 1) * 8 + (x - 1)
scre[coord] = 1
i = 1
while i < 101
x = Rand(79) + 1
y = Rand(29) + 1
coord = (y - 1) * 8 + (x - 1)
if scre[coord] = 1
fcolor 255, 255, 255
print 0, 0, "FOUND IT!"
print 0, 20, i
print 20, 20, "tries."
i = 101
swap
endif
i = i + 1
swap
wend
micro(A)developer
http://basic4us.epizy.com/forum/index.php
http://basic4us.epizy.com/forum/index.php