Robots/Wren: Difference between revisions

Content added Content deleted
(→‎Code: Sharper colors.)
m (→‎Code: Fixed syntax highlighting.)
Line 1:
===Code===
{{trans|Go}}
{{libheader|ncurses}}
Line 7:
{{works with|Ubuntu 20.04}}
An embedded script so we can use the ncurses library.
<langsyntaxhighlight lang="ecmascript">/* robots.wren */
 
import "./dynamic" for Struct
Line 298:
NC.echo()
NC.endwin()
NC.cursSet(1)</langsyntaxhighlight>
<br>
We now embed this in the following C program, build and run it.
<langsyntaxhighlight lang="c">/* gcc robots.c -o robots -lncurses -lwren -lm */
 
#include <stdio.h>
Line 519:
free(script);
return 0;
}</langsyntaxhighlight>