The cardwords game - Running cardwords

[back] [Abstract] [Copyright Notice] [Contents]

# The cardwords game - Chapter 4
Running cardwords

This chapter describes how to run cardwords using the gtk client `cardwords_gtkclient`. The client's user interface urgently needs to be improved, but as long as it is as unfriendly as by now, this chapter will guide you through the program.

While running X, type `cardwords_gtkclient`, or type the full path of the programm, if the directory where you installed it is not in your `PATH` environment variable.

After the program starts, you will see a dialog where you can set options.

## 4.1 The option settings

I will now explain this dialog which is divided into several parts:

### 4.1.1 Identity

The fields in this dialog are:

Your name:
  You have to fill in your name here. This name will show up later in every human player's client programs. The computer fills your user name in here as a default, but you can change the name. The name must not contain white space.

Alternative name:
  Several human players can participate in the same game. All must have different names. You can give another name here that will be used when your first name is already used by someone else. This way you can avoid the client asking you for another name. (Currently, it will not ask you for another name.) You can leave this field blank. The alternative name must not contain white space.

### 4.1.2 Appearance

The fields in this dialog are:

Card width:
  Some `xwindows` programs open a window that is larger than your screen, while other ones use so little room on the screen that you might want to switch to a lesser screen resolution. This is an attempt to let the user decide how much room the window will occupy, however it is very incomplete. You can only change the size (in pixels) a card will occupy on the screen. This will also change the fonts used inside the cards and card-table cells, but it does not affect the fonts used in other places of the window. And if you have no idea about the width and height of the card-table grid, you will have no clue which values to use here. This has to change in the future.

Card height:
  Should be equal or nearly equal to card width, because square cards look best when forming words with them in a crossword way.

Use digits for the columns
  You can choose if you want to have coodinates with digits for the columns and characters for the rows or the other way round.

