add 03
This commit is contained in:
@@ -6,3 +6,12 @@ pub fn read_file(filename: &str) -> Vec<String> {
|
||||
f.read_to_string(&mut buffer).unwrap();
|
||||
buffer.lines().map(|s| s.to_owned()).collect()
|
||||
}
|
||||
|
||||
pub fn read_grid(filename: &str) -> Vec<Vec<char>> {
|
||||
let result = read_file(filename)
|
||||
.into_iter()
|
||||
.map(|line| line.chars().collect())
|
||||
.collect();
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user