My Pages

BBC BASIC

I use BBC basic to code and use super decade games to take code from. Here I will write pieces of code as well as posting them on the blog.



Random line Generator



Enter this code into BBC basic (demo or full) and it will create a random line generator. Go to super decade games for more code like this. (That's my teacher's webpage)

rem Random Lines
mode 6: off


colour 1 ,rnd(255),rnd(255),rnd(255)
gcol 1
x%=rnd(1200)
y%=rnd (950)
xa%=rnd(1200)
ya%=rnd (950)


line x%,y%,rnd(1200),rnd(950)
repeat

colour 1 ,rnd(255),rnd(255),rnd(255)
gcol 1

line x%,y%,xa%,ya%

x%=xa%
y%=ya%
wait 5
xa%=rnd(1200)
ya%=rnd (950)

until false