Sha256: 72c9032fced269d76d4186fbb59b3f3b5d039306669d159d371bee02316ce982

Contents?: true

Size: 855 Bytes

Versions: 9

Compression:

Stored size: 855 Bytes

Contents

#[derive(PartialEq, Eq, Debug)]
pub enum Bucket {
    One,
    Two,
}

/// A struct to hold your results in.
#[derive(PartialEq, Eq, Debug)]
pub struct BucketStats {
    /// The total number of "moves" it should take to reach the desired number of liters, including
    /// the first fill.
    pub moves: u8,
    /// Which bucket should end up with the desired number of liters? (Either "one" or "two")
    pub goal_bucket: Bucket,
    /// How many liters are left in the other bucket?
    pub other_bucket: u8,
}

/// Solve the bucket problem
pub fn solve(capacity_1: u8, capacity_2: u8, goal: u8, start_bucket: &Bucket) -> BucketStats {
    unimplemented!(
        "Given one bucket of capacity {}, another of capacity {}, starting with {:?}, find pours to reach {}",
        capacity_1,
        capacity_2,
        start_bucket,
        goal,
    );
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.179 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.178 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.177 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.176 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.175 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.174 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.173 tracks/rust/exercises/two-bucket/src/lib.rs
trackler-2.2.1.172 tracks/rust/exercises/two-bucket/src/lib.rs