Snake: Difference between revisions
m
→{{header|Wren}}: Minor tidy
m (→{{header|Wren}}: Minor tidy) |
|||
Line 5,120:
{{libheader|Wren-dynamic}}
An embedded program so we can ask the C host to call ncurses and another library function for us.
<syntaxhighlight lang="
import "random" for Random
Line 5,258:
<br>
Now embed this script in the following C program, compile and run it.
<syntaxhighlight lang="c">/* gcc
#include <stdio.h>
Line 5,404:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|