Random colors in SdlBasic

This is a sample code for generate simple random colors in sdlbasic

setdisplay(800,600,32,1)
setcaption("Random Colors")
mousehide()


while (not key (K_ESC))

x= 50 + rnd(700)
y= 50 + rnd(500)
r= 10 + rnd(40)

red = rnd(256)
grn = rnd(256)
blu = rnd(256)

ink(rgb(red,grn,blu))
circle(x,y,r)
paint(x,y)

screenswap
wend
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s