fn provide_cases(token: &str) -> Vec<Case> {
        let simple = vec![
            Case(
                0,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 5.0],
            ),
            Case(
                1,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.0, 5.0, 2.0, 2.0, 2.0, 2.0, 5.0, 5.0],
            ),
            Case(
                2,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0],
            ),
        ];
        let saturation = vec![
            // at saturation
            Case(1, vec![2, 0, 0, 2], vec![2.0, 2.0, 2.0, 2.0]),
            Case(
                2,
                vec![4, 4, 0, 0, 0, 0, 4, 4],
                vec![4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0],
            ),
            // above saturation
            Case(
                3,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5],
            ),
        ];
        let general = vec![
            Case(
                1,
                vec![5, 4, 3, 0, 0, 0],
                vec![5.0, 4.0, 3.0, 2.0, 2.0, 2.0],
            ),
            Case(
                1,
                vec![0, 0, 0, 3, 4, 5],
                vec![2.0, 2.0, 2.0, 3.0, 4.0, 5.0],
            ),
            Case(2, vec![7, 6, 5, 0, 0], vec![7.0, 6.0, 5.0, 5.0, 5.0]),
            Case(2, vec![0, 0, 5, 6, 7], vec![5.0, 5.0, 5.0, 6.0, 7.0]),
            Case(
                1,
                vec![3, 1, 6, 4, 8, 9],
                vec![4.0, 4.0, 6.0, 6.0, 8.0, 9.0],
            ),
            Case(
                2,
                vec![3, 1, 6, 4, 8, 9],
                vec![6.5, 6.5, 6.5, 6.5, 8.0, 9.0],
            ),
            Case(1, vec![1, 8, 8, 8, 1], vec![3.5, 8.0, 8.0, 8.0, 3.5]),
            Case(
                1,
                vec![1, 2, 3, 4, 5, 6, 7, 8, 9],
                vec![4.75, 4.75, 4.75, 4.75, 5.0, 6.0, 7.0, 8.0, 9.0],
            ),
            Case(
                1,
                vec![3, 1, 6, 4, 8, 9],
                vec![4.0, 4.0, 6.0, 6.0, 8.0, 9.0],
            ),
            Case(
                2,
                vec![0, 5, 0, 5, 0, 5, 0],
                vec![3.0, 5.0, 4.0, 5.0, 4.0, 5.0, 3.0],
            ),
            Case(
                2,
                vec![0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0],
                vec![
                    3.0, 5.0, 4.0, 5.0, 4.0, 5.0, 4.0, 5.0, 4.0, 5.0, 4.0, 5.0, 3.0,
                ],
            ),
        ];
        let watersheds = vec![
            Case(1, vec![0, 3, 0], vec![1.5, 3.0, 1.5]),
            Case(1, vec![0, 3, 3, 0], vec![2.0, 3.0, 3.0, 2.0]),
            Case(
                1,
                vec![6, 0, 4, 4, 0, 6],
                vec![6.0, 3.0, 4.0, 4.0, 3.0, 6.0],
            ),
            Case(1, vec![0, 3, 4, 3, 0], vec![2.5, 3.0, 4.0, 3.0, 2.5]),
            Case(
                1,
                vec![0, 0, 3, 2, 3, 1, 1],
                vec![1.5, 1.5, 3.0, 3.0, 3.0, 2.5, 2.5],
            ),
            Case(1, vec![8, 1, 8, 8, 1], vec![8.0, 4.0, 8.0, 8.0, 3.0]),
        ];
        // these tests fail spectacularly!
        let known_bugs = vec![];

        if token == "simple" {
            return simple;
        }
        if token == "saturation" {
            return saturation;
        }
        if token == "known_bugs" {
            return known_bugs;
        }
        if token == "all" {
            return [general.as_slice(), watersheds.as_slice()].concat();
        }
        return vec![];
    }
