summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-10 22:24:38 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-10 22:24:38 +1300
commit68ea55cc78b01ca2c259b6e3b12cec8ef39a66e3 (patch)
tree7fd11d9ba36d0cded56ec075be4cc917362f7c4f
parentUse adaptive sizeof on identifiers not types (diff)
downloadtexad-68ea55cc78b01ca2c259b6e3b12cec8ef39a66e3.tar.gz
texad-68ea55cc78b01ca2c259b6e3b12cec8ef39a66e3.zip
Use consistent parens style
-rw-r--r--texad.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/texad.c b/texad.c
index cafc73e..4b79254 100644
--- a/texad.c
+++ b/texad.c
@@ -77,12 +77,10 @@ struct world *genesis(void)
w = malloc(sizeof *w);
p = malloc(sizeof *p);
- for (i = 0; i < sizeof r / sizeof r[0]; i++) {
+ for (i = 0; i < sizeof r / sizeof r[0]; i++)
r[i] = malloc(sizeof r[0]);
- }
- for (i = 0; i < sizeof d / sizeof d[0]; i++) {
+ for (i = 0; i < sizeof d / sizeof d[0]; i++)
d[i] = malloc(sizeof d[0]);
- }
r[0]->title = "The foo room";
r[0]->description = "You are in the foo room. Sunlight streams from the windows.";
@@ -153,12 +151,13 @@ void look(struct room *r)
void move(struct player *p, enum direction dir)
{
struct door **ds;
- for (ds = p->room->doors; *ds; ds++)
+ for (ds = p->room->doors; *ds; ds++) {
if ((*ds)->direction == dir) {
p->room = (*ds)->dst;
look(p->room);
return;
}
+ }
puts("You can't go that way.");
return;
}
@@ -212,7 +211,8 @@ int loop(struct world *w)
return 1;
}
- } else {
+ }
+ else {
puts("");
return 0;
}