Surz
Surz

Reputation: 1014

Printing a board in Commodore Basic 4.0?

I'm having trouble with printing a board of dots in Commodore Basic 6502.

This is what I have to far: (it's a subroutine)

10 INPUT "Please enter a number:", X
20 DIM A$(X, X)
30 FOR I = 0 TO X
40 FOR J = 0 TO X
50 A$(I, J) = "."
60 NEXT
70 NEXT
80 PRINT A$
END

Can anyone help me out with it because when I paste it into the emulator, type END, and press enter literally nothing happens?

Any help is much appreciated. I'm trying to build a word search game.

Upvotes: 12

Views: 197

Answers (3)

you don't have to instantiate the array A$:

10 rows=12
20 cols=10
30 gosub 1000
40 end
50 :
1000 for i=1 to rows
1010   for j=1 to cols
1020     print ".";
1030   next
1040   print
1060 next

run

Upvotes: 0

eoredson
eoredson

Reputation: 1165

Snip to fill an array with dots and print it:

10 INPUT "Please enter a number:", X
20 DIM A$(X, X)
21 REM make the array
30 FOR I = 0 TO X
    40 FOR J = 0 TO X
        50 A$(I, J) = "."
    60 NEXT
70 NEXT
80 REM print the array
90 FOR I = 0 TO X
    91 FOR J = 0 TO X
        92 PRINT A$(I, J);
    93 NEXT
    94 PRINT
95 NEXT
99 END

Upvotes: 0

clstrfsck
clstrfsck

Reputation: 14829

Just for laughs, here is some code that does what I think you want to do:

C64 screen shot

Just type RUN and hit enter!

Upvotes: 9

Related Questions