adventurous 0.3.0

A companion crate for solving Advent of Code puzzles.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// Returns the [Manhattan distance](https://en.wikipedia.org/wiki/Taxicab_geometry)
/// between two points.
pub fn manhattan_distance((a, b): (i32, i32), (c, d): (i32, i32)) -> i32 {
    (a - c).abs() + (b - d).abs()
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_manhattan_distance() {
        assert_eq!(manhattan_distance((0, 0), (2, 3)), 5)
    }
}