Books that you just can't quit.

edited September 2013 in Sinclair Basic
Much as parts of the presentation,writing style infurates me, there is a book I just keep comming back to again and again.

Its like the Yang to the Yin of the Tim Hartnell writing style.

Advanced Graphics With The Sinclair ZX Spectrum, Why can't I quit you!:x

Much as I hate this book its full of great advice and tips.

lol.

:D

vmrknl.gifxde328.gif2h6t4wh.gif2cqmctj.gif
Post edited by wibble on

Comments

  • edited August 2013
    Exploring Adventures on your ZX Spectrum by Peter Gerrard is one I read many times as a kid. It's obviously written with a lot of love for the genre and his descriptions of other classic adventure games struck my imagination and made me want them play them. However, this was not to be until many years later thanks to the Internet. :)
  • edited August 2013
    The Advanced Graphics authors knew their maths, but didn't have much of a clue about writing a book. For example, this is an edited version of something they land you with on page 2!
    ... we give below the program required to draw figure 1.1 ...
    The program requires the merging of listings 2.1, 2.2, 2.3, 2.4 and 3.3 ...
    To [these] must be added 3.4, 8.1, 8.2, 8.3, 8.4, 9.1 and 9.2 ...
    We need also listing 10.3 as well as the 'scene3' routine given in listing 1.1 below.
    ...
    ...
    We hope that this example will inspire you to implement all the programs in this book ...

    As can be deduced from the numbers, none of these listings would have yet been encountered by the reader and are scattered widely throughout the book, and what initially appeared as a simple task to start with is revealed to be a substantial typing ordeal. Hardly the best of introductions to the topic. There's a lot of useful stuff in the book, but the presentation is poor.

    By far my most read Spectrum book is the Logan/O'Hara "The Complete Spectrum ROM Disassembly". I've referred to that frequently for 30 years. Flipping Hell! I'm surprised that it's still in one piece, although some of the pages are just hanging on by a thread.
  • edited August 2013
    The Advanced Graphics authors knew their maths, but didn't have much of a clue about writing a book. For example, this is an edited version of something they land you with on page 2!



    As can be deduced from the numbers, none of these listings would have yet been encountered by the reader and are scattered widely throughout the book, and what initially appeared as a simple task to start with is revealed to be a substantial typing ordeal. Hardly the best of introductions to the topic. There's a lot of useful stuff in the book, but the presentation is poor.

    By far my most read Spectrum book is the Logan/O'Hara "The Complete Spectrum ROM Disassembly". I've referred to that frequently for 30 years. Flipping Hell! I'm surprised that it's still in one piece, although some of the pages are just hanging on by a thread.


    That little gem when I read it the first time caused much grief. I think it was a joke to keep "the wrong sort" from reading the book. Its so weird why you would put that at the very begining of the book unless it was delebrate to scare people off or try and diffrentiate it from the other type in books.

    I can imagine many people put the book on a shelf and never opened it again after that fiasco.

    You could hear my curseing from the first floor when I found out the typein had a bunch of additional modules to merge. Once I calmed down, the following examples were pretty self contained (for the first party anyway..)

    The maths as you say is clever, but thats another problem I have with its writing style. the maths is just magic. very little explanation. So its like the start of a whole bunch of research.

    Very strange book, looking at Infoseek, the reviews state it was a bunch of accademics that wrote it. So I guess thats what lead the the bizare document planning.

    Also they appear to be "language purists" you notice how they hit you with modular programming right at the start.

    Shame with a lot of the orignal books the binding seems to go (I am thinking of the melborne house books - the spines seem to disintegrate.) I am thankfull majority of the books have been scanned now so I can put them on a tablet.

    hopefully 30 hours basic will get scanned (the zx version) at some point. I can remember I used that when I was a nipper (but alas I have forgotten much of it lol.)
  • edited August 2013
    My copy of Z80 Reference Guide by Alan Tully is virtually falling to pieces, such a useful book which has guided me successfully through the murky waters of Z80 coding over the years.
    I wanna tell you a story 'bout a woman I know...
  • edited August 2013
    1000 DIM R(55): DIM C(55)
    1009 REM initialise routine pointers and set hiscore to 0.
    1010 LET fanfare=2000: LET worm=3000: LET key=4000: LET gobble=5000: LET status=6000: LET target=7000
    1020 BORDER 1: PAPER 7: INK 0
    1030 LET HSC=0
    1039 REM start/restart for game.
    1040 LET SCORE=0: LET WORMS=3: LET LEVEL=1
    1048 REM start a new worm, five segments long from row R collum CHR$
    1049 REM P is pointer to segment which is to be moved.
    1050 LET S=5: LET P=1: LET R=0: LET C=INT (RND*32)
    1059 REM set movement variables so that worm is going down.
    1060 LET RMOVE=1: LET CMOVE=0: LET H$="v"
    1069 REM clear array of segment positions.
    1070 FOR I=1 TO 55: LET R(I)=-1: NEXT I
    1079 REM set truth flags for game (0 = false, not 0 = true).
    1080 LET WON=0: LET DEAD=0
    1089 REM set up screen with yellow strips on the top and bottom.
    1090 CLS : PRINT AT 0,0; PAPER 6;,,: PRINT AT 21,0; PAPER 6;,,
    1099 REM print out scores and place a \` note target on the screen$
    1100 GO SUB status: GO SUB target
    1109 REM main loop of game: check for controls, move worm.
    1110 GO SUB key: GO SUB worm
    1119 REM if nothing has happened keep on looping.
    1120 IF NOT DEAD AND NOT WON THEN GO TO 1110
    1129 REM if one worm has eaten \`10 give fanfare and start a new worm.
    1130 IF WON THEN LET LEVEL=LEVEL+1: GO SUB fanfare: GO TO 1050
    1139 REM make crashing noise.
    1140 IF DEAD THEN FOR I=1 TO 10: BEEP 0.005,15: NEXT I
    1149 REM if you have another worm left start a new worm.
    1150 IF DEAD THEN LET WORMS=WORMS-1: IF WORMS<>0 THEN GO TO 1050
    1159 REM remove all segments by moving one pointer along the back of worm.
    1160 FOR I=1 TO S: BEEP 0.01,0: PRINT AT R(P),C(P); PAPER 7;" "
    1170 LET P=P+1: IF P>S THEN LET P=1
    1180 NEXT I
    1189 REM remove target from screen and update score line.
    1190 PRINT AT Y,X; PAPER 7;" ": GO SUB status
    1199 REM use flashing input to wait for entry before restarting game.
    1200 LET I$=CHR$ 18+CHR$ 1+"PRESS ENTER TO START GAME"+CHR$ 18+CHR$ 0
    1210 INPUT (I$+"      "); LINE A$
    1220 GO TO 1040
    2000 REM fanfare
    2009 REM this is played when you go up a level.
    2010 DATA 0.06,18,0.06,19,0.06,21,0.15,27,0.06,21,0.2,27
    2019 REM read and play the six notes/duration combinations.
    2020 RESTORE fanfare: FOR I=1 TO 6: READ L,T: BEEP L,T: NEXT I
    2030 RETURN
    3000 REM worm
    3008 REM worm moves by taking last segment and moving it to the from.
    3009 REM if it's not a growth segment then erase it at it's old position.
    3010 IF R(P)<>-1 THEN PRINT AT R(P),C(P); PAPER 7;" "
    3019 REM calculate new position of worms head.
    3020 LET R=R+RMOVE: LET C=C+CMOVE
    3029 REM check for collision with boundaries.
    3030 IF R>20 OR R<1 OR C>31 OR C<0 THEN LET DEAD=1: RETURN
    3039 REM check for collision with anotehr segment of worm.
    3040 IF ATTR (R,C)=16 THEN LET DEAD=1: RETURN
    3049 REM set row and column of segment to new postion.
    3050 LET R(P)=R: LET C(P)=C
    3059 REM check whether target has been eaten.
    3060 IF SCREEN$ (R,C)="\`" THEN GO SUB gobble
    3069 REM put new segment on screen and move pointer along worms back.
    3070 PRINT AT R(P),C(P); PAPER 2;H$
    3080 LET P=P+1: IF P>S THEN LET P=1
    3090 RETURN
    4000 REM key
    4009 REM check for controls being used.
    4010 LET A$=INKEY$: IF A$="" THEN RETURN
    4019 REM make sure all letters are treated as lower case.
    4020 IF CODE A$<96 THEN LET A$=CHR$ (CODE A$+32)
    4028 REM worm can only turn left or right from course not back on itself.
    4029 REM control for up is pressed, if you're not going down then turn up.
    4030 IF A$="w" AND CMOVE THEN LET RMOVE=-1: LET CMOVE=0: LET H$="^ ": RETURN
    4039 REM turn down (if worm is not going up).
    4040 IF A$="s" AND CMOVE THEN LET RMOVE=1: LET CMOVE=0: LET H$="v": RETURN
    4049 REM turn left (if worm is not going right).
    4050 IF A$="a" AND RMOVE THEN LET RMOVE=0: LET CMOVE=-1: LET H$="<": RETURN
    4059 REM turn right (if worm is not going left.)
    4060 IF A$="d" AND RMOVE THEN LET RMOVE=0: LET CMOVE=1: LET H$=">": RETURN
    4070 RETURN
    5000 REM gobble
    5009 REM eat target, make gobbling noises.
    5010 FOR I=2 TO 4 STEP 0.5
    5020 BEEP 0.01,EXP I-10: NEXT I
    5029 REM add to your score and update score-lines.
    5030 LET SCORE=SCORE+1: GO SUB status
    5038 REM make five more segments available for growth.
    5039 REM if worm has 55 segments available for growth.
    5040 LET S=S+5: IF S=55 THEN LET WON=1: RETURN
    5049 REM place a new target on the screen$
    5050 GO SUB target
    5060 RETURN
    6000 REM status
    6009 REM if your score beats hiscore then update hiscore.
    6010 IF SCORE>HSC THEN LET HSC=SCORE
    6019 REM print out both score-lines.
    6020 PRINT AT 0,0; PAPER 6;"   SCORE ";SCORE," HI-SCORE ";HSC
    6030 PRINT AT 21,0; PAPER 6;"   LEVEL  ";LEVEL,"  WORMS ";WORMS
    6040 RETURN
    7000 REM target
    7009 REM choose a character block in the playing area at random.
    7010 LET X=RND*31: LET Y=RND*19+1
    7019 REM check that it's not the same place as the last one.
    7020 IF X=C AND Y=R THEN GO TO target
    7029 REM check that it's not under the worm.
    7030 IF ATTR (Y,X)=16 THEN GO TO target
    7039 REM print new \` note on the screen.
    7040 PRINT AT Y,X; PAPER 4;"\`"
    7050 RETURN
    

    My newbei coding skills cant find why its not working quite as the listing should. When I run the program sometimes snake blocks get left in the play area.
  • edited August 2013
    My first thought would be that lines 1050 & 7010 will produce different ranges of possible values for the column#. To prove it run this:
    10 RANDOMIZE 1: LET total1=0
    20 FOR a=1 TO 200:
       POKE 23681,INT (RND*32): PRINT PEEK 23681;: LET total1=total1+PEEK 23681:
       NEXT a: PRINT ''
    40 RANDOMIZE 1: LET total2=0
    41 PRINT AT 0,0;: OVER 1
    50 FOR a=1 TO 200:
       POKE 23681,RND*31: PRINT PEEK 23681;: LET total2=total2+PEEK 23681:
       NEXT a: PRINT ''
    60 OVER 0: PRINT total1,total2
    
    Remove line 41 to compare the values. If they were consistent then the second loop would erase the output from the first loop and the two totals would be the same.
  • edited August 2013
    Turns out line 4030 had a space where there should have been none.

    Snake on the spectrum. :lol:

    Here is a question, the controls seem to be quite unresponsive, is that because of the limitations of basic or would a machine code routine for scanning the keyboard have the same problems?

    Ok 'tip of the hat to the authors that writing the code like this makes it easyer to swap out/play with the parts of the program.

    Alternatly I might just be getting old and my reactions are bad. :lol:

    This is the first "real" program that uses the merged modules, I cheated and used a text editior to create the BAS files but I guess pureists would use MERGE.

    16ii153.gif

    Ok, not the most visualy impressive but the concept is quite revolutionary for a specky program I cannot remember it being mentioned before about modular programming. I know as a kid at the time it would have blown my mind lol.
    100 REM drawing a square
    109 REM setup identifiers to graphics routines.
    110 LET start = 9700:LET setorigin = 9600: LET moveto = 9500: LET lineto = 9400
    119 REM define graphics area.
    120 LET HORIZ = 30: LET VERT = 20
    130 GO SUB start
    140 LET XMOVE = HORIZ*0.5: LET YMOVE = VERT*0.5
    150 GO SUB setorigin
    159 REM join corners of square in order.
    160 LET XPT = 7.5: LET YPT = 7.5: GO SUB moveto
    170 LET XPT = -7.5: LET YPT = 7.5: GO SUB lineto
    180 LET XPT = -7.5: LET YPT = -7.5: GO SUB lineto
    190 LET XPT = 7.5: LET YPT = -7.5: GO SUB lineto
    200 LET XPT = 7.5: LET YPT = 7.5: GO SUB lineto
    210 STOP
    9400 REM lineto
    9401 REM IN   : XPT, YPT, XPEN, YPEN
    9402 REM OUT  : XPEN, YPEN
    9410 LET NXPEN = FN X(XPT)
    9420 LET NYPEN = FN Y(YPT)
    9430 PLOT XPEN,YPEN
    9440 DRAW NXPEN-XPEN,NYPEN-YPEN
    9450 LET XPEN = NXPEN: LET YPEN = NYPEN
    9460 RETURN
    9500 REM moveto
    9501 REM IN   : XPT, YPT
    9502 REM OUT  : XPEN, YPEN
    9510 LET XPEN = FN X(XPT)
    9520 LET YPEN = FN Y(YPT)
    9530 RETURN
    9600 REM setorigin
    9601 REM IN   : XORIG, YORIG, XMOVE, YMOVE 
    9602 REM OUT  : XORIG, YORIG, XPEN, YPEN
    9610 LET XORIG = XORIG + XMOVE: LET YORIG = YORIG + YMOVE
    9620 LET XPEN = FN X(0)
    9630 LET YPEN = FN Y(0)
    9640 RETURN
    9650 DEF FN X(Z) = INT ((XORIG + Z)*XYSCALE + 0.5)
    9660 DEF FN Y(Z) = INT ((YORIG + Z)*XYSCALE + 0.5)
    9700 REM start
    9701 REM IN   : HORIZ, VERT
    9702 REM OUT  : NXPIX, NYPIX, XORIG, YORIG, XYSCALE, XPEN, YPEN
    9710 LET XORIG = 0: LET YORIG = 0
    9720 LET XPEN = 0: LET YPEN = 0
    9725 REM PAPER COLPAP:INK COLINK
    9730 LET NXPIX = 256: LET NYPIX = 176
    9740 LET XYSCALE = NXPIX/HORIZ: LET YSCALE = NYPIX/VERT
    9750 IF XYSCALE > YSCALE THEN LET XYSCALE = YSCALE
    9760 RETURN
    
  • edited August 2013
    Listing 2.9

    (all subroutines are included in the listing to avoid heartache and disapair.):-P

    N = 2
    33yoso4.gif
    N = 3
    14cd1fp.gif
    N = 4
    148f220.gif
    N = 5
    wikpvm.gif
    N = 6
    2cpdu00.gif
    N = 7
    168ihkg.gif
    N = 8
    2u57shv.gif
    N = 9
    swd0uf.gif
    N = 10
    358738i.gif
    N = 11
    1zdosrb.gif
    N = 12
    260wgow.gif
    N = 13
    2vw7ioo.gif
    N = 20
    a2w7if.gif
    100 REM main program/ calling polygon
    109 REM setup identifiers to graphics routines.
    110 LET start = 9700:LET setorigin = 9600: LET moveto = 9500: LET lineto = 9400
    120 LET HORIZ = 3: LET VERT = 2.1
    130 GO SUB start
    140 LET XMOVE = HORIZ*0.5: LET YMOVE = VERT*0.5
    150 GO SUB setorigin
    160 DIM X(30): DIM Y(30)
    169 REM setup vertices of regular N-gon in arrays X and Y.
    170 INPUT "TYPE VALUE OF N ";N
    180 LET ALPHA = 0: LET ADIF = 2*PI/N
    190 FOR I = 1 TO N
    200 LET X(I) = COS ALPHA: LET Y(I) = SIN ALPHA
    210 LET ALPHA = ALPHA + ADIF
    220 NEXT I
    229 REM join point I to point J : 1<=I<J<=N.
    230 FOR I = 1 TO N-1
    240 FOR J = I+1 TO N
    250 LET XPT = X(I): LET YPT = Y(I): GO SUB moveto
    260 LET XPT = X(J): LET YPT = Y(J): GO SUB lineto
    270 NEXT J
    280 NEXT I
    290 STOP
    300 REM polygon
    301 REM IN    :NPOL, X(), Y()
    310 LET XPT = X(NPOL): LET YPT = Y(NPOL): GO SUB moveto
    319 REM join vertices of polygon in order.
    320 FOR I = 1 TO NPOL
    330 LET XPT = X(I): LET YPT = Y(I): GO SUB lineto
    340 NEXT I
    350 RETURN
    9400 REM lineto
    9401 REM IN   : XPT, YPT, XPEN, YPEN
    9402 REM OUT  : XPEN, YPEN
    9410 LET NXPEN = FN X(XPT)
    9420 LET NYPEN = FN Y(YPT)
    9430 PLOT XPEN,YPEN
    9440 DRAW NXPEN-XPEN,NYPEN-YPEN
    9450 LET XPEN = NXPEN: LET YPEN = NYPEN
    9460 RETURN
    9500 REM moveto
    9501 REM IN   : XPT, YPT
    9502 REM OUT  : XPEN, YPEN
    9510 LET XPEN = FN X(XPT)
    9520 LET YPEN = FN Y(YPT)
    9530 RETURN
    9600 REM setorigin
    9601 REM IN   : XORIG, YORIG, XMOVE, YMOVE 
    9602 REM OUT  : XORIG, YORIG, XPEN, YPEN
    9610 LET XORIG = XORIG + XMOVE: LET YORIG = YORIG + YMOVE
    9620 LET XPEN = FN X(0)
    9630 LET YPEN = FN Y(0)
    9640 RETURN
    9650 DEF FN X(Z) = INT ((XORIG + Z)*XYSCALE + 0.5)
    9660 DEF FN Y(Z) = INT ((YORIG + Z)*XYSCALE + 0.5)
    9700 REM start
    9701 REM IN   : HORIZ, VERT
    9702 REM OUT  : NXPIX, NYPIX, XORIG, YORIG, XYSCALE, XPEN, YPEN
    9710 LET XORIG = 0: LET YORIG = 0
    9720 LET XPEN = 0: LET YPEN = 0
    9725 REM PAPER COLPAP:INK COLINK
    9730 LET NXPIX = 256: LET NYPIX = 176
    9740 LET XYSCALE = NXPIX/HORIZ: LET YSCALE = NYPIX/VERT
    9750 IF XYSCALE > YSCALE THEN LET XYSCALE = YSCALE
    9760 RETURN
    9800 REM plot / CalComp
    9801 REM IN   : XPT, YPT, XPEN, YPEN, XORIG, YORIG, MODE
    2802 REM OUT  : XPEN, YPEN, XORIG, YORIG
    9810 LET NXPEN = FN X(XPT)
    9820 LET NYPEN = FN Y(YPT)
    9830 IF ABS (MODE) = 2 THEN PLOT XPEN,YPEN: DRAW NXPEN-XPEN,NYPEN-YPEN
    9840 LET XPEN = NXPEN: LET YPEN = NYPEN
    9850 IF MODE < 0 THEN LET XORIG = XORIG + XPT: LET YORIG = YORIG + YPT
    9860 RETURN
    
  • edited August 2013
    If 'key' was a time-critical sub-routine then it should be put at the start, the REMs moved together at the start of that, and GOSUBs address the first command after the REMs directly rather than via a variable. Eg. Move the 'key' sub-routine from 4000... to 40..., put all the REMs in line 40 and call it with GOSUB 41. Run the program with RUN 1000.

    However, as 'key' is only called once there's not much point putting it in a sub-routine anyway. The same applies to 'worm'.

    It takes time to pass over a REM (7 frames according to BASin), so don't put them in places where the interpreter will have to pass over them many times.

    Turn off CAPS with POKE 23658,0 at the start so line 4020 can be dropped.

    Avoid checking things more than once whenever possible. Avoid checking things at all whenever possible (eg. A$=""). Use literal numbers for GOTOs/GOSUBs rather than variables if the line number is not calculated and the routine is time-critical. Use multi-statement lines where possible.
    1110 LET a$=INKEY$: IF NOT cmove THEN GO TO 1116
    1112 IF A$="w" THEN LET RMOVE=-1: LET CMOVE=0: LET H$="^": GO TO 1120
    1113 IF A$="s" THEN LET RMOVE=+1: LET CMOVE=0: LET H$="v": GO TO 1120
    1116 IF NOT rmove THEN GO TO 1120
    1117 IF A$="a" THEN LET RMOVE=0: LET CMOVE=-1: LET H$="<": GO TO 1120
    1118 IF A$="d" THEN LET RMOVE=0: LET CMOVE=+1: LET H$=">"
    1120-1127 'worm' code
    1128 IF NOT DEAD AND NOT WON THEN GO TO 1110
    

    Running lines 1110-1118 100 times for each of the four conditions being true in turn takes 9.9 secs according to BASin, whereas doing the same for lines 4000-4060 takes 15.2 secs.
  • edited August 2013
    wibble wrote: »
    Advanced Graphics With The Sinclair ZX Spectrum, Why can't I quit you!:x
    And I still hate that book, after all these years.

    However I did MERGE now that the tap file is available (only for the first few programs though), and it's a lot better than flipping pages all the time.

    And if I see the end results I'd just wonder why it needed so many libraries all around the book in the first place...
  • edited August 2013
    If 'key' was a time-critical sub-routine then it should be put at the start, the REMs moved together at the start of that, and GOSUBs address the first command after the REMs directly rather than via a variable. Eg. Move the 'key' sub-routine from 4000... to 40..., put all the REMs in line 40 and call it with GOSUB 41. Run the program with RUN 1000.

    However, as 'key' is only called once there's not much point putting it in a sub-routine anyway. The same applies to 'worm'.

    It takes time to pass over a REM (7 frames according to BASin), so don't put them in places where the interpreter will have to pass over them many times.

    Turn off CAPS with POKE 23658,0 at the start so line 4020 can be dropped.

    Avoid checking things more than once whenever possible. Avoid checking things at all whenever possible (eg. A$=""). Use literal numbers for GOTOs/GOSUBs rather than variables if the line number is not calculated and the routine is time-critical. Use multi-statement lines where possible.
    1110 LET a$=INKEY$: IF NOT cmove THEN GO TO 1116
    1112 IF A$="w" THEN LET RMOVE=-1: LET CMOVE=0: LET H$="^": GO TO 1120
    1113 IF A$="s" THEN LET RMOVE=+1: LET CMOVE=0: LET H$="v": GO TO 1120
    1116 IF NOT rmove THEN GO TO 1120
    1117 IF A$="a" THEN LET RMOVE=0: LET CMOVE=-1: LET H$="<": GO TO 1120
    1118 IF A$="d" THEN LET RMOVE=0: LET CMOVE=+1: LET H$=">"
    1120-1127 'worm' code
    1128 IF NOT DEAD AND NOT WON THEN GO TO 1110
    

    Running lines 1110-1118 100 times for each of the four conditions being true in turn takes 9.9 secs according to BASin, whereas doing the same for lines 4000-4060 takes 15.2 secs.

    Thanks I will give that a spin tommorow,

    Just a quick question. Another program I have accepts
    400 INPUT B$
    

    What I want to do is convert the string B$ into either all upper case or all lower case letters so when I do a comparison against some data statements I dont have to have repeated sets. like "The Kings Head", "THE KINGS HEAD", "the kings head".

    How can I do this?

    I tryed just using the 4020 statement but it seems not to work.
  • edited August 2013
    Line 4020 will only work with single characters. You'd need something like:
    FOR b=1 TO LEN b$:
      LET a$=b$(b): LET b$(b)=CHR$(CODE a$+(32 AND a$>="A" AND a$<="Z"))
    ...or...
      LET a$=b$(b): LET b$(b)=CHR$(CODE a$-(32 AND a$>="a" AND a$<="z"))
    NEXT b
    
  • edited August 2013
    Well at least have some error trapping (so user is not constantly getting data outside or range message.)

    hmmm... but I like to think on other projects to keep fresh.

    Am chuffed I actually entered a assembly command into the spectrum, understood why and didnt just blindly rote copy functions. Horray!

    :p ok it was only C9 :Dbut still its a start, journey of a 1000 miles starts with a first step and all that jazz. Its a great feeling when stuff goes right.
  • edited August 2013
    C9 isn't assembly language, it's machine code ;) RET is assembly language.

    I'd change Battle Bunny's code to use CODE("A") instead of 32 but then again I prefer clarity to speed ;)
  • edited August 2013
    C9 isn't assembly language, it's machine code ;) RET is assembly language.

    I'd change Battle Bunny's code to use CODE("A") instead of 32 but then again I prefer clarity to speed ;)

    Ah my mistake, yes machine code.
    3E01
    0601
    80
    0600
    4F
    C9
    

    Ahhh how happy life is when you are easly pleased. :D
  • edited September 2013
    Hello all,

    When i was about 9 or 10 (late 80's/early 90's) i borrowed a book which had a ton of fun projects for the ZX 48K. I remember that one of the projects was to code a 3D (ish) sphere which (if i remember correctly) flashed colours? I think (may be wrong) that the book was a black coloured paperback. I spent hours and hours a night on that book but when i moved to the + model then +3 i pretty much forgot all about it with the excitement of using floppy discs. By any chance does anyone recognise the book? I would love a copy to show my young son what i was capable of with my 48K back when i was his age!

    Thanks
  • edited September 2013
    Was it 100 Programs for the ZX Spectrum? It's got a (metric) "ton" of programs, the cover's black, and it's got this dodgy coloured circles effort.
      10 REM P42 Kaleidoscope
      20 LET again=40
      30 BORDER 1: PAPER 7: BORDER 1 : CLS
      40 REM again
      50 FOR c=0 TO 7
      60 FOR n=2 TO 80 STEP 2+c/2
      70 CIRCLE OVER 1; INK c; PAPER 7-c;110,87,n
      80 CIRCLE OVER 1; INK c; PAPER 7-c;134,87,n
      90 NEXT n: NEXT c
     100 GO TO again
    
    The book's divided into 10 sections: Introduction, Games, Business, In the Home, Graphics, Data Handling, Recreation, In the Science Lab, Mathematics, School. There's a tape version on WoS. I'd hope that yours was a different book, as the programs in this one are all a bit crap. I think you'd make more of an impression showing him Cybernoid or Mercenary or Knight Lore or something like that and crossing your fingers.
  • edited September 2013
    Was it 100 Programs for the ZX Spectrum? It's got a (metric) "ton" of programs, the cover's black, and it's got this dodgy coloured circles effort.
      10 REM P42 Kaleidoscope
      20 LET again=40
      30 BORDER 1: PAPER 7: BORDER 1 : CLS
      40 REM again
      50 FOR c=0 TO 7
      60 FOR n=2 TO 80 STEP 2+c/2
      70 CIRCLE OVER 1; INK c; PAPER 7-c;110,87,n
      80 CIRCLE OVER 1; INK c; PAPER 7-c;134,87,n
      90 NEXT n: NEXT c
     100 GO TO again
    
    The book's divided into 10 sections: Introduction, Games, Business, In the Home, Graphics, Data Handling, Recreation, In the Science Lab, Mathematics, School. There's a tape version on WoS. I'd hope that yours was a different book, as the programs in this one are all a bit crap. I think you'd make more of an impression showing him Cybernoid or Mercenary or Knight Lore or something like that and crossing your fingers.

    Thanks for the reply! I remember this book, sadly, it was a bit of a dodgy effort and as I recall the tape got slung into the bottom of my drawer. Thanks for trying though! I had a fair few books, I will carry on looking. This bloody sphere was pretty basic to be fair, I was only about 9 and living in a world where Acorn and BBC were the top names at school haha. I will admit I eventually moved over to Atari ST and Amiga, my best creation being an Ikari Warriors type game haha.

    Thanks for trying!
Sign In or Register to comment.