Merge branch 'vendor/XZ'
[dragonfly.git] / games / quiz / quiz.6
1 .\" Copyright (c) 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Jim R. Oldroyd at The Instruction Set.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\"     @(#)quiz.6      8.1 (Berkeley) 5/31/93
32 .\" $FreeBSD: src/games/quiz/quiz.6,v 1.3.2.1 2000/12/08 13:40:05 ru Exp $
33 .\"
34 .Dd May 31, 1993
35 .Dt QUIZ 6
36 .Os
37 .Sh NAME
38 .Nm quiz
39 .Nd random knowledge tests
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl t
43 .Op Fl i Ar file
44 .Op Ar question answer
45 .Sh DESCRIPTION
46 The
47 .Nm
48 utility tests your knowledge of random facts.
49 It has a database of subjects from which you can choose.
50 With no arguments,
51 .Nm
52 displays the list of available subjects.
53 .Pp
54 The options are as follows:
55 .Bl -tag -width indent
56 .It Fl t
57 Use tutorial mode, in which questions are repeated later if you didn't get
58 them right the first time, and new questions are presented less frequently
59 to help you learn the older ones.
60 .It Fl i
61 Specify an alternate index file.
62 .El
63 .Pp
64 Subjects are divided into categories.
65 You can pick any two categories from the same subject.
66 .Nm Quiz
67 will ask questions from the first category and it expects answers from
68 the second category.
69 For example, the command ``quiz victim killer'' asks questions which are
70 the names of victims, and expects you to answer with the cause of their
71 untimely demise, whereas the command ``quiz killer victim'' works the
72 other way around.
73 .Pp
74 If you get the answer wrong,
75 .Nm
76 lets you try again.
77 To see the right answer, enter a blank line.
78 .Sh INDEX AND DATA FILE SYNTAX
79 The index and data files have a similar syntax.
80 Lines in them consist of several categories separated by colons.
81 The categories are regular expressions formed using the following
82 meta-characters:
83 .Pp
84 .Bl -tag -width "pat|pat" -compact -offset indent
85 .It pat|pat
86 alternate patterns
87 .It {pat}
88 optional pattern
89 .It [pat]
90 delimiters, as in pat[pat|pat]pat
91 .El
92 .Pp
93 In an index file, each line represents a subject.
94 The first category in each subject is the pathname of the data file for
95 the subject.
96 The remaining categories are regular expressions for the titles of each
97 category in the subject.
98 .Pp
99 In data files, each line represents a question/answer set.
100 Each category is the information for the question/answer for that category.
101 .Pp
102 The backslash character (``\e'') is used to quote syntactically significant
103 characters, or at the end of a line to signify that a continuation line
104 follows.
105 .Pp
106 If either a question or its answer is empty,
107 .Nm
108 will refrain from asking it.
109 .Sh FILES
110 .Bl -tag -width /usr/share/games/quiz.db -compact
111 .It Pa /usr/share/games/quiz.db
112 The default index and data files.
113 .El
114 .Sh BUGS
115 .Nm Quiz
116 is pretty cynical about certain subjects.