Module board

Source

Structs§

Bag
An implementation of the 7-bag randomizer. Pieces are drawn from a bag of 7 pieces, and when the bag is empty, a new bag is created and shuffled.
Board
The board is represented as a 2D array of u8, where PieceColor::Empty is an empty cell and any other value is a piece.
CurrentPiece
The current piece in the game, that is, a piece that is currently being moved by the player and has not been committed to the board yet.

Functions§

clear_lines
Clears any lines that are full and moves the lines above down.
draw_piece
Draws the piece on the board.
draw_tracer
Draws the tracer piece on the board.
remove_piece
Removes the piece from the board.
remove_tracer
Removes the tracer from the board.