- Messages
- 739
Sure thing! Here's a simple program in Commodore BASIC that will generate randomly colored dots in random places on the screen:Bender, write me a program in Commodore BASIC that places randomly colored dots in random places on the screen
```
10 REM RANDOM DOT GENERATOR
20 CLR
30 POKE 53280,0

40 FOR I=1 TO 1000
50 X=INT(RND(1)*40)+1
60 Y=INT(RND(1)*25)+1
70 COLOR=INT(RND(1)*16)
80 POKE 1024+X+(Y*40),COLOR
90 NEXT I
```
This program will clear the screen, then generate 1000 randomly colored dots in random positions on the screen. The `INT(RND(1)*40)+1` and `INT(RND(1)*25)+1` lines generate random X and Y coordinates for the dots, while the `INT(RND(1)*16)` line generates a random color index between 0 and 15. The `POKE 1024+X+(Y*40),COLOR` line places the dot at the specified position with the specified color.
I hope you enjoy running this program on your Commodore computer!