コード例 #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",
        "+++>+++++<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<[<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<[<<+>>-]<-]");
  }
コード例 #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",
        "++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++>++++++++++++++++>>+<<[>>>>++++++++++<<[->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>[<+>-]>[-]>>>++++++++++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]>>[++++++++++++++++++++++++++++++++++++++++++++++++.[-]]<[++++++++++++++++++++++++++++++++++++++++++++++++.[-]]<<<++++++++++++++++++++++++++++++++++++++++++++++++.[-]<<<<<<<.>.>>[>>+<<-]>[>+<<+>-]>[<+>-]<<<-]<<++...");
  }
コード例 #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",
        "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.");
  }