// simple test cases, pen-and-paper results
simple test cases, pen-and-paper results
simple test cases pen - and - paper results
fn provide_cases(token: &str) -> Vec<Case> {
        let simple = vec![
            Case(
                0,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 5.0],
            ),
            Case(
                1,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.0, 5.0, 2.0, 2.0, 2.0, 2.0, 5.0, 5.0],
            ),
            Case(
                2,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0],
            ),
        ];
        let saturation = vec![
            // at saturation
            Case(1, vec![2, 0, 0, 2], vec![2.0, 2.0, 2.0, 2.0]),
            Case(
                2,
                vec![4, 4, 0, 0, 0, 0, 4, 4],
                vec![4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0],
            ),
            // above saturation
            Case(
                3,
                vec![5, 5, 0, 0, 0, 0, 5, 5],
                vec![5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5],
            ),
        ];
        let general = vec![
            Case(
                1,
                vec![5, 4, 3, 0, 0, 0],
                vec![5.0, 4.0, 3.0, 2.0, 2.0, 2.0],
            ),
            Case(
                1,
                vec![0, 0, 0, 3, 4, 5],
                vec![2.0, 2.0, 2.0, 3.0, 4.0, 5.0],
            ),
            Case(2, vec![7, 6, 5, 0, 0], vec![7.0, 6.0, 5.0, 5.0, 5.0]),
            Case(2, vec![0, 0, 5, 6, 7], vec![5.0, 5.0, 5.0, 6.0, 7.0]),
            Case(
                1,
                vec![3, 1, 6, 4, 8, 9],
                vec![4.0, 4.0, 6.0, 6.0, 8.0, 9.0],
            ),
            Case(
                2,
                vec![3, 1, 6, 4, 8, 9],
                vec![6.5, 6.5, 6.5, 6.5, 8.0, 9.0],
            ),
            Case(1, vec![1, 8, 8, 8, 1], vec![3.5, 8.0, 8.0, 8.0, 3.5]),
            Case(
                1,
                vec![1, 2, 3, 4, 5, 6, 7, 8, 9],
                vec![4.75, 4.75, 4.75, 4.75, 5.0, 6.0, 7.0, 8.0, 9.0],
            ),
            Case(
                1,
                vec![3, 1, 6, 4, 8, 9],
                vec![4.0, 4.0, 6.0, 6.0, 8.0, 9.0],
            ),
            Case(
                2,
                vec![0, 5, 0, 5, 0, 5, 0],
                vec![3.0, 5.0, 4.0, 5.0, 4.0, 5.0, 3.0],
            ),
            Case(
                2,
                vec![0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0],
                vec![
                    3.0, 5.0, 4.0, 5.0, 4.0, 5.0, 4.0, 5.0, 4.0, 5.0, 4.0, 5.0, 3.0,
                ],
            ),
        ];
        let watersheds = vec![
            Case(1, vec![0, 3, 0], vec![1.5, 3.0, 1.5]),
            Case(1, vec![0, 3, 3, 0], vec![2.0, 3.0, 3.0, 2.0]),
            Case(
                1,
                vec![6, 0, 4, 4, 0, 6],
                vec![6.0, 3.0, 4.0, 4.0, 3.0, 6.0],
            ),
            Case(1, vec![0, 3, 4, 3, 0], vec![2.5, 3.0, 4.0, 3.0, 2.5]),
            Case(
                1,
                vec![0, 0, 3, 2, 3, 1, 1],
                vec![1.5, 1.5, 3.0, 3.0, 3.0, 2.5, 2.5],
            ),
            Case(1, vec![8, 1, 8, 8, 1], vec![8.0, 4.0, 8.0, 8.0, 3.0]),
        ];
        // these tests fail spectacularly!
        let known_bugs = vec![];
        if token == "simple" {
            return simple;
        }
        if token == "saturation" {
            return saturation;
        }
        if token == "known_bugs" {
            return known_bugs;
        }
        if token == "all" {
            return [general.as_slice(), watersheds.as_slice()].concat();
        }
        return vec![];
    }
