Struct pack_2048::Game[][src]

pub struct Game {
    pub board: [[usize; 4]; 4],
    pub score: usize,
}

Fields

Methods

impl Game
[src]

Generates a tile in a random empty cell of the provided board.

There is a 90% chance that a 2 tile is generated, and a 10% chance for a 4 tile.

Returns a text render of the board. Each column is dynamically sized to the number of digits in its largest member.

Handles a standard move and writes the result to the provided board.

Returns true if no valid moves are available.

Creates a new game state.

Trait Implementations

impl Default for Game
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Game

impl Sync for Game