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/map.{Map}
import gleam/iterator import gleam/iterator
import gleam/string import gleam/string
import gleam/erlang/process
type Movement { type Movement {
Movement(quantity: Int, from: Int, to: Int) Movement(quantity: Int, from: Int, to: Int)
@ -132,18 +131,13 @@ fn top_of_stacks(
} }
} }
fn abort(msg: String) -> Nil { // fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) {
io.println(msg) // case i < map.size(stacks) {
process.kill(process.self()) // True -> {
} // assert Ok(stack) = map.get(stacks, i)
// io.println(int.to_string(i + 1) <> ": " <> string.join(stack, " "))
fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) { // dump(stacks, i + 1)
case i < map.size(stacks) { // }
True -> { // False -> stacks
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/int
import gleam/iterator.{zip} import gleam/iterator.{zip}
import gleam/string import gleam/string
@ -156,7 +155,7 @@ fn visible(
|> unwrap |> unwrap
{ {
other if other < tree -> visible(trees, coord, delta, tree, count + 1) other if other < tree -> visible(trees, coord, delta, tree, count + 1)
otherwise -> count + 1 _ -> count + 1
} }
} }
} }