Skip to content

Commit

Permalink
Runner.hs thrown away as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Karocyt committed Feb 16, 2021
1 parent 7aafc4f commit 0997708
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
3 changes: 1 addition & 2 deletions a-machine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 6daea2527be2f9b0d068d105f005ab225593979b931c1019c4b1af07de9bcafb
-- hash: d968a1a9a5e81d363b5079576119931101303aacdd71d6d9c1cd947d38a06d99

name: a-machine
version: 0.1.0.0
Expand All @@ -28,7 +28,6 @@ source-repository head
library
exposed-modules:
Machine
Runner
other-modules:
Paths_a_machine
hs-source-dirs:
Expand Down
2 changes: 1 addition & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import System.IO (readFile)
import Control.Exception (try, SomeException)
import Data.ByteString.Lazy.Char8 (pack)
import Data.Aeson (eitherDecode)

import Machine
import Runner

usage :: String
usage = "Usage: ./a-machine desc.json tape\nwhere:\n\t- 'desc.json' is a json encoded file containing a valid machine description\n\t- 'tape' is a string of instructions from the machine alphabet"
Expand Down
14 changes: 14 additions & 0 deletions src/Machine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,17 @@ buildState tape_content initial_state = do
pos=0,
nextTransition=initial_state
})

-- NEEDS:
-- - check if nextTransition in finals
-- - Right State
-- - Execute/check if transition exists
-- - Left "error blabla"
-- - Move pos
-- - Left "Stay on the dancefloor"
-- - Tail recursion
-- State might get bigger depending on how we handle bonuses (keeping history, counting iterations...)

-- TO DO
runMachine :: Machine -> State -> Either String State
runMachine machine state = Left $ "It's ALIIIIIVE:\n" ++ (show machine) ++ "\n" ++ (show state)
19 changes: 0 additions & 19 deletions src/Runner.hs

This file was deleted.

0 comments on commit 0997708

Please sign in to comment.