RCRPG/C: Difference between revisions
m
Fixed syntax highlighting.
m (Collection/cat) |
m (Fixed syntax highlighting.) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1:
{{collection|RCRPG}}
==What's in use==
Line 38 ⟶ 39:
{{works with|POSIX}}
{{libheader|ncurses}}
<
#include <stdlib.h>
#include <stdbool.h>
Line 82 ⟶ 83:
};
const char *str_dirs = "nsewud";
struct room {
Line 94 ⟶ 95:
/* descriptions */
const char *descriptions[] = {
"cold dark room",
"very stinky room",
Line 107 ⟶ 108:
};
const char *objs[] = {
"nothing", "sledge", "ladder", "gold", "equipped sledge"
};
const char *dirnames[] = {
"north", "south", "east", "west", "up", "down"
};
Line 185 ⟶ 186:
rooms[room_i]->visited = false;
rooms[room_i]->description = rangerandom(0, sizeof(descriptions)/sizeof(
/* put some random object - sledge or gold */
Line 213 ⟶ 214:
/* show description */
void print_cmd(int y, int x, const char *str)
{
int i, l;
Line 592 ⟶ 593:
free_rooms();
nocbreak(); echo(); endwin();
return EXIT_SUCCESS;
}
}</syntaxhighlight>
|