RCRPG/C: Difference between revisions
m
Fixed syntax highlighting.
m (Categorization now in master page) |
m (Fixed syntax highlighting.) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 39:
{{works with|POSIX}}
{{libheader|ncurses}}
<
#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(
/* 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 593:
free_rooms();
nocbreak(); echo(); endwin();
return EXIT_SUCCESS;
}
}</syntaxhighlight>
|