summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2010-04-29 21:23:42 +0000
committerDimitri Sokolyuk <demon@dim13.org>2010-04-29 21:23:42 +0000
commit18e822aecbce76600384908b9d6e1be0c63c9795 (patch)
tree000faf8c6c38628a1f01fb942a11516f10bd85ff
parent076b57900417a6ec81836f0d9d44eb3c53d2dd71 (diff)
more shapes
-rw-r--r--snow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/snow.c b/snow.c
index 5c9c466..dd37806 100644
--- a/snow.c
+++ b/snow.c
@@ -28,6 +28,7 @@ struct particle {
int x;
int y;
int dy;
+ int c;
TAILQ_ENTRY(particle) link;
} *pp, *pnext;
@@ -36,6 +37,7 @@ TAILQ_HEAD(, particle) head;
extern int LINES;
extern int COLS;
static int d_flag = 0;
+char flake[] = ".*#";
void
resize(int signo)
@@ -75,7 +77,7 @@ main()
TAILQ_REMOVE(&head, pp, link);
free(pp);
} else {
- mvprintw(pp->y, pp->x, "*");
+ mvprintw(pp->y, pp->x, "%c", pp->c);
pp->y += pp->dy;
pp->x += 1 - random() % 3;
}
@@ -85,6 +87,7 @@ main()
pp->dy = 1 + random() % 3;
pp->y = 0;
pp->x = random() % COLS;
+ pp->c = flake[random() % 3];
TAILQ_INSERT_HEAD(&head, pp, link);
refresh();