'This program creates a 6x10 grid of numbers with the word DATA
'in front of each line. The program then saves the 6x10 grid to
'a file called map_test.bi. The reason for this test program is
'so that I can later build a graphical editor for tile based games.
'The games will use READ/DATA statements and the DATA in a READ/
'DATA statement can't be changed. That lead to creating this pro-
'gram. The exported file can be added to the game project and
'the user will not have to type large DATA statements; instead,
'with the graphical interface they will be able to layout color
'squarse using the mouse in the grid. Example: A green squre will
'be for grass...ie., etc.
'
'By: Abacus 5/8/2021
'declare some arrays
'this will be used to place the word DATA in front
'loading the arrays with numerical valuse for the grid
a1$(1) = "1": a2$(1) = "2": a3$(1) = "0": a4$(1) = "0": a5$(1) = "0": a6$(1) = "0":
a1$(2) = "0": a2$(2) = "0": a3$(2) = "3": a4$(2) = "0": a5$(2) = "0": a6$(2) = "1":
a1$(3) = "1": a2$(3) = "0": a3$(3) = "0": a4$(3) = "0": a5$(3) = "0": a6$(3) = "0":
a1$(4) = "0": a2$(4) = "0": a3$(4) = "0": a4$(4) = "0": a5$(4) = "0": a6$(4) = "0":
a1$(5) = "0": a2$(5) = "0": a3$(5) = "0": a4$(5) = "0": a5$(5) = "0": a6$(5) = "2":
a1$(6) = "0": a2$(6) = "0": a3$(6) = "0": a4$(6) = "5": a5$(6) = "0": a6$(6) = "0":
a1$(7) = "0": a2$(7) = "0": a3$(7) = "0": a4$(7) = "0": a5$(7) = "0": a6$(7) = "0":
a1$(8) = "0": a2$(8) = "0": a3$(8) = "0": a4$(8) = "0": a5$(8) = "0": a6$(8) = "0":
a1$(9) = "0": a2$(9) = "0": a3$(9) = "0": a4$(9) = "0": a5$(9) = "0": a6$(9) = "0":
a1$(10) = "0": a2$(10) = "0": a3$(10) = "0": a4$(10) = "0": a5$(10) = "0": a6$(10) = "0":
'explains what the program is doing
Print " This program displays a 6x10 grid of DATA statments and" Print " will write this information to a file named map_test.bi" Print " Hit the Spcaebar to start." 'wait for keypress
'a loop to print all the numbers out correctly in the grid format
Print name$;
" "; a1$
(clr
);
","; a2$
(clr
);
","; a3$
(clr
);
",";
Print a4$
(clr
);
","; a5$
(clr
);
","; a6$
(clr
)
'tells that the file is being saved
Print "Saving to file..."
'open a file for output
'a loop to save the grid to a file in the correct format
Print #1, name$;
" "; a1$
(clr
);
","; a2$
(clr
);
","; a3$
(clr
);
",";
Print #1, a4$
(clr
);
","; a5$
(clr
);
","; a6$
(clr
)
'close file
'tells that the file is saved
'end of program