https://github.com/juliareinforcementlearning/hanabi.jl
https://github.com/juliareinforcementlearning/hanabi.jl
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/juliareinforcementlearning/hanabi.jl
- Owner: JuliaReinforcementLearning
- Created: 2019-03-19T12:09:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-16T13:25:53.000Z (about 4 years ago)
- Last Synced: 2025-03-10T18:14:51.794Z (4 months ago)
- Language: Julia
- Size: 68.4 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hanabi.jl
This package provides a Julia wrapper for the game [deepmind/hanabi-learning-environment](https://github.com/deepmind/hanabi-learning-environment) with [Clang.jl](https://github.com/JuliaInterop/Clang.jl)
## Install
```julia
pkg> add Hanabi
```## Usage
All the APIs should be the same with those listed [here](https://github.com/findmyway/hanabi-learning-environment/blob/master/pyhanabi.h) with renaming.
- `CamelFunctionName` -> `camel_function_name`
- `PyStructName` -> `StructName`## Example
```julia
game = Ref{HanabiGame}()
new_default_game(game)
observation = Ref{HanabiObservation}()
state = Ref{HanabiState}()
new_state(game, state)
observation = Ref{HanabiObservation}()
new_observation(state, 0, observation)
unsafe_string(obs_to_string(observation))
# Life tokens: 3
# Info tokens: 8
# Fireworks: R0 Y0 G0 W0 B0
# Hands:
# -----
# Deck size: 50
# Discards:
```You may also check some high level APIs in [ReinforcementLearningEnvironments.jl](https://github.com/JuliaReinforcementLearning/ReinforcementLearningEnvironments.jl)
## Play Game Interactively
Check out [src/service.jl](https://github.com/JuliaReinforcementLearning/Hanabi.jl/blob/master/src/service.jl) to see how to play Hanabi interactively.
