aboutsummaryrefslogtreecommitdiff
path: root/rip.hs
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-09-15 23:06:28 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-09-15 23:06:28 +0200
commit09c405ae45cf44758be1af641462044c5ae5c7ae (patch)
tree171ccd795a9575efba20422d7e34733b56fcbf12 /rip.hs
parentd83f843f7d4610f393014a1e6ff1cee38e1ead9a (diff)
New spec propagate
Diffstat (limited to 'rip.hs')
-rw-r--r--rip.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/rip.hs b/rip.hs
index 25ff98f..3c2ab2b 100644
--- a/rip.hs
+++ b/rip.hs
@@ -45,10 +45,10 @@ rip' (x:xs) st = case x of
n | '0' <= n && n <= '9' ->
rip' xs (fromIntegral (ord n - ord '0') : st)
- 'p' ->
+ 'P' ->
rip' xs (tail st)
- 's' ->
+ 'S' ->
rip' xs (b:a:cs)
where (a:b:cs) = st
@@ -77,31 +77,31 @@ rip' (x:xs) st = case x of
(begin, rest) = (take (fromIntegral n) newst, drop (fromIntegral n) newst)
res = last begin : init begin ++ rest --SLOW!
- '+' ->
+ 'a' ->
rip' xs (a + b : cs)
where (b:a:cs) = st
- '-' ->
+ 's' ->
rip' xs (a - b : cs)
where (b:a:cs) = st
- '*' ->
+ 'm' ->
rip' xs (a * b : cs)
where (b:a:cs) = st
- '/' ->
+ 'q' ->
rip' xs (a `div` b : cs)
where (b:a:cs) = st
- '>' ->
+ 'G' ->
rip' xs (booltoint (a > b) : cs)
where (b:a:cs) = st
- '<' ->
+ 'L' ->
rip' xs (booltoint (a < b) : cs)
where (b:a:cs) = st
- '=' ->
+ 'E' ->
rip' xs (booltoint (a == b) : cs)
where (b:a:cs) = st
@@ -144,7 +144,7 @@ rip' (x:xs) st = case x of
c <- getChar
rip' xs (fromIntegral (ord c) : st)
- 'S' -> do
+ '$' -> do
print st
rip' xs st