For those of you who may be reading through the first book of hands on darkbasic pro, I randomly figured this out when I was reviewing some chapters.
In activity 6.3, you will not get a proper working program with the code provided. The output will always be that the point(pixel) is not black. Here is an easy fix with material that was already covered previously, so no headaches
Rem Project: Dots01
randomize timer()
for i = 1 to 10000
color = rgb(rnd(255), rnd(255), rnd(255))
ink color,0
x = rnd(screen width())-1
y = rnd(screen height())-1
dot x, y
NEXT i
x = rnd(screen width())-1
y = rnd(screen height())-1
remstart
Checks to see if the red, green and blue components of the given point are 0.
If all 3 components are 0, the pixel is black(rgb(0,0,0)).
remend
if rgbr(point(x, y)) = 0 and rgbg(point(x, y)) = 0 and rgbb(point(x, y)) = 0
set text size 20
ink rgb(255,255,255),0
print "The pixel at ", x, ", ", y, " is black"
else
set text size 20
ink rgb(255,255,255),0
print "The pixel at ", x, ", ", y, " is not black"
ENDIF
wait key
end
Edit: Posting this here since it applies to those just starting out with DBPro.