fn provide_cases ( token : & str ) -> Vec < Case > { let simple = vec ! [ Case ( 0 vec [ 5 5 0 0 0 0 5 5 ] vec [ 5.0 5.0 0.0 0.0 0.0 0.0 5.0 5.0 ] ) Case ( 1 vec [ 5 5 0 0 0 0 5 5 ] vec [ 5.0 5.0 2.0 2.0 2.0 2.0 5.0 5.0 ] ) Case ( 2 vec [ 5 5 0 0 0 0 5 5 ] vec [ 5.0 5.0 4.0 4.0 4.0 4.0 5.0 5.0 ] ) ] ; let saturation = vec ! [ // at saturation Case ( 1 vec [ 2 0 0 2 ] vec [ 2.0 2.0 2.0 2.0 ] ) Case ( 2 vec [ 4 4 0 0 0 0 4 4 ] vec [ 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 ] ) // above saturation Case ( 3 vec [ 5 5 0 0 0 0 5 5 ] vec [ 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 ] ) ] ; let general = vec ! [ Case ( 1 vec [ 5 4 3 0 0 0 ] vec [ 5.0 4.0 3.0 2.0 2.0 2.0 ] ) Case ( 1 vec [ 0 0 0 3 4 5 ] vec [ 2.0 2.0 2.0 3.0 4.0 5.0 ] ) Case ( 2 vec [ 7 6 5 0 0 ] vec [ 7.0 6.0 5.0 5.0 5.0 ] ) Case ( 2 vec [ 0 0 5 6 7 ] vec [ 5.0 5.0 5.0 6.0 7.0 ] ) Case ( 1 vec [ 3 1 6 4 8 9 ] vec [ 4.0 4.0 6.0 6.0 8.0 9.0 ] ) Case ( 2 vec [ 3 1 6 4 8 9 ] vec [ 6.5 6.5 6.5 6.5 8.0 9.0 ] ) Case ( 1 vec [ 1 8 8 8 1 ] vec [ 3.5 8.0 8.0 8.0 3.5 ] ) Case ( 1 vec [ 1 2 3 4 5 6 7 8 9 ] vec [ 4.75 4.75 4.75 4.75 5.0 6.0 7.0 8.0 9.0 ] ) Case ( 1 vec [ 3 1 6 4 8 9 ] vec [ 4.0 4.0 6.0 6.0 8.0 9.0 ] ) Case ( 2 vec [ 0 5 0 5 0 5 0 ] vec [ 3.0 5.0 4.0 5.0 4.0 5.0 3.0 ] ) Case ( 2 vec [ 0 5 0 5 0 5 0 5 0 5 0 5 0 ] vec [ 3.0 5.0 4.0 5.0 4.0 5.0 4.0 5.0 4.0 5.0 4.0 5.0 3.0 ] ) ] ; let watersheds = vec ! [ Case ( 1 vec [ 0 3 0 ] vec [ 1.5 3.0 1.5 ] ) Case ( 1 vec [ 0 3 3 0 ] vec [ 2.0 3.0 3.0 2.0 ] ) Case ( 1 vec [ 6 0 4 4 0 6 ] vec [ 6.0 3.0 4.0 4.0 3.0 6.0 ] ) Case ( 1 vec [ 0 3 4 3 0 ] vec [ 2.5 3.0 4.0 3.0 2.5 ] ) Case ( 1 vec [ 0 0 3 2 3 1 1 ] vec [ 1.5 1.5 3.0 3.0 3.0 2.5 2.5 ] ) Case ( 1 vec [ 8 1 8 8 1 ] vec [ 8.0 4.0 8.0 8.0 3.0 ] ) ] ; // these tests fail spectacularly! let known_bugs = vec ! [ ] ; if token == " " { return simple ; } if token == " " { return saturation ; } if token == " " { return known_bugs ; } if token == " " { return [ general . as_slice ( ) , watersheds . as_slice ( ) ] . concat ( ) ; } return vec ! [ ] ; }
simple test cases, pen-and-paper results
simple test cases pen - and - paper results
token
&str
token
&str