summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-02-06 21:13:46 +1100
committerJed Barber <jjbarber@y7mail.com>2014-02-06 21:13:46 +1100
commit2a281ed2606e18459189a60cab9c18a659ab74e3 (patch)
tree656e961b32befc9b2e25bc2b322d90b089275ff4
parentcd5e13ba7979aa942326ddbc7199f91ca85425a9 (diff)
Renamed remaining code from original fractran file more appropriately
-rw-r--r--misc.hs (renamed from fractran.hs)17
1 files changed, 0 insertions, 17 deletions
diff --git a/fractran.hs b/misc.hs
index 0d78ef9..c5bf33f 100644
--- a/fractran.hs
+++ b/misc.hs
@@ -38,20 +38,3 @@ isPowerOf x y =
EQ -> True
GT -> if (x `modulo` y == 0) then isPowerOf (x `div` y) y else False
-
-
-fractran :: [(Int,Int)] -> Int -> [Int]
-fractran program value =
- let prog = map (\(x,y) -> (fromIntegral x, fromIntegral y)) program
- f = (\p v -> if (p == [])
- then []
- else let (curX, curY) = head p
- newV = v * curX / curY
- in if (isInt newV)
- then newV : (f prog newV)
- else f (tail p) v)
- result = map round (f prog (fromIntegral value))
- in value : result
-
-
-