Add candidate selection.
This commit is contained in:
parent
207a0436d8
commit
8f6809c17f
3 changed files with 148 additions and 50 deletions
|
|
@ -84,13 +84,19 @@ impl Problem {
|
|||
}
|
||||
}
|
||||
|
||||
static COLORS: [Color; 6] = [
|
||||
static COLORS: [Color; 12] = [
|
||||
Color::Red,
|
||||
Color::Green,
|
||||
Color::Yellow,
|
||||
Color::Blue,
|
||||
Color::Magenta,
|
||||
Color::Cyan,
|
||||
Color::BrightRed,
|
||||
Color::BrightGreen,
|
||||
Color::BrightYellow,
|
||||
Color::BrightBlue,
|
||||
Color::BrightMagenta,
|
||||
Color::Cyan,
|
||||
];
|
||||
|
||||
impl Display for Problem {
|
||||
|
|
@ -277,6 +283,35 @@ pub mod problems {
|
|||
}
|
||||
|
||||
pub fn belt_madness_level_2() -> Problem {
|
||||
let mut p = Problem::new(17, 13);
|
||||
p.set_blocked(0, 3, true);
|
||||
|
||||
p.set_blocked_range(1, 2, 2, 5, true);
|
||||
p.set_blocked_range(1, 7, 2, 10, true);
|
||||
|
||||
p.set_blocked(0, 9, true);
|
||||
|
||||
p.set_blocked(16, 3, true);
|
||||
|
||||
p.set_blocked_range(14, 2, 15, 5, true);
|
||||
p.set_blocked_range(14, 7, 15, 10, true);
|
||||
|
||||
p.set_blocked(16, 9, true);
|
||||
|
||||
p.add_connection(Position::new(3, 4), Position::new(13, 2));
|
||||
p.add_connection(Position::new(3, 7), Position::new(13, 3));
|
||||
p.add_connection(Position::new(3, 10), Position::new(13, 4));
|
||||
p.add_connection(Position::new(3, 9), Position::new(13, 5));
|
||||
|
||||
p.add_connection(Position::new(3, 2), Position::new(13, 7));
|
||||
p.add_connection(Position::new(3, 3), Position::new(13, 8));
|
||||
p.add_connection(Position::new(3, 5), Position::new(13, 9));
|
||||
p.add_connection(Position::new(3, 8), Position::new(13, 10));
|
||||
|
||||
p
|
||||
}
|
||||
|
||||
pub fn belt_madness_level_3() -> Problem {
|
||||
let mut p = Problem::new(33, 13);
|
||||
|
||||
p.set_blocked_range(1, 3, 2, 5, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue