RCRPG/C: Difference between revisions

m
Fixed syntax highlighting.
m (Fixed syntax highlighting.)
 
(2 intermediate revisions by one other user not shown)
Line 39:
{{works with|POSIX}}
{{libheader|ncurses}}
<langsyntaxhighlight lang="c">#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
Line 83:
};
 
const char *str_dirs = "nsewud";
 
struct room {
Line 95:
 
/* descriptions */
const char *descriptions[] = {
"cold dark room",
"very stinky room",
Line 108:
};
 
const char *objs[] = {
"nothing", "sledge", "ladder", "gold", "equipped sledge"
};
 
const char *dirnames[] = {
"north", "south", "east", "west", "up", "down"
};
Line 186:
 
rooms[room_i]->visited = false;
rooms[room_i]->description = rangerandom(0, sizeof(descriptions)/sizeof(void *descriptions) - 1);
 
/* put some random object - sledge or gold */
Line 214:
/* show description */
 
void print_cmd(int y, int x, const char *str)
{
int i, l;
Line 595:
return EXIT_SUCCESS;
}
}</langsyntaxhighlight>
9,485

edits