int/bool instructions
This commit is contained in:
parent
5fb5ea9d7d
commit
40797972f3
@ -4,6 +4,14 @@ import State
|
|||||||
import Instructions.GenericInstructions
|
import Instructions.GenericInstructions
|
||||||
-- import Debug.Trace
|
-- import Debug.Trace
|
||||||
|
|
||||||
|
instructionIntFromFloat :: State -> State
|
||||||
|
instructionIntFromFloat state@(State {_float = (f : fs), _int = is}) = state {_float = fs, _int = floor f : is}
|
||||||
|
instructionIntFromFloat state = state
|
||||||
|
|
||||||
|
instructionIntFromBool :: State -> State
|
||||||
|
instructionIntFromBool state@(State {_bool = (b : bs), _int = is}) = state {_bool = bs, _int = (if b then 1 else 0) : is}
|
||||||
|
instructionIntFromBool state = state
|
||||||
|
|
||||||
instructionIntAdd :: State -> State
|
instructionIntAdd :: State -> State
|
||||||
instructionIntAdd state@(State {_int = (i1 : i2 : is)}) = state {_int = i2 + i1 : is}
|
instructionIntAdd state@(State {_int = (i1 : i2 : is)}) = state {_int = i2 + i1 : is}
|
||||||
instructionIntAdd state = state
|
instructionIntAdd state = state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user