1*60836Sbostic.\" Copyright (c) 1991, 1993 2*60836Sbostic.\" The Regents of the University of California. All rights reserved. 320906Smckusick.\" 451609Sbostic.\" This code is derived from software contributed to Berkeley by 551609Sbostic.\" Jim R. Oldroyd at The Instruction Set. 647862Sbostic.\" 751609Sbostic.\" %sccs.include.redist.roff% 851609Sbostic.\" 9*60836Sbostic.\" @(#)quiz.6 8.1 (Berkeley) 05/31/93 1051609Sbostic.\" 1151609Sbostic.Dd 1251609Sbostic.Dt QUIZ 6 1351609Sbostic.Os 1451609Sbostic.Sh NAME 1551609Sbostic.Nm quiz 1651609Sbostic.Nd random knowledge tests 1751609Sbostic.Sh SYNOPSIS 1851609Sbostic.Nm quiz 1951609Sbostic.Op Fl t 2051609Sbostic.Op Fl i Ar file 2151609Sbostic.Op Ar question answer 2251609Sbostic.Sh DESCRIPTION 2320906SmckusickThe 2451609Sbostic.Nm quiz 2551609Sbosticutility tests your knowledge of random facts. 2651609SbosticIt has a database of subjects from which you can choose. 2751609SbosticWith no arguments, 2851609Sbostic.Nm quiz 2951609Sbosticdisplays the list of available subjects. 3051609Sbostic.Pp 3151609SbosticThe options are as follows: 3251609Sbostic.Bl -tag -width indent 3351609Sbostic.It Fl t 3451609SbosticUse tutorial mode, in which questions are repeated later if you didn't get 3551609Sbosticthem right the first time, and new questions are presented less frequently 3651609Sbosticto help you learn the older ones. 3751609Sbostic.It Fl i 3851609SbosticSpecify an alternate index file. 3951609Sbostic.El 4051609Sbostic.Pp 4151609SbosticSubjects are divided into categories. 4251609SbosticYou can pick any two categories from the same subject. 4351609Sbostic.Nm Quiz 4451609Sbosticwill ask questions from the first category and it expects answers from 4551609Sbosticthe second category. 4651609SbosticFor example, the command ``quiz victim killer'' asks questions which are 4751609Sbosticthe names of victims, and expects you to answer with the cause of their 4851609Sbosticuntimely demise, whereas the command ``quiz killer victim'' works the 4951609Sbosticother way around. 5051609Sbostic.Pp 5151609SbosticIf you get the answer wrong, 5251609Sbostic.Nm quiz 5351609Sbosticlets you try again. 5451609SbosticTo see the right answer, enter a blank line. 5551609Sbostic.Sh "Index and Data File Syntax" 5651609SbosticThe index and data files have a similar syntax. 5751609SbosticLines in them consist of several categories separated by colons. 5851609SbosticThe categories are regular expressions formed using the following 5951609Sbosticmeta-characters: 6051609Sbostic.sp 6151609Sbostic.Bl -tag -width "pat|pat" -compact -offset indent 6251609Sbostic.It pat|pat 6351609Sbosticalternate patterns 6451609Sbostic.It {pat} 6551609Sbosticoptional pattern 6651609Sbostic.It [pat] 6751609Sbosticdelimiters, as in pat[pat|pat]pat 6851609Sbostic.El 6951609Sbostic.Pp 7051609SbosticIn an index file, each line represents a subject. 7151609SbosticThe first category in each subject is the pathname of the data file for 7251609Sbosticthe subject. 7351609SbosticThe remaining categories are regular expressions for the titles of each 7451609Sbosticcategory in the subject. 7551609Sbostic.Pp 7651609SbosticIn data files, each line represents a question/answer set. 7751609SbosticEach category is the information for the question/answer for that category. 7851609Sbostic.Pp 7951609SbosticThe backslash character (``\e'') is used to quote syntactically significant 8051609Sbosticcharacters, or at the end of a line to signify that a continuation line 8151609Sbosticfollows. 8251609Sbostic.Pp 8351609SbosticIf either a question or its answer is empty, 8451609Sbostic.Nm quiz 8520906Smckusickwill refrain from asking it. 8651609Sbostic.Sh FILES 8751609Sbostic.Bl -tag -width /usr/share/games/quiz.db -compact 8851609Sbostic.It Pa /usr/share/games/quiz.db 8951609SbosticThe default index and data files. 9051609Sbostic.El 9151609Sbostic.Sh BUGS 9251609Sbostic.Nm Quiz 9351609Sbosticis pretty cynical about certain subjects. 94