Skip to content

Commit

Permalink
remove nat
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacvando committed Mar 18, 2024
1 parent ee6d3e7 commit abd5c0d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.roc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Program : {

Model : {
roll : Roll,
focused : Result (Nat, Nat) [MouseNotInCell],
focused : Result (U64, U64) [MouseNotInCell],
frame : U16,
sinceLastBeat : U16,
interval : U16,
Expand Down Expand Up @@ -119,13 +119,13 @@ step = \model, mouse, gamepad ->
rightDown: gamepad.right,
}

getCurrentColumn : Model, Nat -> List Cell
getCurrentColumn : Model, U64 -> List Cell
getCurrentColumn = \model, index ->
model.roll
|> List.map \row ->
List.get row index |> unwrap

getCellIndex : Mouse -> Result (Nat, Nat) [MouseNotInCell]
getCellIndex : Mouse -> Result (U64, U64) [MouseNotInCell]
getCellIndex = \mouse ->
yIndex =
List.range { start: At 0, end: At (rows - 1) }
Expand All @@ -143,7 +143,7 @@ getCellIndex = \mouse ->
(Ok x, Ok y) -> Ok (x, y)
_ -> Err MouseNotInCell

updateCell : Roll, (Nat, Nat), (Cell -> Cell) -> List Row
updateCell : Roll, (U64, U64), (Cell -> Cell) -> List Row
updateCell = \roll, (x, y), f ->
row <- List.update roll y
cell <- List.update row x
Expand Down Expand Up @@ -250,7 +250,7 @@ colors = {
playSounds : Model -> Task {} []
playSounds = \model ->
if model.sinceLastBeat == 0 then
getCurrentColumn model (Num.toNat model.currentBeat)
getCurrentColumn model (Num.toU64 model.currentBeat)
|> playColumn
else
Task.ok {}
Expand Down

0 comments on commit abd5c0d

Please sign in to comment.