# &kblackbox; Game Manual

## What is &kblackbox;?

&kblackbox; is a superb :-) graphical logical game, inspired by the emacs blackbox game. A major part of this help file is based on the original emacs help.

&kblackbox; is a game of hide and seek played on a grid of boxes. Your opponent (the Random number generator, in this case) has hidden several balls within this box. By shooting rays into the box and observing where they emerge it is possible to deduce the positions of the hidden balls. The fewer rays you use to find the balls, the better (the lower) your score.

## Game Description

In the first part of this section a description of the game board will be given. The second part deals with user interaction with the game board and finally in the third part the actual game rules are explained.

### Game Board Description

The following types of field are found on the game board:

Black squares

- The black box. Here you must mark the squares you think a ball is in.

Green squares

- These are the lasers, shooting rays of light when switched on.

Light Gray squares

- Nothing here of interest, this is just a border :-).

Blue balls

- There must be one there! you think. These mark where you suspect a ball is placed in the black box.

Cyan balls

- Show where the balls actually are.

Red balls

- Incorrectly positioned balls you have marked are indicated in red.

Brown squares

- Marking color

The names of colors are used just for identifying the different types of the fields in this text. They might not be in any relation with the actual color of the fields. Simply said: the black box is in the center, around are the lasers and around them is the border. Remap the colors yourself :-).

### User Interaction

The cursor can be moved around the box with the standard cursor movement keys or the mouse. Switching of lasers or marking of black boxes is done with the &LMB;, or by pressing the Return or &Enter; key.

You can mark the fields where you think a ball cannot be, too. Just press the &RMB;. It often helps you to find an area where a ball could possibly be. To clear any marks (blue or brown) press the &LMB;. Brown marks cannot overwrite blue marks. This way you cannot erase the blue marks (guessed balls) by accident when playing with the &RMB;.

When you think the configuration of balls you have placed is correct, press the &MMB;. You will be informed whether you are correct or not, and be given your score. Your score is the number of letters and numbers around the outside of the box plus five for each incorrectly placed ball. If you placed any balls incorrectly, they will be indicated with red fields, and their actual positions indicated with cyan fields.

### Game Rules

You have to find balls hidden in the black box. Your means are limited - you can just fire lasers which are around the box. There are three possible outcomes for each ray you send into the box:

Detour

- The ray is deflected and emerges somewhere other than where you sent it in. On the playfield, detours are denoted by matching pairs of numbers - one where the ray went in, and the other where it came out.

Reflection

- The ray is reflected and emerges in the same place it was sent in. On the playfield, reflections are denoted by the letter R.

Hit

- The ray strikes a ball directly and is absorbed. It does not emerge from the box. On the playfield, hits are denoted by the letter H.

The rules for how balls deflect rays are simple and are best shown by example.

As a ray approaches a ball it is deflected ninety degrees. Rays can be deflected multiple times. In the diagrams below, the dashes represent empty box locations and the letter O represents a ball. The entrance and exit points of each ray are marked with numbers as described under Detour above. Note that the entrance and exit points are always interchangeable. * denotes the path taken by the ray.

Note carefully the relative positions of the ball and the ninety degree deflection it causes.

        1
      - * - - - - - -         - - - - - - - -         - - - - - - - -
      - * - - - - - -         - - - - - - - -         - - - - - - - -
    1 * * - - - - - -         - - - - - - - -         - O - - - - O -
      - - O - - - - -         - - O - - - - -         - - * * * * - -
      - - - - - - - -         - - - * * * * * 2     3 * * * - - * - -
      - - - - - - - -         - - - * - - - -         - - - O - * - -
      - - - - - - - -         - - - * - - - -         - - - - * * - -
      - - - - - - - -         - - - * - - - -         - - - - * - O -
                                    2                         3

