
i just want to store the starting square and the finish square, i dont want to store if it was a capture or a check, only store the moves.
Code: Select all
+----+----+----+----+----+----+----+----+
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
+----+----+----+----+----+----+----+----+
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
+----+----+----+----+----+----+----+----+
| 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
+----+----+----+----+----+----+----+----+
| 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
+----+----+----+----+----+----+----+----+
| 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
+----+----+----+----+----+----+----+----+
| 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
+----+----+----+----+----+----+----+----+
| 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
+----+----+----+----+----+----+----+----+
| 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
+----+----+----+----+----+----+----+----+
Code: Select all
X1 X2 X3 X4 X5 X6 X7 X8
+----+----+----+----+----+----+----+----+
Y1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
+----+----+----+----+----+----+----+----+
Y2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
+----+----+----+----+----+----+----+----+
Y3 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
+----+----+----+----+----+----+----+----+
Y4 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
+----+----+----+----+----+----+----+----+
Y5 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
+----+----+----+----+----+----+----+----+
Y6 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
+----+----+----+----+----+----+----+----+
Y7 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
+----+----+----+----+----+----+----+----+
Y8 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
+----+----+----+----+----+----+----+----+
$24 will be field 26.. $24 = split into $2# = XPos2 And $#4 = YPos 4
Code: Select all
X1 X2 X3 X4 X5 X6 X7 X8
+----+----+----+----+----+----+----+----+
Y1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 0
+----+----+----+----+----+----+----+----+
Y2 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 1
+----+----+----+----+----+----+----+----+
Y3 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 2
+----+----+----+----+----+----+----+----+
Y4 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 3
+----+----+----+----+----+----+----+----+
Y5 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 4
+----+----+----+----+----+----+----+----+
Y6 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 5
+----+----+----+----+----+----+----+----+
Y7 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 6
+----+----+----+----+----+----+----+----+
Y8 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | = 7
+----+----+----+----+----+----+----+----+
I dont understand youva!n wrote:
One idea could be, that each row has a value from 0 to 7... each line you can do shifts or something and calculate a result to store in a byte (for start and endpos...) thats very tricky and you must think very carefull about it... as long as you work with values from 0-7 it should be possible... good luck ^^
Code: Select all
Structure Moves
Lo.b
Mid.b
Hi.b
EndStructure
Code: Select all
Structure Moves
Lo.b
Mid.b
Hi.b
EndStructure
Define Move.moves
Define *LongPointer.l
Define ActRound.l
*LongPointer = @Move
ActRound = PeekL(*LongPointer)
WhiteStart = ( ActRound & %000000000000000000111111 )
WhiteFinish = ( ActRound & %000000000000111111000000 ) >> 6
BlackStart = ( ActRound & %000000111111000000000000 ) >> 12
BlackFinish = ( ActRound & %111111000000000000000000 ) >> 18
Code: Select all
StartPosX = Byte1 %00001111 ; 0 to 15
StartPosY = Byte1 %11110000
EndPosX = Byte2 %00001111
EndPosY = Byte2 %11110000
or just...
StartPosX = %0000000000001111 ; 0 to 15
StartPosY = %0000000011110000
EndPosX = %0000111100000000
EndPosY = %1111000000000000
Code: Select all
WhiteStartX = %000000000000000000000111
WhiteStartY = %000000000000000000111000
WhiteFinishX = %000000000000000111000000
WhiteFinishY = %000000000000111000000000
BlackStartX = %000000000111000000000000
BlackStartY = %000000111000000000000000
BlackFinishX = %000111000000000000000000
BlackFinishY = %111000000000000000000000
Code: Select all
each queen 28 (*2) = 56
each bishop 14 (*4) = 56
each tower 14 (*4) = 56
each knight 8 (*4) = 32
each king 8 (*2) = 16
each pawn 4 (*16) = 32
------
248