this says `goto 50` but there are no line numbers
BBC BASIC raytracer in 432 characters
11–20 of 96 posts
Re: BBC BASIC raytracer in 432 characters
#12Do enjoy the insane things ppl managed to cram into tweets to the bbcmicrobot over the years. Anyone who's followed any part of the demoscene especially the classic smaller payload demos.. 4k etc.....this kinda thing is mindblowing and totally in the same spirit.
Re: BBC BASIC raytracer in 432 characters
#13Re: BBC BASIC raytracer in 432 characters
#14Ok, this is probably a dumb question: I get that the code traces the rays for this scene, obviously — but where is the scene, then? That is, where is the “data” (as opposed to the algorithm) that says “there’s a sphere at coordinates x,y,z with radius r, and here’s the other one, and here’s the checkerboard plane”?
W=1/SQR(U*U+V*V+1)
This makes a sphere. It gets multiplied by two coordinates to make spheres at different places, U and V.Re: BBC BASIC raytracer in 432 characters
#15this says `goto 50` but there are no line numbers
If you go to the source link - https://bbcmic.ro/?t=9ctpk - then you can see the numbers with the lines. They increment in steps of 10 (which IIRC you could override manually with numbers in-between).
If you just want to see the result, type MODE 1 and then press return, then type *LOAD SCREEN and press return again.
Re: BBC BASIC raytracer in 432 characters
#16Ok, this is probably a dumb question: I get that the code traces the rays for this scene, obviously — but where is the scene, then? That is, where is the “data” (as opposed to the algorithm) that says “there’s a sphere at coordinates x,y,z with radius r, and here’s the other one, and here’s the checkerboard plane”?
Re: BBC BASIC raytracer in 432 characters
#17In the replies underneath, someone ran it on a real Acorn Electron computer (6502 at 1 MHz), where it completed in 8 hours and 40 minutes. Not too bad really.
Re: BBC BASIC raytracer in 432 characters
#18Earlier quoted context omitted.
BBC BASIC is surprisingly efficient for an interpreted language. It kind of had to be, running on processors that slow.
Some good discussion of that on The BBC BASIC wiki entry: https://en.wikipedia.org/wiki/BBC_BASIC (paragraph beginning "Due to a number of optimizations[…]".
Re: BBC BASIC raytracer in 432 characters
#19this says `goto 50` but there are no line numbers
If you go to the source link - https://bbcmic.ro/?t=9ctpk - then you can see the numbers with the lines. They increment in steps of 10 (which IIRC you could override manually with numbers in-between).
Re: BBC BASIC raytracer in 432 characters
#20Earlier quoted context omitted.
that's astounding; i would have guessed months or years
BBC BASIC is surprisingly efficient for an interpreted language. It kind of had to be, running on processors that slow.
i thought they had to be, running on processors with that little memory. though later on i learned about forth, which is surprisingly efficient for an interpreted language
a more likely explanation is that sophie wilson was just a better hacker than bill gates and paul allen