Column indices grow rightwards
  If you want the leftmost column to have the least index (`A' or `1'), check this button.

Row indices grow upwards
  If you want the bottom-most row to have the least index (`A' or `1'), check this button.

### 4.1.3 Local server options

The fields in this dialog have the following meaning:

Server program:
  This is the location where the `cardwords_server` executable file is installed. If you compiled the program with make and installed it with make install, the computer will fill in the correct location here. You should not change it.

Charset file:
  The location of the charset file you want to use for this game, see The charset file, section 3.1 for an explanation of charset files.

Cardset file:
  The location of the cardset file you want to use for this game, see The card set file, section 3.3 for an explanation of cardset files.

Card-table file:
  The location of the card-table file you want to use for this game, see The card-table file, section 3.4 for an explanation of card-table files.

Bonus file:
  The location of the bonus file you want to use for this game, see The bonus file, section 3.5 for an explanation of bonus files.

Dictionary file:
  The location of a read-only dictionary file you want to use for this game, see The dictionary files, section 3.2 for an explanation of dictionary files.

Personal dictionary file:
  The location of a dictionary file to which new words that are added during the game will be appended, see The dictionary files, section 3.2 for an explanation of dictionary files.

Number of human players:
  The number of players who can connect to the server, should be at least 1, because you want to play. You can choose any number of players you like as long as there are enough cards in the card set so that every player has a full hand of cards at least when the game starts.

Number of robot players:
  The number of robot players that the server creates. The robots are named Robot1 ... RobotN. You can choose any number of robots you like as long as there are enough cards in the card set so that every player has a full hand of cards at least when the game starts.

Number of watchers:
  The number of watchers who can connect to the server and observe the game without playing. You should leave the 0 the computer filled in untouched because logging in as a watcher does not work yet.

Port number:
  The number of the tcp port that the server listens to. If you have once started a server and are now trying to start a new one, change it a bit, and exec `killall cardwords_server` regularly between restarts. Running servers are sometimes left over when the client exits (remember, it's in alpha state), and a new server usually can not use the same port as another server uses already or has used until a few minutes ago.

### 4.1.4 Remote server

Here you see a dialog where you can set the host name and port number of the remote `cardwords_server`.

Set these if you want to connnect to a `cardwords_server` that is already running somewhere.

## 4.2 Playing the game

You can save all options that you have set or start a local server or connect to a remote server or exit the program by clicking on the appropriate button. Use the `Start a local server'-button if you want to play a game against the computer.

If everything went well, you will now see a window displaying the card-table and some other info.

When all human players have logged on, the game starts.

### 4.2.1 The game window

You can see the card-table in the upper left area of the window. When most cells in the card-table grid are set to their default values, as I proposed in The card-table file, section 3.4, the board will appear mostly green. This is because I think card-tables in casinos always have a green surtface (but I have not seen one yet).

Cell attributes different from the default values are displayed inside the cells on a background of a different color. You can recognize cell points by the letter `C', word factors by the letter `W', and letter factors by the letter `L'.

All info about the cell currently under the mouse pointer is shown in the upper right corner of the window.

Below this, there is the score board. It shows whose go it is, how many points and cards every player has, how many points everyone got in the last round, and of course the names of the other players. The column entitled `Type' contains a `H' if this is a human player and an `R' if that player is a robot. When the network connection to a particular player breaks, then this player will become a robot.

One row in the score board is automatically highlighted when the game runs. This line indicates whose go it is.

Below the score board you can see a single line telling you how many cards are left in the pile.

The client can tell you what cards are there at all in the game or what cards can still be in the pile (or in the other players' hands) by opening two windows showing lists. Access these lists via the menu.

And now to the most important thing in this game: How to tell the game what move/trade/pass you want to do next.

On the lowest line in the window you can see the cards in your hand. When you click with the mouse on one of these cards, it usually[8] moves to the line above the hand. I call this line the action selection area.

You use the action selection area to decide whether you move, trade or pass and which card to use. And where to move in the case of a move.

While you can do moves and passes alone with mouse-clicking (except for the wildcards), you might have difficulties trying to trade card(s) this way. That is why I will first tell you about the `keyboard way' to do things in the action selection area in the following subsection:

### 4.2.2 Composing moves, trades and passes with the action selection area

Let me first describe what you see in the action selection area. The action selection area consists of the following items (from left to right):

The current card-table location display:
  This display shows the current card-table location. Moves will start at the card-table grid cell with these coordinates. The order of the coordinate pair (consisting of a character and a number) has a special meaning: Whatever coordinate appears first will be one coordinate of every card that you move. That means you are restricted to a single row or column of the card table with one move.[9]

  There are braces around the coordinate pair whenever the current state of the action selection area is not a move, but a trade or a pass. This happens in either of the following cases:

  - when there are no cards inside the action selection area. Pressing the `OK` button in this state will result in a pass.

  - when the cards would not fit on the card-table if a move started from this location.

  - when the card table is empty and a move starting from this location would not obeye the start condition.

  - when the user explicitly wants to trade cards.

  In all these cases, when there are braces around the coordinate pair, pressing the `OK` button while there are cards inside the action selection area will result in trading these cards, or, if there are no cards in the action selection area, pressing the `OK` button will result in a pass.

The composing area
  consists of card cells that contain your cards while you are composing your move or trade. When you want to get rid of a that is already in this area, you can click on it with the mouse or, if it is the last card, remove it with the backspace key.

The direction button:
  By pressing this button you can change the direction of your move. The button's label tells you if you are currently composing a horizontal move or a vertical move. Note that the order of the coordinates in the current card-table location display changes accordingly when you press this button.

The `OK` button
  can be pressed when you have finished your action selection.

I will now describe how to use the action selection area via the keyboard:

The action selection area is roughly in two different states: it expects either a coordinate pair or a card specification.

When your go begins, it expects a coordinate pair. If you want to make a move, and I think this is what you want most of the time, you can now change the current card-table location. type in a character and a number, in an order so that the coordinate which is common to all the card destinations of this move comes first.[10]

If you do not want to make a move, but rather a trade, you can invalidate the current card-table location by typing the point `.'. The current card-table location will then be shown with braces around and the button that previously held the label `vertical` or `horizontal` will be empty.

After typing the current card-table location or invalidating it, the action selection area is in card input mode.

You can then specify the cards that you want to move or trade by first typing their meaning, and in case this is not to uniquely identify any card from your hand because there are cards with the same face value but different points, type in the card's points thereafter. As soon as the program recognizes which card you mean, it will be moved to the composing area.

Specify wildcards by first typing space, then the desired meaning of the wildcard (even when you want to trade the card, in which case the meaning is irrelevant), and, if this was again not enough to identify the wildcard because there are wildcards with different points on your hand, type in the points of the desired card.

You can remove the last card from the composing area by typing the backspace key while in card input mode.

You can change the current card-table location while in card input mode by typing once `.' and then typing the new card-table location.

You can change a move into a trade while in card input mode by twice typing `.': The first `.' sets the state of the action selection area to expecting a new card-table location, the second `.' invalidates the current card-table location.

You can change a trade into a move while in card input mode by typing `.' followed by the new card-table location.

You can change the direction of a move by typing `/'.

Finish your go by typing return.

With the info in the previous subsection, I think you can find out how to do your moves with the mouse. But one thing has not yet been mentioned: You can change the current card-table location with the mouse by clicking in the desired cell in the card-table.

### 4.2.3 Valid moves and score-counting

The first move has to obeye the start condition, see The card-table file, section 3.4. Subsequent moves must touch at least one card that is already on the card-table.

All words created by the new move must be valid, ie they have to be contained in the server's dictionary and have to have a length of at least 2 characters.

If a player tries a move that creates a word that is unknown to the server, the owner of the server (the player that started the server) will be asked if he liked to add this word to the dictionary of known words. The player whose move was rejected can try another move or trade or pass, or wait until the owner adds the missing word and then retry the previous move. Players will not be notified about new words. Use an irc client to communicate with the other human players or whatever you like.

When making a move, all cell points of the cells that are being covered by the new cards are directly added to the moving players score. The points of the cards he moves are counted word-wise: for every new word that is being created the points of the new cards are first multiplied with the cell's letter factor. The products are then summed up. The plain points of all cards that have already been on the board before this move are added to this sum. This sum is then subsequently multiplied with every newly occupied cell's word factor. When the sum has been multiplied with each and every of these word factors, the result is also added to the player's points.

The winner is the player with the most points in the end. But the game has currently no end. This will change.

Have fun!

[back] [Abstract] [Copyright Notice] [Contents]

The `cardwords` game