Clean up some more warnings

This commit is contained in:
Wesley Moore 2022-12-11 08:22:09 +10:00
parent 61559271c8
commit ca1892ceff
No known key found for this signature in database
2 changed files with 11 additions and 18 deletions

View file

@ -5,7 +5,6 @@ import gleam/list.{map}
import gleam/map.{Map}
import gleam/iterator
import gleam/string
import gleam/erlang/process
type Movement {
Movement(quantity: Int, from: Int, to: Int)
@ -132,18 +131,13 @@ fn top_of_stacks(
}
}
fn abort(msg: String) -> Nil {
io.println(msg)
process.kill(process.self())
}
fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) {
case i < map.size(stacks) {
True -> {
assert Ok(stack) = map.get(stacks, i)
io.println(int.to_string(i + 1) <> ": " <> string.join(stack, " "))
dump(stacks, i + 1)
}
False -> stacks
}
}
// fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) {
// case i < map.size(stacks) {
// True -> {
// assert Ok(stack) = map.get(stacks, i)
// io.println(int.to_string(i + 1) <> ": " <> string.join(stack, " "))
// dump(stacks, i + 1)
// }
// False -> stacks
// }
// }

View file

@ -1,4 +1,3 @@
import gleam/io.{debug}
import gleam/int
import gleam/iterator.{zip}
import gleam/string
@ -156,7 +155,7 @@ fn visible(
|> unwrap
{
other if other < tree -> visible(trees, coord, delta, tree, count + 1)
otherwise -> count + 1
_ -> count + 1
}
}
}