As mentioned above, a reflection occurs when a ray emerges from the same point it was sent in. This can happen in several ways:

      - - - - - - - -         - - - - - - - -          - - - - - - - -
      - - - - O - - -         - - O - O - - -          - - - - - - - -
    R * * * * - - - -         - - - * - - - -          O - - - - - - -
      - - - - O - - -         - - - * - - - -        R - - - - - - - -
      - - - - - - - -         - - - * - - - -          - - - - - - - -
      - - - - - - - -         - - - * - - - -          - - - - - - - -
      - - - - - - - -       R * * * * - - - -          - - - - - - - -
      - - - - - - - -         - - - - O - - -          - - - - - - - -

In the first example, the ray is deflected downwards by the upper ball, then left by the lower ball, and finally retraces its path to its point of origin. The second example is similar. The third example is a bit anomalous but can be rationalized by realizing the ray never gets a chance to get into the box. Alternatively, the ray can be thought of as being deflected downwards and immediately emerging from the box.

A hit occurs when a ray runs straight into a ball:

      - - - - - - - -         - - - - - - - -          - - - - - - - -
      - - - - - - - -         - - - - - - - -          - - - - O - - -
      - - - - - - - -         - - - - O - - -        H * * * * - - - -
      - - - - - - - -       H * * * * O - - -          - - - * - - - -
      - - - - - - - -         - - - - O - - -          - - - O - - - -
    H * * * O - - - -         - - - - - - - -          - - - - - - - -
      - - - - - - - -         - - - - - - - -          - - - - - - - -
      - - - - - - - -         - - - - - - - -          - - - - - - - -

Be sure to compare the second example of a hit with the first example of a reflection.

## &GUI; description

### The Game Menu

&Ctrl;N Game New

- Starts a new game (and abandons the current, if any.)

Game Give Up

- Shows you positions of the balls.

Game Done

- Checks whether all balls are placed. If yes, it terminates the current game, computes the final score and indicates real positions of the balls. The middle mouse button has the same function.

Game Resize

- Resizes the main window, so that its contents fit perfectly. This is useful when you accidentally change the size of the window...

&Ctrl;Q Game Quit

- Quits &kblackbox;

### The Settings Menu

Settings Show/Hide Toolbar

- Shows or hides the &kblackbox; toolbar.

Settings Show/Hide Statusbar

- Shows or hides the &kblackbox; status bar at the base of the screen.

Settings Size

- Sets the size of the game field (black box). You may choose between 8 x 8, 10 x 10 and 12 x 12. The default is 8 x 8.

Settings Balls

- Sets the number of balls in the black box. You may choose between 4 (the default), 6 or 8.

Settings Tutorial

- Switches the tutorial mode on or off. In tutorial mode, you can see where the balls actually are. Note that you have to start a new game for this change to take effect.

Settings Configure Shortcuts...

- Displays a standard &kde; shortcut configuration dialog, in which you can change the keyboard shortcuts used by &kblackbox;.

Settings Configure Toolbars...

- Brings up the standard &kde; toolbar configuration dialog to customize the &kblackbox; toolbar.

### The Help Menu

&help.menu.documentation;

### The Toolbar

&kblackbox;'s toolbar

The &kblackbox; toolbar offers quick access to the most commonly used &kblackbox; functions. From left to right, the icons are:

New

- Starts a new game.

Give Up

- Shows you positions of the balls.

Done

- Checks whether all balls are placed. If yes, it terminates the current game, computes the final score and indicates real positions of the balls. The middle mouse button has the same function.

## Credits and License

&kblackbox;

Program Copyright 1998-2000 &Robert.Cimrman; &Robert.Cimrman.mail;

Documentation by &Robert.Cimrman;. Updated and converted to Docbook for &kde; 2.0 by &Lauri.Watts; &Lauri.Watts.mail;

Current maintainer &Philip.Rodrigues; &Philip.Rodrigues.mail;

&underFDL; &underGPL;

## Installation

&install.intro.documentation;

### Compilation and Installation

&install.compile.documentation;