28 lines
747 B
Markdown
28 lines
747 B
Markdown
The fantastic game *The Talos Principle* has these two dimensional Tetris like
|
|
puzzles that I find annoying to solve. This program can solve them for me.
|
|
|
|
|
|
First, specify the field size and puzzle pieces:
|
|
|
|
```rust
|
|
fn main() {
|
|
let field = Field::new(5, 5);
|
|
let pieces = vec![
|
|
// Piece::cleveland_z(), // -_
|
|
// Piece::rhode_island_z(), // _-
|
|
// Piece::teewee(),
|
|
// Piece::hero(),
|
|
// Piece::orange_ricky(), // ___|
|
|
// Piece::blue_ricky(), // |___
|
|
// Piece::smashboy(),
|
|
];
|
|
let result = solve(field, pieces);
|
|
match result {
|
|
Some(field) => println!("{}", field),
|
|
None => println!("No solution",)
|
|
};
|
|
}
|
|
```
|
|
|
|
Then, get the solution with `cargo run --release`.
|