This commit is contained in:
nora 2023-01-15 15:42:44 +01:00
parent 9c749f1ae9
commit e693534bb9

View file

@ -1,5 +1,7 @@
# Minmax in Rust with JNI # Minmax in Rust with JNI
The `isWinning` method always requires Rust and calls it via JNI. For the perfect player, there are two implementations. `PerfectPlayer` which is a small alpha-beta in Java and `RustPlayer` which uses the better Rust implementation via JNI. If you can be bothered to set up `RustPlayer` then use it, if you can't then `PerfectPlayer` is fine too.
## How to build and run ## How to build and run
### On Linux ### On Linux
@ -18,4 +20,8 @@ It should probably the same as linux? except for the `cp` part apples native lib
### On Windows ### On Windows
on windows it only works if you are in this directory, but then it does Just Work after the rust build.
If you want to move this player to another location on windows, you have to delete the `if (System.getProperty("os.name").toLowerCase().contains("windows"))` check and always run the not-windows path.
you're on your own but you can do this, it's similar to linux except you have to run `cargo build --release` yourself and have to `target/release/minmax_wrapper.dll` to the directories where the other library are (the link error message will tell you where that is) you're on your own but you can do this, it's similar to linux except you have to run `cargo build --release` yourself and have to `target/release/minmax_wrapper.dll` to the directories where the other library are (the link error message will tell you where that is)