From 3f406d7d794cc58d07595e3a6df41660c0d7bca4 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Wed, 23 Jul 2014 08:48:25 +1000 Subject: mod, putc instructions more specific about requiring integer inputs --- src/Grasp/Interpreter.hs | 8 ++++---- 1 file 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 -- cgit