Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ secretHandshake.commands encodedMessage =
match and message 16 != 0 with
true -> cmds
false -> List.reverse cmds
[
(1, List.cons Wink),
(2, List.cons DoubleBlink),
(4, List.cons CloseYourEyes),
(8, List.cons Jump)

commands : [(Nat, [Command] ->{} [Command])]
commands = [
(1, acc -> List.cons Wink acc),
(2, acc -> List.cons DoubleBlink acc),
(4, acc -> List.cons CloseYourEyes acc),
(8, acc -> List.cons Jump acc)
]

commands
|> List.foldLeft collectCommand []
|> reverseOrNot encodedMessage