We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quick question (not sure if appropriate to ask) - I am trying to use this from a C# program (64bit)
the output from getBestMove seems to always be -1
i have declared below - [DllImport("2048.dll", CallingConvention = CallingConvention.Cdecl)] private static extern int find_best_move(UInt64 board);
I have also simulated your toCBoard function by converting a grid into a ulong
public static ulong ToCBoard(Grid m) { ulong board = 0; int i = 0; ulong t = 0;
for (int row = 0; row < 4; row++) { for (int col = 0; col < 4; col++) { t = (ulong) m.Cells[col, row]; board |= t << (4 * i); i++; } } return board; }
Calling this by: ulong t = ToCBoard(gameBoard); bestMove = find_best_move(t);
Any ideas?
The text was updated successfully, but these errors were encountered:
Did you call init_tables first?
init_tables
Sorry, something went wrong.
No branches or pull requests
Quick question (not sure if appropriate to ask) - I am trying to use this from a C# program (64bit)
the output from getBestMove seems to always be -1
i have declared below -
[DllImport("2048.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int find_best_move(UInt64 board);
I have also simulated your toCBoard function by converting a grid into a ulong
public static ulong ToCBoard(Grid m)
{
ulong board = 0;
int i = 0;
ulong t = 0;
Calling this by:
ulong t = ToCBoard(gameBoard);
bestMove = find_best_move(t);
Any ideas?
The text was updated successfully, but these errors were encountered: