forked from KolibriOS/kolibrios
Brainfuck interpreter update
git-svn-id: svn://kolibrios.org@7560 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b8e5a89fa2
commit
a43456eaa9
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user