File: Main.hs

package info (click to toggle)
haskell-brainfuck 0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 92 kB
  • sloc: haskell: 315; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Main where

import Language.Brainfuck
import Language.Brainfuck.Examples
import Control.Monad (when)

import Data.Array hiding (array)
import System.Posix.Resource

main :: IO ()
main = do
  setResourceLimit ResourceCPUTime $ ResourceLimits (ResourceLimit 5) (ResourceLimit 5)
  run

run = do
  prog <- getContents
  c    <- core
  let cmds = loadProgram prog
  when debug $ print cmds
  execute cmds (snd (bounds cmds)) (BF c 0 0)