diff --git a/programs/cmm/BrainFuck/brainfuck.c b/programs/cmm/BrainFuck/brainfuck.c index 0ae7011bca..ca124a6482 100644 --- a/programs/cmm/BrainFuck/brainfuck.c +++ b/programs/cmm/BrainFuck/brainfuck.c @@ -94,6 +94,7 @@ void evalBrainFuckCode(dword code) void main() { dword brainFuckCode = 0; + word maxLoop = 1000; buffer = malloc(bufferSize); memory = malloc(memoryBrainfuck); @@ -106,16 +107,19 @@ void main() ELSE { consoleInit(); - con_printf stdcall ("BrainF*ck interpreter v1.01\r\n"); - loop() + con_printf stdcall ("BrainF*ck interpreter v1.05"); + WHILE(maxLoop) { - con_printf stdcall ("\r\nEnter BrainF*ck code:\r\n"); + con_printf stdcall ("\r\n\r\nEnter code: "); con_gets stdcall(buffer, bufferSize); - evalBrainFuckCode(EAX); - con_printf stdcall ("\r\nOutput BrainF*ck:\r\n"); + brainFuckCode = EAX; + con_printf stdcall ("Output: "); + evalBrainFuckCode(brainFuckCode); + maxLoop--; } } - ExitProcess(); + IF(initConsole) con_exit stdcall (0); + ExitProcess(); } diff --git a/programs/cmm/BrainFuck/compile.sh b/programs/cmm/BrainFuck/compile.sh index 1be419bf24..ddd47b53e8 100755 --- a/programs/cmm/BrainFuck/compile.sh +++ b/programs/cmm/BrainFuck/compile.sh @@ -1,5 +1,5 @@ #!/bin/bash for file in `find ./ -type f -name "*.c"` do - ./cmm $file; + cmm $file; done \ No newline at end of file