progs/bf/bfc1.sc
changeset 746 6916229b817b
parent 742 b5b5583a3a08
child 825 dca072e2bb7d
equal deleted inserted replaced
745:7dc3643a0cc5 746:6916229b817b
    42 
    42 
    43 // adding boilerplate
    43 // adding boilerplate
    44 def compile(prog: String) : String = 
    44 def compile(prog: String) : String = 
    45   s"""#include <string.h> 
    45   s"""#include <string.h> 
    46       #include <stdio.h> 
    46       #include <stdio.h> 
    47       char field[30000]; 
    47       int field[30000]; 
    48       char *ptr = &field[15000]; 
    48       int *ptr = &field[15000]; 
    49       int main() { 
    49       int main() { 
    50       memset(field, '\\0', 30000); 
    50       memset(field, '\\0', 30000); 
    51       ${instrs2(prog)} 
    51       ${instrs2(prog)} 
    52       return 0;}"""
    52       return 0;}"""
    53 
    53