-->

Previous | Table of Contents | Next

Page 285

Want the challenge of a good chess game? Try the gnuchess program, which plays an extremely strong game of chess. You'll find several versions of this game installed on your system. The gnuchess version uses cursor addressing to provide a basic graphic display. The gnuchessr version scrolls each board after successive moves, and uses reverse video and cursor addressing for a fancier display.

Moves are entered by specifying the column and row as a letter and number. For example,


Computer                                 GNU Chess



  +——+——+——+——+——+——+——+——+

8 | *R | *N | *B | *Q | *K | *B | *N | *R |

  +——+——+——+——+——+——+——+——+  Playing without hashfile

7 | *P | *P | *P | *P | *P | *P | *P | *P |

  +——+——+——+——+——+——+——+——+

6 |    |    |    |    |    |    |    |    |

  +——+——+——+——+——+——+——+——+

5 |    |    |    |    |    |    |    |    |

  +——+——+——+——+——+——+——+——+

4 |    |    |    |    |    |    |    |    |

  +——+——+——+——+——+——+——+——+   1:   White

3 |    |    |    |    |    |    |    |    |

  +——+——+——+——+——+——+——+——+

2 |  P |  P |  P |  P |  P |  P |  P |  P |

  +——+——+——+——+——+——+——+——+

1 |  R |  N |  B |  Q |  K |  B |  N |  R |  Your move is?

  +——+——+——+——+——+——+——+——+

    a    b    c    d    e    f    g    h



    Human

To move the pawn up two squares from the lower rank, enter e2, and press the Enter key. The computer then makes its move, and new piece positions are updated on your display. The gnuchess program has more than 23 command-line options, and features display play modes, hints, and timed games. For more information, see the gnuchess manual page.

Playing Emacs Games

The venerable emacs editor (discussed in Hour 14, "Text Processing") not only edits text, reads mail, and handles your appointments, but also comes with 18 wacky games and modes that you can use to pass the time, such as doctor, dunnet, psychoanalyze-pinhead, and yow.

Start an emacs game by holding down the Alt key, then pressing the x key on your keyboard. In the command prompt at the bottom of your emacs screen type in one of the following, and then press the Enter key: blackbox, cookie1, dissociate, doctor, dunnet, hanoi, life,

Page 286

mpuz, solitaire, spook, or yow.

The best way to play dunnet, a text adventure, is to use emacs from the command line:


# emacs -batch -l dunnet

Dead end

You are at a dead end of a dirt road.  The road goes to the east.

In the distance you can see that it will eventually fork off.  The

trees here are very tall royal palms, and they are spaced equidistant

from each other.

There is a shovel here.

>

This command line starts the game. At the > prompt, enter commands such as inventory, look, or go east. To end the adventure, enter the word quit. You'll find more games for emacs in the /usr/share/emacs/20.2/lisp/play directory. For more details, you also can peruse the source code for the games by installing emacs' LISP source.

Games for the X Window System

In this section you'll be introduced to several games for X11. There are more than two dozen you can play, but rather than discussing them all, the following pages highlight several of the best games for strategy and action.

If you like playing board games, you're in luck! There are several good board games for the X Window System on this book's CD-ROM. Want more action? Try some of the video arcade games—you're sure to find some you like. The following is a list of just a few arcade games:

Playing Chess with the xboard Client

Chess is a classic game, and one of the major challenges you can face is playing chess against your computer. To play chess in X11, use the xboard client. This program can use the GNU

Page 287

Figure 19.2.
The xboard X11 client
plays chess on your
display, over the
Internet, or through
electronic mail.


chess engine, and play chess over the Internet or through electronic mail (see Figure 19.2).

The xboard client recognizes many X11 Toolkit options, such as geometry settings, and has 54 different command-line options. If you have a display less than 1024¥768 pixels, you should use the -size or -boardSize small command-line option to fit the board on your screen:


# xboard -size small &

This command line starts xboard using smaller chess pieces. For more details about using xboard, see the xboard and gnuchess manual pages.

Playing X11 Solitaire

If you enjoy playing card solitaire games, you'll like the xpat2 X11 client. This program features 14 different solitaire games with scoring, hints, built-in help, and sound (see Figure 19.3).

The xpat2 game, by Heiko Eissfeldt and Michael Bischoff, is found under the /usr/X11R6/bin directory. For more details, read the xpat2 manual page.

Playing Backgammon for X11

For backgammon fanatics, the xgammon game will produce hours of fun and practice. This game, by Lambert Klasen and Detlef Steuer, requires the X Window System, and runs comfortably on an 800¥600 pixel display (see Figure 19.4).

The xgammon client has 21 different command-line options. For an interesting variation, try watching your computer play itself:


# xgammon -g cvc &

Page 288

Figure 19.3.
The xpat2 solitaire
game for X11 features
14 different card
games.


Figure 19.4.
The xgammon game
for X11 features
several types of play,
such as computer
against human, and
provides a challenging
game.


This starts the xgammon game so you can watch the action. You also can create your own challenging games by editing the board and placing backgammon stones in different positions before play. For details about xgammon, read its manual page.

Playing Galaga for X11

Video action arcade games can be a lot of fun, especially if they have great graphics and sound. If you like shoot-em-ups, you'll love the xgal game by Joe Rumsey. This X11 client features a spiffy interface, and can be played by using your mouse or keyboard.

The xgal program has six different command-line options, but you can start the program without any at a terminal window by typing the following:


# xgal &

Previous | Table of Contents | Next