I have this program (a test program for a library).
Code: Select all
dim as any ptr library = dylibload("mater")
if library = 0 then
print "Failed to load the dynamic library, aborting program..."
end 1
end if
dim SolveMate as function ( _
byval as const zstring ptr, _
byval as const integer, _
byval as const integer _
) as zstring ptr
SolveMate = dylibsymbol(library, "SolveMate")
if SolveMate = 0 then
print "Could not retrieve the function's address, aborting program..."
end 1
end if
const SEARCH_ALL_MOVES = 1
const SEARCH_CHECK_ONLY = 0
print("b7a8n" = *SolveMate("b7/PP6/8/8/7K/6B1/6N1/4R1bk w KQkq -", 3, SEARCH_ALL_MOVES))
print("h6c1" = *SolveMate("8/8/1p5B/4p3/1p2k1P1/1P3n2/P4PB1/K2R4 w KQkq -", 3, SEARCH_ALL_MOVES))
print("d6c7" = *SolveMate("2N5/8/k2K4/8/p1PB4/P7/8/8 w KQkq -", 4, SEARCH_ALL_MOVES))
print("g5g2" = *SolveMate("rnbK2R1/p6p/p1kNpN1r/P3B1Q1/3P1p1p/5p2/5p1b/8 w KQkq -", 4, SEARCH_ALL_MOVES))
print("h7g7" = *SolveMate("8/1n2P2K/3p2p1/2p3pk/6pr/4ppr1/6p1/1b6 w KQkq -", 3, SEARCH_ALL_MOVES))
print("b7b8r" = *SolveMate("4K1R1/PP2P3/2k5/3pP3/3B4/6P1/8/8 w KQkq -", 3, SEARCH_ALL_MOVES))
print("e7e8b" = *SolveMate("8/2P1P1P1/3PkP2/8/4K3/8/8/8 w Qkq -", 3, SEARCH_ALL_MOVES))
print("h3g5" = *SolveMate("3nn3/2p2p1k/1p1pp1p1/p2B3p/r2B2N1/7N/8/7K w KQkq -", 12, SEARCH_CHECK_ONLY))
dylibfree(library)
Code: Select all
-1
-1
-1
-1
-1
-1
-1
-1
Code: Select all
-1
-1
-1
-1
-1
-1
-1
-1
00000000 2D 31 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 -1..............
00000010 20 20 2D 31 0D 0A 20 20 20 20 20 20 20 20 20 20 ..-1............
00000020 20 20 20 20 2D 31 0D 0A 2D 31 0D 0A 2D 31 0D 0A ....-1..-1..-1..
00000030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2D 31 ..............-1
00000040 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ................
00000050 2D 31 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 -1..............
00000060 20 20 2D 31 0D 0A ..-1..
Any idea of what happens? Why those extra spaces?
I tried with FBC 1.08 and FBC 1.09 (both for 32-bit): same result.
FYI, the program comes from this project: https://gitlab.com/rchastain/mater-library