xref: /original-bsd/games/quiz/quiz.6 (revision 21eed380)
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" 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.\" %sccs.include.redist.roff%
8.\"
9.\"	@(#)quiz.6	6.3 (Berkeley) 11/10/91
10.\"
11.Dd
12.Dt QUIZ 6
13.Os
14.Sh NAME
15.Nm quiz
16.Nd random knowledge tests
17.Sh SYNOPSIS
18.Nm quiz
19.Op Fl t
20.Op Fl i Ar file
21.Op Ar question answer
22.Sh DESCRIPTION
23The
24.Nm quiz
25utility tests your knowledge of random facts.
26It has a database of subjects from which you can choose.
27With no arguments,
28.Nm quiz
29displays the list of available subjects.
30.Pp
31The options are as follows:
32.Bl -tag -width indent
33.It Fl t
34Use tutorial mode, in which questions are repeated later if you didn't get
35them right the first time, and new questions are presented less frequently
36to help you learn the older ones.
37.It Fl i
38Specify an alternate index file.
39.El
40.Pp
41Subjects are divided into categories.
42You can pick any two categories from the same subject.
43.Nm Quiz
44will ask questions from the first category and it expects answers from
45the second category.
46For example, the command ``quiz victim killer'' asks questions which are
47the names of victims, and expects you to answer with the cause of their
48untimely demise, whereas the command ``quiz killer victim'' works the
49other way around.
50.Pp
51If you get the answer wrong,
52.Nm quiz
53lets you try again.
54To see the right answer, enter a blank line.
55.Sh "Index and Data File Syntax"
56The index and data files have a similar syntax.
57Lines in them consist of several categories separated by colons.
58The categories are regular expressions formed using the following
59meta-characters:
60.sp
61.Bl -tag -width "pat|pat" -compact -offset indent
62.It pat|pat
63alternate patterns
64.It {pat}
65optional pattern
66.It [pat]
67delimiters, as in pat[pat|pat]pat
68.El
69.Pp
70In an index file, each line represents a subject.
71The first category in each subject is the pathname of the data file for
72the subject.
73The remaining categories are regular expressions for the titles of each
74category in the subject.
75.Pp
76In data files, each line represents a question/answer set.
77Each category is the information for the question/answer for that category.
78.Pp
79The backslash character (``\e'') is used to quote syntactically significant
80characters, or at the end of a line to signify that a continuation line
81follows.
82.Pp
83If either a question or its answer is empty,
84.Nm quiz
85will refrain from asking it.
86.Sh FILES
87.Bl -tag -width /usr/share/games/quiz.db -compact
88.It Pa /usr/share/games/quiz.db
89The default index and data files.
90.El
91.Sh BUGS
92.Nm Quiz
93is pretty cynical about certain subjects.
94