Ejemplo n.º 1
0
  /** Test of compile method, of class BrainfuckAssembler. */
  @Test
  public void testMultiplication() throws Exception {
    System.out.println("compile");

    BrainfuckFileOutputWriter writer = new BrainfuckFileOutputWriter("MultiplicationTest", "/tmp/");
    writer.setRaw(true);

    BrainfuckAssembler instance = new BrainfuckAssembler();
    instance.setOutputWriter(writer);

    instance.compile(
        "MultiplicationTest",
        "+++>+++++<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<[<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<[<<+>>-]<-]");
  }
Ejemplo n.º 2
0
  /** Test of compile method, of class BrainfuckAssembler. */
  @Test
  public void testFibonacci() throws Exception {
    System.out.println("compile");

    BrainfuckFileOutputWriter writer = new BrainfuckFileOutputWriter("FibonacciTest", "/tmp/");
    writer.setRaw(true);

    BrainfuckAssembler instance = new BrainfuckAssembler();
    instance.setOutputWriter(writer);

    instance.compile(
        "FibonacciTest",
        "++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++>++++++++++++++++>>+<<[>>>>++++++++++<<[->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>[<+>-]>[-]>>>++++++++++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]>>[++++++++++++++++++++++++++++++++++++++++++++++++.[-]]<[++++++++++++++++++++++++++++++++++++++++++++++++.[-]]<<<++++++++++++++++++++++++++++++++++++++++++++++++.[-]<<<<<<<.>.>>[>>+<<-]>[>+<<+>-]>[<+>-]<<<-]<<++...");
  }
Ejemplo n.º 3
0
  /** Test of compile method, of class BrainfuckAssembler. */
  @Test
  public void testHelloWorld() throws Exception {
    System.out.println("compile");

    BrainfuckFileOutputWriter writer = new BrainfuckFileOutputWriter("HelloWorldTest", "/tmp/");
    writer.setRaw(true);

    BrainfuckAssembler instance = new BrainfuckAssembler();
    instance.setOutputWriter(writer);

    instance.compile(
        "HelloWorldTest",
        "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.");
  }