Morpion solitaire: Difference between revisions
→{{header|Wren}}: Minor tidy and fixed problem with 'mvprintw' now requiring a format specifier.
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: future-proof for 5.36, use new bitwise string operator) |
(→{{header|Wren}}: Minor tidy and fixed problem with 'mvprintw' now requiring a format specifier.) |
||
Line 1,689:
{{libheader|Wren-fmt}}
An embedded program so we can use the ncurses library.
<syntaxhighlight lang="
import "random" for Random
Line 1,933:
<br>
We now embed the above script in the following C program, build and run it.
<syntaxhighlight lang="c">/* gcc
#include <stdio.h>
Line 1,977:
int x = (int)wrenGetSlotDouble(vm, 2);
const char *str = wrenGetSlotString(vm, 3);
mvprintw(y, x, "%s", str);
}
Line 2,074:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|