CLI-based maze-game: Difference between revisions
Content added Content deleted
m (fixed header) |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 34: | Line 34: | ||
=={{header|Furor}}== |
=={{header|Furor}}== |
||
< |
<syntaxhighlight lang=Furor> |
||
###sysinclude terminal.uh |
###sysinclude terminal.uh |
||
###sysinclude into.uh |
###sysinclude into.uh |
||
Line 657: | Line 657: | ||
} |
} |
||
// --------------------------------------------------------- |
// --------------------------------------------------------- |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 699: | Line 699: | ||
{{libheader|nim-ncurses}} |
{{libheader|nim-ncurses}} |
||
This translation uses the binding for “ncurses” and have been tested on Linux (Manjaro). |
This translation uses the binding for “ncurses” and have been tested on Linux (Manjaro). |
||
< |
<syntaxhighlight lang=Nim>import os, random, sequtils, strutils, std/exitprocs, locks |
||
import ncurses |
import ncurses |
||
Line 1,069: | Line 1,069: | ||
play()</ |
play()</syntaxhighlight> |
||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
<!--< |
<!--<syntaxhighlight lang=Phix>(notonline)--> |
||
<span style="color: #000080;font-style:italic;">-- demo/rosetta/CLI_maze.exw</span> |
<span style="color: #000080;font-style:italic;">-- demo/rosetta/CLI_maze.exw</span> |
||
<span style="color: #008080;">without</span> <span style="color: #008080;">js</span> <span style="color: #000080;font-style:italic;">-- (wait_key(), get_key(), position(), clear_screen(), etc)</span> |
<span style="color: #008080;">without</span> <span style="color: #008080;">js</span> <span style="color: #000080;font-style:italic;">-- (wait_key(), get_key(), position(), clear_screen(), etc)</span> |
||
Line 1,456: | Line 1,456: | ||
<span style="color: #0000FF;">{}</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">wait_key</span><span style="color: #0000FF;">()</span> |
<span style="color: #0000FF;">{}</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">wait_key</span><span style="color: #0000FF;">()</span> |
||
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span> |
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span> |
||
<!--</ |
<!--</syntaxhighlight>--> |
||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
Line 1,466: | Line 1,466: | ||
{{libheader|Wren-trait}} |
{{libheader|Wren-trait}} |
||
An embedded script so we can use the ncurses library. |
An embedded script so we can use the ncurses library. |
||
< |
<syntaxhighlight lang=ecmascript>/* cli_based_maze_game.wren */ |
||
import "./dynamic" for Enum, Tuple, Struct |
import "./dynamic" for Enum, Tuple, Struct |
||
Line 1,882: | Line 1,882: | ||
NC.nocbreak() |
NC.nocbreak() |
||
NC.endwin() |
NC.endwin() |
||
NC.cursSet(1)</ |
NC.cursSet(1)</syntaxhighlight> |
||
<br> |
<br> |
||
We now embed this in the following C program, build and run it. |
We now embed this in the following C program, build and run it. |
||
< |
<syntaxhighlight lang=c>/* gcc cli_based_maze_game.c -o cli_based_maze_game -lncurses -lwren -lm */ |
||
#include <stdio.h> |
#include <stdio.h> |
||
Line 2,067: | Line 2,067: | ||
free(script); |
free(script); |
||
return 0; |
return 0; |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Sample opening screen. |
Sample opening screen. |