Home » Archimedes archive » Acorn User » AU 1994-02.adf » !C_Interp_C_Interp » Examples/Lines

Examples/Lines

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-02.adf » !C_Interp_C_Interp
Filename: Examples/Lines
Read OK:
File size: 00ED bytes
Load address: 0000
Exec address: 0000
File contents
@* An example of the BBC library functions *@

main()
{
int x,y,c;

bbc_mode(15);
bbc_cursor(0);
puts("Colourful Lines..");

while(1==1)
  {
  x = rand()%1280;
  y = rand()%1024;
  c = rand()%256;
  bbc_gcol(0,c);
  bbc_draw(x,y);
  }
}
00000000  40 2a 20 41 6e 20 65 78  61 6d 70 6c 65 20 6f 66  |@* An example of|
00000010  20 74 68 65 20 42 42 43  20 6c 69 62 72 61 72 79  | the BBC library|
00000020  20 66 75 6e 63 74 69 6f  6e 73 20 2a 40 0a 0a 6d  | functions *@..m|
00000030  61 69 6e 28 29 0a 7b 0a  69 6e 74 20 78 2c 79 2c  |ain().{.int x,y,|
00000040  63 3b 0a 0a 62 62 63 5f  6d 6f 64 65 28 31 35 29  |c;..bbc_mode(15)|
00000050  3b 0a 62 62 63 5f 63 75  72 73 6f 72 28 30 29 3b  |;.bbc_cursor(0);|
00000060  0a 70 75 74 73 28 22 43  6f 6c 6f 75 72 66 75 6c  |.puts("Colourful|
00000070  20 4c 69 6e 65 73 2e 2e  22 29 3b 0a 0a 77 68 69  | Lines..");..whi|
00000080  6c 65 28 31 3d 3d 31 29  0a 20 20 7b 0a 20 20 78  |le(1==1).  {.  x|
00000090  20 3d 20 72 61 6e 64 28  29 25 31 32 38 30 3b 0a  | = rand()%1280;.|
000000a0  20 20 79 20 3d 20 72 61  6e 64 28 29 25 31 30 32  |  y = rand()%102|
000000b0  34 3b 0a 20 20 63 20 3d  20 72 61 6e 64 28 29 25  |4;.  c = rand()%|
000000c0  32 35 36 3b 0a 20 20 62  62 63 5f 67 63 6f 6c 28  |256;.  bbc_gcol(|
000000d0  30 2c 63 29 3b 0a 20 20  62 62 63 5f 64 72 61 77  |0,c);.  bbc_draw|
000000e0  28 78 2c 79 29 3b 0a 20  20 7d 0a 7d 0a           |(x,y);.  }.}.|
000000ed