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