Struct tfe::Moves [−][src]
pub struct Moves { pub left: Vec<u64>, pub right: Vec<u64>, pub down: Vec<u64>, pub up: Vec<u64>, pub scores: Vec<u64>, }
Struct that contains all available moves per row for up, down, right and left. Also stores the score for a given row.
Moves are stored as power values for tiles.
if a power value is > 0
, print the tile value using 2 << tile
where tile is any 4-bit
"nybble" otherwise print a 0
instead.
Fields
left: Vec<u64>
right: Vec<u64>
down: Vec<u64>
up: Vec<u64>
scores: Vec<u64>
Methods
impl Moves
[src]
impl Moves
pub fn generate() -> Self
[src]
pub fn generate() -> Self
Constructs a new tfe::Moves
.
Moves
stores right
, left
, up
, and down
moves per row.
e.g. left: 0x0011 -> 0x2000
and right: 0x0011 -> 0x0002
.
Also stores the scores
per row.
The score of a row is the sum of the tile and all intermediate tile merges.
e.g. row 0x0002
has a score of 4
and row 0x0003
has a score of 16
.