efly2020
26-10-2008, 18:02
Please help.
I can not find what is wrong with this data file which produces an error.
----------------------------------------------------------------------------------
' data.inc
' pieces are pictured flipped horizontally
%pieces_max = 7 ' to what is used in the game
%segments_max = 4
%coords_max = 2
dim pieces_data(%coords_max, %segments_max, %pieces_max) as long
Array Assign pieces_data = _
_
0, 0 , 1, 0 , 0,-1 , 1,-1 , _ ' 00 1
_ ' 00
-2, 0 , -1, 0 , 0, 0 , 1, 0 , _ ' 0000 2
-1, 0 , 0, 0 , 1, 0 , 0,-1 , _ ' 000 3
_ ' 0
-1, 0 , 0, 0 , 0,-1 , 1,-1 , _ ' 00 4
_ ' 00
0, 0 , 1, 0 , -1,-1 , 0,-1 , _ ' 00 5
_ ' 00
-1, 0 , 0, 0 , 1, 0 , 1,-1 , _ ' 000 6
_ ' 0
-1, 0 , 0, 0 , 1, 0 , -1,-1 ' 000 7
' 0
dim extra_data(%segments_max, %pieces_max) as long
Array Assign extra_data = _
_
0, 0, 0, 0, _ ' 1
0, 0, 0, 0, _ ' 2
0, 0 0, 0, _ ' 3
0, 0, 0, 0, _ ' 4
0, 0, 0, 0, _ ' 5
0, 0, 0, 0, _ ' 6
0, 0, 0, 0 ' 7
----------------------------------------------------------------------------------
' produces runtime error - Unknown Keyword, Token: extra_data
USES "Console"
#INCLUDE once "data.inc"
dim jk, jr as long
Console_WriteLine
for jk = 1 to %pieces_max
for jr = 1 to %segments_max
Console_Write FORMAT$(pieces_data(1, jr, jk)," 0; 0"),",", _
FORMAT$(pieces_data(2, jr, jk)," 0; 0")," "
next
Console_WriteLine
next
Console_WriteLine
for jk = 1 to %pieces_max
for jr = 1 to %segments_max
Console_Write FORMAT$(extra_data(jr, jk),"0"),", "
next
Console_WriteLine
next
Console_WriteLine
Console_WaitKey
I can not find what is wrong with this data file which produces an error.
----------------------------------------------------------------------------------
' data.inc
' pieces are pictured flipped horizontally
%pieces_max = 7 ' to what is used in the game
%segments_max = 4
%coords_max = 2
dim pieces_data(%coords_max, %segments_max, %pieces_max) as long
Array Assign pieces_data = _
_
0, 0 , 1, 0 , 0,-1 , 1,-1 , _ ' 00 1
_ ' 00
-2, 0 , -1, 0 , 0, 0 , 1, 0 , _ ' 0000 2
-1, 0 , 0, 0 , 1, 0 , 0,-1 , _ ' 000 3
_ ' 0
-1, 0 , 0, 0 , 0,-1 , 1,-1 , _ ' 00 4
_ ' 00
0, 0 , 1, 0 , -1,-1 , 0,-1 , _ ' 00 5
_ ' 00
-1, 0 , 0, 0 , 1, 0 , 1,-1 , _ ' 000 6
_ ' 0
-1, 0 , 0, 0 , 1, 0 , -1,-1 ' 000 7
' 0
dim extra_data(%segments_max, %pieces_max) as long
Array Assign extra_data = _
_
0, 0, 0, 0, _ ' 1
0, 0, 0, 0, _ ' 2
0, 0 0, 0, _ ' 3
0, 0, 0, 0, _ ' 4
0, 0, 0, 0, _ ' 5
0, 0, 0, 0, _ ' 6
0, 0, 0, 0 ' 7
----------------------------------------------------------------------------------
' produces runtime error - Unknown Keyword, Token: extra_data
USES "Console"
#INCLUDE once "data.inc"
dim jk, jr as long
Console_WriteLine
for jk = 1 to %pieces_max
for jr = 1 to %segments_max
Console_Write FORMAT$(pieces_data(1, jr, jk)," 0; 0"),",", _
FORMAT$(pieces_data(2, jr, jk)," 0; 0")," "
next
Console_WriteLine
next
Console_WriteLine
for jk = 1 to %pieces_max
for jr = 1 to %segments_max
Console_Write FORMAT$(extra_data(jr, jk),"0"),", "
next
Console_WriteLine
next
Console_WriteLine
Console_WaitKey