Skip to content
New issue

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

Discussion on Game implementation #19

Open
nadinengland opened this issue Sep 8, 2017 · 0 comments
Open

Discussion on Game implementation #19

nadinengland opened this issue Sep 8, 2017 · 0 comments

Comments

@nadinengland
Copy link
Contributor

My personal preference for the game would be an immutable interface that returns the next state of the game, see pseudo code:

let first_turn = Game::new()
match first_turn.place_next([0, 0], TileOrientation::Up) {
    Ok(second_turn) => { ... }
    Err(PlacementError::NotAdjacent)) => { ... }
    Err(PlacementError::TileAlreadyAtCoordinate)) => { ... }
}

The underlying states could then be represented by creating new games that use Persistent Date Structures. From a cursory glance, this page seems like what we would be after: https://github.com/reem/adamantium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant