summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2010-05-11 16:51:48 +0000
committerDimitri Sokolyuk <demon@dim13.org>2010-05-11 16:51:48 +0000
commit369f978a805a83f92ba48aaf7382d94039a776f3 (patch)
tree089242ea3ca7523b96e88aee534aec2de84dae73
parentd0260211c6a5a04273f48c8ccb1171b89d476b6b (diff)
use nitems()
-rw-r--r--snow.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/snow.c b/snow.c
index 1b67f59..3df5068 100644
--- a/snow.c
+++ b/snow.c
@@ -16,6 +16,7 @@
*/
#include <sys/ioctl.h>
+#include <sys/param.h>
#include <sys/queue.h>
#include <curses.h>
#include <signal.h>
@@ -37,6 +38,7 @@ TAILQ_HEAD(, particle) head;
extern int LINES;
extern int COLS;
static int d_flag = 0;
+
char flake[] = ".*#";
void
@@ -87,7 +89,7 @@ main()
pp->dy = random() % 3;
pp->y = 0;
pp->x = random() % COLS;
- pp->c = flake[random() % 3];
+ pp->c = flake[random() % nitems(flake)];
TAILQ_INSERT_HEAD(&head, pp, link);
refresh();