Skip to content

Discussion on Game implementation #19

@nadinengland

Description

@nadinengland

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions