Brainfuck interpreter update

git-svn-id: svn://kolibrios.org@7560 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pavelyakov 2018-11-22 23:26:47 +00:00
parent b8e5a89fa2
commit a43456eaa9
2 changed files with 11 additions and 7 deletions

View File

@ -94,6 +94,7 @@ void evalBrainFuckCode(dword code)
void main() void main()
{ {
dword brainFuckCode = 0; dword brainFuckCode = 0;
word maxLoop = 1000;
buffer = malloc(bufferSize); buffer = malloc(bufferSize);
memory = malloc(memoryBrainfuck); memory = malloc(memoryBrainfuck);
@ -106,16 +107,19 @@ void main()
ELSE ELSE
{ {
consoleInit(); consoleInit();
con_printf stdcall ("BrainF*ck interpreter v1.01\r\n"); con_printf stdcall ("BrainF*ck interpreter v1.05");
loop() 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); con_gets stdcall(buffer, bufferSize);
evalBrainFuckCode(EAX); brainFuckCode = EAX;
con_printf stdcall ("\r\nOutput BrainF*ck:\r\n"); con_printf stdcall ("Output: ");
evalBrainFuckCode(brainFuckCode);
maxLoop--;
} }
} }
ExitProcess();
IF(initConsole) con_exit stdcall (0); IF(initConsole) con_exit stdcall (0);
ExitProcess();
} }

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
for file in `find ./ -type f -name "*.c"` for file in `find ./ -type f -name "*.c"`
do do
./cmm $file; cmm $file;
done done