blob: fb2d5ad833c78cedf96928d0f417f35f9a1a38a4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
module Text.Brainfsck.Util where
inc :: [Int] -> Int -> [Int]
inc b h = take h b <> [b !! h + 1] <> drop (h + 1) b
dec :: [Int] -> Int -> [Int]
dec b h = take h b <> [b !! h - 1] <> drop (h + 1) b
load :: [Int] -> Int -> Int -> [Int]
load b h v = take h b <> [v] <> drop (h + 1) b
|