. . . the coming of semi-intelligent machines into business and technology had created a second Industrial Revolution, in which only the most highly creative human beings, and those most gifted at administration, found themselves with any skills to sell which were worth the world's money to buy.
James Blish, A Life for the Stars
Computers allow us to be creative -- Seymour Papert calls them the proteus of machines, that is, machines which are more flexible and more adaptable than any others have been, or could be.
I have tried to show how the BBC computer can be used in a highly creative manner. The creativity comes from the individual, and the way to enhance one's own creativeness. is to try to be creative. Creativity does not come from following rules, it comes from trying to extend and improve, as I hope you improve upon my efforts.
The saintly books which try to teach good programming practice by the application of rules of (say) structured programming often annoy me. Books which are forever denigrating the use of GOTO are more concerned with academic ideals than actual practice. Sometimes the contortions needed to get round the use of a GOTO have to be read to be believed.
A careful examination of my routines will not reveal a GOTO, there was no need for a GOTO and -- in creative programming on the BBC computer -- there never need be. I do not use GOTO because in complex systems such as Turtle Graphics 3.2 a GOTO would probably create more havoc than it saved. Note, however, that in PROC_NORT I effectively had a jump out of a routine to END -- rules are there to be broken.
My advice, for what it is worth, is to steer clear of rules, try to get a feel for the topic, try to understand what are really the essential elements -- accentuate the intrinsic, eliminate the extrinsic (if at all possible). The key to successful thought, never mind programming, is to divine the essence of the problem. Aristotle said that (sort of).
End of sermon.
Obvious extensions are the multi-coloured graphics to sixteen colours (that will produce fun and games when you try). To extend to the sixteen colours of mode 2 means that space will become at a premium, so the economy of the turtle graphics/intrinsic approach will become even more valuable.
PROC_NORT (I nearly called it PROC_FFORT) can easily be improved, in particular the keyboard sensing - eg using *FX11 and *FX12 commands. You might wish to change the angle turned from 90 degrees - that, at least, is easily done.
You will have most fun with the routines in TG 3.2. Why not implement a game in a new geometry, instead of boring Euclidean geometry (ie with rectilinear coordinates?). PROC_NORT in a multi-coloured strange geometry would be a game and a half. It would also be a worthwhile programming exercise.
My next BBC graphics book will move on to three (and more dimensions) for even more flamboyant games effects, and it will analyse animation in far greater detail: what is to stop you getting there first?
I have referred to several books within the body of this book, and I list them here - in sufficient detail that you may if you wish order them from a library, or possibly buy. I have not yet found a reasonable book on mathematics applicable to computers, and so -- until I write it -- do the best you can. The Kasner and Newman is an old book, but it has a lot to offer.
As I am not too good on the alphabet (though I know it goes from ASCII 65 to ASCII 90, in capitals) the list is given in almost an order of reading: I assume you have the User Guide.
Seymour PAPERT, Mindstorms, The Harvester Press, 1980.
Edward KASNER and James NEWMAN, Mathematics and the Imagination, Penguin Books, 1968 (originally published in 1940).
Morris KLINE, Mathematics in Western Culture, Penguin Books, 1972 (originally published in 1953).
Harold ABELSON and Andrea diSESSA, Turtle Geometry, MIT Press, 1980.
The last is last because it is very expensive, and more difficult to follow in later chapters.
My final recommendation is the Cities in Flight quartet by James Blish (see the above quotation). Reading it might explain the cities in flight on my covers (Collected edition, Arrow, 1981).
10 REM*******************************
*************
20 REM B O R I S ' S P A R T I N G
G I F T
30 REM*******************************
*************
40
50
31000 DEF PROC_SCANDUMP(XL%,YL%,XU%,YU%)
31010 LOCAL X%,Y%,I%,J%,B%
31020 XL% = 32*(XL% DIV 32 - 1) : YL% =
4*(YL% DIV 4 - 1)
31030 XU% = 32*(XU% DIV 32 + 1) : YU% =
4*(YU% DIV 4 + 1)
31040 J% = (YU% - YL%) DIV 4 : DIM N J%
31050 REM Bit images for a vertical line
will be stored in N
31060 VDU 2, 1,12, 1,27, 1,51, 1,23
31070 REM Printer on, linefeed, and 23/2
16 inches per line
31080 FOR X% = XL% TO XU% STEP 32
31090 FOR Y% = YL% TO YU% STEP 4
31100 B% = 0 : FOR I% = 0 TO 31 STEP 4
31110 REM Store the bit image of 8 horiz
ontal pixels
31120 B% = B%*2 : IF POINT(X%+I%,Y%) >0
THEN B% = B% + 1
31130 NEXT I% : N%?((Y%-YL%) DIV 4) = B%
31140 REM The bit image is stored in suc
cessive elements of N
31150 NEXT Y% : VDU 1,27, 1,75, 1,(J%+1)
MOD 256, 1, (J%+1) DIV 256
31160 REM Prepare printer for J%+1 bit i
mages from N
31170 FOR I% = 0 TO J% : VDU 1,N?I% : NE
XT I%
31180 VDU 1,13 : NEXT X%
31190 REM End the line with a return
31200 VDU 1,27, 1,50, 3 : REM Switch off
printer
31210 ENDPROC : REM SCANDUMP
>