nolan — Nolan chart quiz program




This program administers the Nolan-chart quiz, otherwise known as the World's Smallest Politicakl Quiz.


This program is partly generated from the script file nolan.script via the shell command file `compilescript'. The script markup contains most of the quiz's control information, which compilescript turns into C code to be included in nolan.c.

Each script is a sequence of screens delimited by the commands @screen and @endscreen on lines by themselves. The @screen command should be followed by a screen name When each screen is displayed. and after any questions have been ansered, the program will display an end-of-page prompt at the lower right and wait for a user keystroke to continue. The @endscreen command takes an argument which is used in the C code as a place to put the accumulated page score; if the argument is NULL the page score is ignored.

Within screens, the special commands @center, @diamond and @exitprompt are available. The @center command, followed by a space, followed by text, causes that text to be centered on the line. The @diamond enables display of the user's location on a following diamond chart; the @scattergram command generates a scattergram summarizing the running BBS's history with the quiz. More about these below. The @exitprompt command changes the end-of-page prompt.

Within text, the following brackets are available for highlighting text:

  @c{} --- make foreground color black (not very useful)
  @b{} --- make foreground color blue
  @g{} --- make foreground color green
  @r{} --- make foreground color red
  @y{} --- make foreground color yellow
  @c{} --- make foreground color cyan
  @m{} --- make foreground color magenta
  @w{} --- make foreground color white
  @B{} --- make foreground color bright blue
  @G{} --- make foreground color bright green
  @R{} --- make foreground color bright red
  @Y{} --- make foreground color bright yellow
  @C{} --- make foreground color bright cyan
  @M{} --- make foreground color bright magenta
  @W{} --- make foreground color bright white

Highlight brackets may be nested; the right thing will happen.

The special command @standout{n} (on a line by itself, with n one of the above highlight letters) changes the standot highlight used for question answers, the end-of-page prompt, and the chart asterisk. The default is `Y'.

The special command @before declares the message to be emitted if the code can detect that the user has taken the test before. The text following it (after a space) becomes the re-test mesage; otherwise a blank line is emitted. Re-tests are detected by examining the score file.

The special command @dispatch arranges for the next @endscreen to send the user to one of four screens depending on his/her Nolan-chart political type. The screens are those with embedded @authoritarian, @conservative, @centrist, @left-liberal, and @libertarian.

The %NN escape substitutes in the number of people in the score file (this is meant to be used with the @scattergram command).

The %EE and %PP escapes substitute in the user's economic and personal scores as three-digit numbers. Note: these scores will be zero until the page after where they're calculated!

The @q{} escape accepts a question. When the screen is displayed, the cursor will move to the first @q location and wait for the user to type either y, m, or n. Then it will move to the next, and through the others in order. On a page with @q{} commands, the end-of-page prompt does not appear until all questions are answered.

Each 'y' is counted 20, each 'm' 10, and each 'n' zero. If the name of the page is "ECONOMIC", the page score becomes the user's economic score for purposes of the %EE escape and subsequent @diamond commands. Likewise for the screen named "PERSONAL", the personal score, and the %PP escape.

The @diamond command uses the personal and economic scores. It assumes that it's followed by a 45-degree tilted grid of periods, possibly with other characters and highlights embedded in it. The program will put a highlighted asterisk on the grid point corrsponding ro the user's score. Note: the grid may not contain embedded lines with no dots (which would confuse the diamond command's vertical count), nor any periods in surrounding text (this would confuse the horizontal count).

The @scattergram command generates a scattergram based in the contents of the score file. It shows the distribution of respondents, printing a number on each grid point where a non-zero number have ended up.


The program maintains a score file in order to detect people taking the quiz for the second or subsequent time and to generate the population scattergram. The file is named "nolan.sco". Each line consists of three colon-separated fields; user name, personal score, economic score.


The program does a first pass through the script before attempting to display any of it. If it detects any script syntax errors, you will get error messages with a line-number indication and no quiz display.


@q{} arguments are not yet interpreted. Someday each one will be the name of an info screen to jump to if the user replies to the question with a '?'.

The scattergram colors are hard-coded.


Eric S. Raymond ; August 1993.