diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-07-23 08:48:25 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-07-23 08:48:25 +1000 |
commit | 3f406d7d794cc58d07595e3a6df41660c0d7bca4 (patch) | |
tree | b96af0c3e8cfd1d2ee3094d328c0ad63c973eceb | |
parent | ec0b71b4cf39d530cbadce01ad30236d85930527 (diff) |
mod, putc instructions more specific about requiring integer inputs
-rw-r--r-- | src/Grasp/Interpreter.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Grasp/Interpreter.hs b/src/Grasp/Interpreter.hs index ad9215a..098a198 100644 --- a/src/Grasp/Interpreter.hs +++ b/src/Grasp/Interpreter.hs @@ -292,9 +292,9 @@ modI g ip = do error ("Instruction " ++ (show node) ++ " requires " ++ "a single left edge and a single right edge") - (x,y) | not (all isFloat x && all isFloat y) -> + (x,y) | not (all isInteger x && all isInteger y) -> error ("Instruction " ++ (show node) ++ - " has non numeric arguments") + " has non integer arguments") (x,y) -> let s = (read . head $ x) `mod` (read . head $ y) in return (foldl' (\gr n -> reLabel gr n (show s)) g outN) @@ -350,9 +350,9 @@ putcI g ip = do error ("Instruction " ++ (show node) ++ " must have at least one in edge") - x | not (isFloat $ inL!!r) -> + x | not (isInteger $ inL!!r) -> error ("Randomly chosen in edge to " ++ (show node) ++ - " does not contain a number") + " does not contain an integer") x -> return . chr . read $ inL!!r |