kernel: Fix a -Wundef warning.
[dragonfly.git] / games / larn / fortune.c
blob3a73c94e9c071b0838d9eb6ac1fc12b3f431f1af
1 /*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
29 * @(#)fortune.c 5.5 (Berkeley) 6/10/91
30 * $FreeBSD: src/games/larn/fortune.c,v 1.2 1999/11/30 03:48:59 billf Exp $
31 * $DragonFly: src/games/larn/fortune.c,v 1.3 2006/08/26 17:05:05 pavalos Exp $
34 /* fortune.c Larn is copyrighted 1986 by Noah Morgan. */
35 #include "header.h"
38 * function to return a random fortune from the fortune file
41 const char *flines[] = {
42 "gem value = gem * 2 ^ perfection",
43 "sitting down can have unexpected results",
44 "don't pry into the affairs of others",
45 "drinking can be hazardous to your health",
46 "beware of the gusher!",
47 "some monsters are greedy",
48 "nymphs have light fingers",
49 "try kissing a disenchantress!",
50 "hammers and brains don't mix",
51 "what does a potion of cure dianthroritis taste like?",
52 "hit point gain/loss when raising a level depends on constitution",
53 "healing a mighty wizard can be exhilarating",
54 "be sure to pay your taxes",
55 "are Vampires afraid of something?",
56 "some dragons can fly",
57 "dos thou strive for perfection?",
58 "patience is a virtue, unless your daughter dies",
59 "what does the Eye of Larn see in its guardian?",
60 "a level 25 player casts like crazy!",
61 "energy rings affect spell regeneration",
62 "difficulty affects regeneration",
63 "control of the pesty spirits is most helpful",
64 "don't fall into a bottomless pit",
65 "dexterity allows you to carry more",
66 "you can get 2 points of WC for the price of one",
67 "never enter the dungeon naked! the monsters will laugh at you!",
68 "did someone put itching powder in your armor?",
69 "you klutz!",
70 "avoid opening doors. you never know whats on the other side.",
71 "infinite regeneration ---> temptation",
72 "the greatest weapon in the game has not the highest Weapon Class",
73 "you can't buy the most powerful scroll",
74 "identify things before you use them",
75 "there's more than one way through a wall"
78 #define NFORTUNES 34
80 const char *
81 fortune(void)
83 return (flines[random() % NFORTUNES]);