changeset 742 | b5b5583a3a08 |
parent 738 | 084e2843f478 |
child 743 | 6acabeecdf75 |
--- a/progs/bf/bfi.sc Mon Jul 27 11:02:48 2020 +0100 +++ b/progs/bf/bfi.sc Thu Jul 30 13:50:54 2020 +0100 @@ -7,12 +7,10 @@ // -import scala.util._ - -// BF memory as a map +// BF memory is represented as a Map type Mem = Map[Int, Int] -// reading and writing BF memory +// safe reading and writing of BF memory def sread(mem: Mem, mp: Int) : Int = mem.getOrElse(mp, 0)