⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0285-0288.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:






<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311623:SAMS TEACH YOURSELF LINUX IN 24 HOURS:Playing Linux Games</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=SAMS TEACH YOURSELF LINUX IN 24 HOURS //-->

<!-- AUTHOR=BILL BALL, STEPHEN SMOOGEN //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=19 //-->

<!-- PAGES=0281-0290 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->







<P><CENTER>

<a href="0281-0284.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0289-0290.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-285"><P>Page 285</P></A>







<P>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.

</P>



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

</P>



<!-- CODE //-->

<PRE>

Computer                                 GNU Chess



  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+

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

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+  Playing without hashfile

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

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+

6 |    |    |    |    |    |    |    |    |

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+

5 |    |    |    |    |    |    |    |    |

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+

4 |    |    |    |    |    |    |    |    |

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+   1:   White

3 |    |    |    |    |    |    |    |    |

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+

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

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+

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

  +&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+&#151;&#151;+

    a    b    c    d    e    f    g    h



    Human

</PRE>

<!-- END CODE //-->



<P>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.

</P>



<H4><A NAME="ch19_ 6">

Playing Emacs Games

</A></H4>



<P>The venerable emacs editor (discussed in Hour 14, &quot;Text Processing&quot;) 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.

</P>



<P>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,

</P>

<A NAME="PAGENUM-286"><P>Page 286</P></A>







<P>mpuz, solitaire, spook, or yow.

</P>



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

</P>

<!-- CODE //-->

<PRE>

# 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.

&gt;

</PRE>

<!-- END CODE //-->



<P>This command line starts the game. At the &gt; 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.

</P>



<H3><A NAME="ch19_ 7">

Games for the X Window System

</A></H3>



<P>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.

</P>



<P>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&#151;you're sure to find some you like. The following is a list of just a few

arcade games:

</P>



<UL>

<LI>          acm&#151;Aerial combat simulator for X11

<LI>          paradise&#151;A networked combat game

<LI>          xbill&#151;Quash a familiar face before &quot;another&quot; operating system is installed

on your computer

<LI>          xchomp&#151;Classic Pac-Man-like game

<LI>          xdemineuer&#151;Minesweep-type game

<LI>          xjewel, xtrojka, cxhextris, xbl&#151;Tetris-like games

<LI>          xlander&#151;A lunar lander game

<LI>          xpilot&#151;Networked combat game

<LI>          xpuzzles&#151;A series of puzzle games for X11

</UL>



<H4><A NAME="ch19_ 8">

Playing Chess with the xboard Client

</A></H4>



<P>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

</P>

<A NAME="PAGENUM-287"><P>Page 287</P></A>







<P>Figure 19.2.<BR>

The xboard X11 client<BR>

plays chess on your<BR>

display, over the<BR>

Internet, or through<BR>

electronic mail.</P>

<P><a href="javascript:displayWindow('images/ch19fg02.jpg', 128, 165)"><img src="images/tn_ch19fg02.jpg"></a><BR>

</P>



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

</P>



<P>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&#165;768 pixels, you should use the -size or -boardSize

small command-line option to fit the board on your screen:

</P>



<!-- CODE SNIP //-->

<PRE>

# xboard -size small &amp;

</PRE>

<!-- END CODE SNIP //-->



<P>This command line starts xboard using smaller chess pieces. For more details about

using xboard, see the xboard and gnuchess manual pages.

</P>



<H4><A NAME="ch19_ 9">

Playing X11 Solitaire

</A></H4>



<P>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).

</P>



<P>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.

</P>



<H4><A NAME="ch19_ 10">

Playing Backgammon for X11

</A></H4>



<P>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&#165;600 pixel display (see Figure 19.4).

</P>



<P>The xgammon client has 21 different command-line options. For an interesting

variation, try watching your computer play itself:

</P>



<!-- CODE SNIP //-->

<PRE>

# xgammon -g cvc &amp;

</PRE>

<!-- END CODE SNIP //-->



<A NAME="PAGENUM-288"><P>Page 288</P></A>







<P>Figure 19.3.<BR>

The xpat2 solitaire<BR>

game for X11 features<BR>

14 different card<BR>

games.</P>

<P><a href="javascript:displayWindow('images/ch19fg03.jpg', 288, 216)"><img src="images/tn_ch19fg03.jpg"></a><BR>

</P>



<P>Figure 19.4.<BR>

The xgammon game<BR>

for X11 features<BR>

several types of play,<BR>

such as computer<BR>

against human, and<BR>

provides a challenging<BR>

game.</P>

<P><a href="javascript:displayWindow('images/ch19fg04.jpg', 288, 122)"><img src="images/tn_ch19fg04.jpg"></a><BR>

</P>



<P>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.

</P>



<H4><A NAME="ch19_ 11">

Playing Galaga for X11

</A></H4>



<P>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.

</P>



<P>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:

</P>



<!-- CODE SNIP //-->

<PRE>

# xgal &amp;

</PRE>

<!-- END CODE SNIP //-->



<P><CENTER>

<a href="0281-0284.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0289-0290.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -