Advertisement
lovejoy777

HELP needed with 2 dim array

Jan 16th, 2024
1,440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ZXBasic 1.98 KB | Source Code | 0 0
  1.    10 REM ******************************
  2.    20 REM *        AGON LIGHT 2        *
  3.    30 REM *      BBC BASIC MODE 8      *
  4.    40 REM *          DEMO 10           *
  5.    50 REM *         320 X 240          *
  6.    60 REM *     DRAW & SCALE TEXT2     *
  7.    70 REM *       BY LOVEJOY777        *
  8.    80 REM ******************************
  9.    90 :
  10.   100 VDU 22,8 : REM SET SCREEN MODE.
  11.   110 VDU 23,1,0 : REM DISABLE TEXT CURSOR.
  12.   120 VDU 12 : REM SAME AS CLS.
  13.   130 VDU 16 : REM SAME AS CLG.
  14.   140 VDU 18,0,10 : REM SAME AS GCOL.
  15.   150 SW% = 1280 : SH%=1024 : REM SCREEN WIDTH & HEIGHT IN GRAPHICAL UNITS.
  16.   160 SC=2.0 : REM ASSIGN FLOAT FOR SCALE.
  17.   170 IW% = 16
  18.   180 IH% = 16
  19.   190 AX%=SW%/2-200 : AY%=SH%/2-8 : REM ASSIGN VARS FOR A's X & Y START COORDS (center).
  20.   200 :
  21.   400 PROC_DRAWA
  22.   410 :
  23.   470 END : REM **** END PROGRAM ****
  24.   480 :
  25.   500 REM ********** PROCS **********
  26.  1000 :
  27.  2000 REM **** DRAW AGON ****.
  28.  2010 DEF PROC_DRAWA
  29.  2020 REM *FX 19 : REM WAIT FOR NEXT SCAN LINE.
  30.  2030 MOVE AX%+1*SC,AY%+2*SC
  31.  2035
  32.  2040 REM DIM XY%(24,2)
  33.  2042 REM DIM XY%(23,1)
  34.  2045 REM DIM XY%(24)
  35.  2047 DIM XY%(48)
  36.  2050 :
  37.  2060 REM FOR I%=1 TO 48 STEP 2
  38.  2062 REM FOR I%=1 TO 23
  39.  2065 FOR I%=1 TO 48
  40.  2070   READ XY%(I%)
  41.  2080   IF I%MOD=0 THEN y% = XY%(I%) ELSE x% = XY%(I%) : REM IF EVEN Y ELSE X.
  42.  2090 :
  43.  2092   REM x% = XY%(I%) : REM X.
  44.  2095   REM y% = XY%(J%) : REM Y.
  45.  2100   REM DRAW x%,y%
  46.  2110   PRINT "X & Y = ";x%;",";y%
  47.  2120 NEXT I%
  48.  2130 ENDPROC
  49.  2140 :
  50.  2150 END
  51.  2160 :
  52.  2170 DATA AX%+1*SC,AY%+6*SC,AX%+3*SC,AY%+6*SC,AX%+3*SC,AY%+8*SC,AX%+5*SC,AY%+8*SC,AX%+5*SC,AY%+10*SC,AX%+7*SC,AY%+10*SC,AX%+7*SC,AY%+12*SC
  53.  2180 DATA AX%+9*SC,AY%+12*SC,AX%+9*SC,AY%+14*SC,AX%+11*SC,AY%+14*SC,AX%+11*SC,AY%+16*SC,AX%+15*SC,AY%+16*SC,AX%+15*SC,AY%+0*SC,AX%+13*SC,AY%+0*SC
  54.  2190 DATA AX%+13*SC,AY%+2*SC,AX%+11*SC,AY%+2*SC,AX%+11*SC,AY%+8*SC,AX%+9*SC,AY%+8*SC,AX%+9*SC,AY%+6*SC,AX%+7*SC,AY%+6*SC,AX%+7*SC,AY%+4*SC
  55.  2200 DATA AX%+5*SC,AY%+4*SC,AX%+5*SC,AY%+2*SC,AX%+1*SC,AY%+2*SC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement