Skip to content

Commit

Permalink
Add a null transition to the game state machine on a wrong guess
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmh committed Nov 27, 2020
1 parent 99f9e85 commit 93c31ff
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ transition State{stateData=oldData, stateValue=oldValue} input = case (oldData,
, stateValue = oldValue - takenOut
}
)
(Locked mph tn currentSecret, Guess theGuess nextSecret takenOut)
->
let constraints = Constraints.mustSpendValue (token mph tn) <> Constraints.mustForgeCurrency mph tn 0 in
Just ( constraints
, State
{ stateData = Locked mph tn currentSecret
, stateValue = oldValue
}
)
_ -> Nothing

{-# INLINABLE machine #-}
Expand Down

0 comments on commit 93c31ff

Please sign in to comment.