testing3/bf.scala
author Christian Urban <urbanc@in.tum.de>
Thu, 23 Nov 2017 10:56:47 +0000
changeset 153 4383809c176a
child 154 39c6b93718f0
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
// Part 2 about an Interpreter for the Brainf*** language
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
//========================================================
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
object CW8b {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
type Mem = Map[Int, Int]
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
// (2a) Complete the functions for safely reading  
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
// and writing brainf*** memory. Safely read should
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
// Return the value stored in the Map for a given memory
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
// pointer, if it exists; otherwise Returns 0. The
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
// writing function generates a new Map with the
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
// same data, except at the given memory pointer the
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
// a value v is stored.
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
def sread(mem: Mem, mp: Int) : Int = 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
  mem.getOrElse(mp, 0)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
def write(mem: Mem, mp: Int, v: Int) : Mem =
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
  mem.updated(mp, v)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
// (2b) Implement the two jumping instructions in the 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
// brainf*** language. In jumpRight, given a program and 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
// a program counter move the program counter to the right 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
// until after the *matching* ]-command. Similarly, 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
// jumpLeft implements the move to the left to just after
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
// the *matching* [--command.
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
def jumpRight(prog: String, pc: Int, level: Int) : Int = {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  if (prog.length <= pc) pc 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  else (prog(pc), level) match {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
    case (']', 0) => pc + 1
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
    case (']', l) => jumpRight(prog, pc + 1, l - 1)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
    case ('[', l) => jumpRight(prog, pc + 1, l + 1)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
    case (_, l) => jumpRight(prog, pc + 1, l)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  }
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
def jumpLeft(prog: String, p: Int, level: Int) : Int = {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  if (p < 0) p 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  else (prog(p), level) match {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
    case ('[', 0) => p + 1
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    case ('[', l) => jumpLeft(prog, p - 1, l - 1)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
    case (']', l) => jumpLeft(prog, p - 1, l + 1)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
    case (_, l) => jumpLeft(prog, p - 1, l)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  }
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
// (2c) Complete the run function that interpretes (runs) a brainf***
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
// program: the arguments are a program, a program counter,
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
// a memory counter and a brainf*** memory. It Returns the
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
// memory at the stage when the excution of the brainf*** program
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
// finishes. The interpretation finishes once the program counter
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
// pc is pointing to something outside the program string.
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
// If the pc points to a character inside the program, the pc, 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
// memory pointer and memory need to be updated according to 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
// rules of the brainf*** language. Then, recursively, run 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
// function continues with the command at the new program
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
// counter. 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
// Implement the start function that calls run with the program
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
// counter and memory counter set to 0.
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
def run(prog: String, pc: Int, mp: Int, mem: Mem) : Mem = {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
  if (0 <= pc && pc < prog.length) { 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
    val (new_pc, new_mp, new_mem) = prog(pc) match {
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
      case '>' => (pc + 1, mp + 1, mem)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
      case '<' => (pc + 1, mp - 1, mem)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
      case '+' => (pc + 1, mp, write(mem, mp, sread(mem, mp) + 1))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
      case '-' => (pc + 1, mp, write(mem, mp, sread(mem, mp) - 1))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
      case '.' => { print(sread(mem, mp).toChar); (pc + 1, mp, mem) }
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
      case ',' => (pc + 1, mp, write(mem, mp, Console.in.read().toByte))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
      case '['  => 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
	if (sread(mem, mp) == 0) (jumpRight(prog, pc + 1, 0), mp, mem) else (pc + 1, mp, mem) 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
      case ']'  => 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
	if (sread(mem, mp) != 0) (jumpLeft(prog, pc - 1, 0), mp, mem) else (pc + 1, mp, mem) 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
      case _ => (pc + 1, mp, mem)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
    }		     
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
    run(prog, new_pc, new_mp, new_mem)	
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
  }
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  else mem
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
def start(prog: String, m: Mem) = run(prog, 0, 0, m)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
// some sample programs collected from the Internet
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
//==================================================
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
/*
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
// first some contrived (small) programs
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
// clears the 0-cell
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
start("[-]", Map(0 -> 100)) 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
// copies content of the 0-cell to 1-cell
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
start("[->+<]", Map(0 -> 10))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
// copies content of the 0-cell to 2-cell and 4-cell
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
start("[>>+>>+<<<<-]", Map(0 -> 42))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
// prints out numbers 0 to 9
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
start("""+++++[->++++++++++<]>--<+++[->>++++++++++<<]>>++<<----------[+>.>.<+<]""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
// some more "useful" programs
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
// hello world program 1
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
start("""++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
       ..+++.>>.<-.<.+++.------.--------.>>+.>++.""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
// hello world program 2
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
start("""++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>+
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
      +.<<+++++++++++++++.>.+++.------.--------.>+.>.""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
// draws the Sierpinski triangle
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
start("""++++++++[>+>++++<<-]>++>>+<[-[>>+<<-]+>>]>+[-<<<[
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
      ->[+[-]+>++>>>-<<]<[<]>>++++++[<<+++++>>-]+<<++.[-]<<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
      ]>.>+[>>]>+]""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
//fibonacci numbers below 100
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
start("""+++++++++++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
      >+>>>>++++++++++++++++++++++++++++++++++++++++++++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
      >++++++++++++++++++++++++++++++++<<<<<<[>[>>>>>>+>
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
      +<<<<<<<-]>>>>>>>[<<<<<<<+>>>>>>>-]<[>++++++++++[-
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
      <-[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]>[<<[>>>+<<<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
      -]>>[-]]<<]>>>[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
      >[<<+>>[-]]<<<<<<<]>>>>>[+++++++++++++++++++++++++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
      +++++++++++++++++++++++.[-]]++++++++++<[->-<]>++++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
      ++++++++++++++++++++++++++++++++++++++++++++.[-]<<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
      <<<<<<<<<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<-[>>.>.<<<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
      [-]]<<[>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<-]""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
//outputs the square numbers up to 10000
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
start("""++++[>+++++<-]>[<+++++>-]+<+[
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
    >[>+>+<<-]++>>[<<+>>-]>>>[-]++>[-]+
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
    >>>+[[-]++++++>>>]<<<[[<++++++++<++>>-]+<.<[>----<-]<]
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
    <<[>>>>>[>>>[-]+++++++++<[>-<-]+++++++++>[-[<->-]+[<<<]]<[>+<-]>]<<-]<<-]""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
//collatz numbers (need to be typed in)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
start(""">,[[----------[
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
      >>>[>>>>]+[[-]+<[->>>>++>>>>+[>>>>]++[->+<<<<<]]<<<]
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
      ++++++[>------<-]>--[>>[->>>>]+>+[<<<<]>-],<]>]>>>++>+>>[
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
      <<[>>>>[-]+++++++++<[>-<-]+++++++++>[-[<->-]+[<<<<]]<[>+<-]>]
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
      >[>[>>>>]+[[-]<[+[->>>>]>+<]>[<+>[<<<<]]+<<<<]>>>[->>>>]+>+[<<<<]]
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
      >[[>+>>[<<<<+>>>>-]>]<<<<[-]>[-<<<<]]>>>>>>>
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
      ]>>+[[-]++++++>>>>]<<<<[[<++++++++>-]<.[-]<[-]<[-]<]<,]""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
// infinite collatz (never stops)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
start(""">>+>+<[[->>[>>]>>>[>>]+[<<]<<<[<<]>[>[>>]>>+>[>>]<+<[<<]<<<[<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
      <]>-]>[>>]>>[<<<<[<<]>+>[>>]>>-]<<<<[<<]+>>]<<[+++++[>+++++++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
      +<-]>.<++++++[>--------<-]+<<]>>[>>]+[>>>>[<<+>+>-]<-[>+<-]+<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
      [<<->>-[<<+>>[-]]]>>>[<<<+<<+>>>>>-]<<<[>>>+<<<-]<<[[-]>+>>->
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
      [<+<[<<+>>-]<[>+<-]<[>+<-]>>>>-]<[>+<-]+<[->[>>]<<[->[<+++>-[
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
      <+++>-[<+++>-[<[-]++>>[-]+>+<<-[<+++>-[<+++>-[<[-]+>>>+<<-[<+
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
      ++>-[<+++>-]]]]]]]]]<[>+<-]+<<]>>>+<[->[<+>-[<+>-[<+>-[<+>-[<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
      +>-[<+>-[<+>-[<+>-[<+>-[<[-]>>[-]+>+<<-[<+>-]]]]]]]]]]]<[>+<-
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
      ]+>>]<<[<<]>]<[->>[->+>]<[-[<+>-[<->>+<-[<+>-[<->>+<-[<+>-[<-
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
      >>+<-[<+>-[<->>+<-[<+>-[<->>+<-[<+>-[<->>+<-[<+>-[<->>+<-[<+>
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
      -[<->>+<-[<+>-[<->>+<-[<+>-]]]]]]]]]]]]]]]]]]]>[<+>-]<+<[<+++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
      +++++++>-]<]>>[<+>->>]<<[>+>+<<-]>[<+>-]+>[<->[-]]<[-<<-]<<[<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
      <]]++++++[>+++++++<-]>++.------------.[-]>[>>]<<[+++++[>+++++
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
      +++<-]>.<++++++[>--------<-]+<<]+<]>[<+>-]<]>>>[>>]<<[>[-]<-<
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
      <]++++++++++.[-]<<<[<<]>>>+<[->[<+>-[<+>-[<+>-[<+>-[<+>-[<+>-
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
      [<+>-[<+>-[<+>-[<[-]>>[-]+>+<<-]]]]]]]]]]<[>+<-]+>>]<<[<<]>>]""", Map())
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
*/ 
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
}