Skip to content

Commit

Permalink
Fix small mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
jojolebarjos committed Feb 11, 2024
1 parent 44a5809 commit 1c51bac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Board game simulator (Python bindings)

This Python module offers a framework for simulating a variety of board games, including Connect4 and Chinese Checkers.
It is based on [this sister project](https://github.com/jojolebarjos/board-game-simulator], providing an efficient implementation tailored for reinforcement learning applications.
It is based on [this sister project](https://github.com/jojolebarjos/board-game-simulator), providing an efficient implementation tailored for reinforcement learning applications.

The library introduces a unified representation of games via states and actions.
In each state, the current player chooses an action from a set of legal moves, resulting in a transition to a new state.
Expand Down
2 changes: 1 addition & 1 deletion src/game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ T&& unlock(T&& t) {
template <typename _Traits>
struct Game {

using Traits = typename _Traits;
using Traits = _Traits;
using State = Traits::State;
using Action = Traits::Action;

Expand Down
15 changes: 15 additions & 0 deletions src/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,31 @@ Object to_object(bool value) noexcept {
}


Object to_object(long value) noexcept {
return PyLong_FromLong(value);
}


Object to_object(long long value) noexcept {
return PyLong_FromLongLong(value);
}


Object to_object(unsigned long value) noexcept {
return PyLong_FromUnsignedLong(value);
}


Object to_object(unsigned long long value) noexcept {
return PyLong_FromUnsignedLongLong(value);
}


Object to_object(float value) noexcept {
return PyFloat_FromDouble(value);
}


Object to_object(double value) noexcept {
return PyFloat_FromDouble(value);
}
Expand Down

0 comments on commit 1c51bac

Please sign in to comment.