This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
revers2a.htm
65 lines (65 loc) · 3.99 KB
/
revers2a.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Keith Fenske">
<meta name="GENERATOR" content="Mozilla/4.8 [en] (Windows NT 5.0; U) [Netscape]">
<title>Reversi or Othello Game - by: Keith Fenske</title>
</head>
<body background="ffcccc.gif">
<center><applet code="Reversi2.class" archive="revers2b.jar" width="95%" height="90%">
<p><b><font size=+1>Sorry, your browser does not support Java.</font></b></applet></center>
<p>This web page is a Java applet to play the board game of Reversi, also
known as Othello. ("Othello" is a registered trademark. Since
1976 in the <a href="http://www.uspto.gov/">United States</a>, the legal
owner is Tsukuda Co. Ltd. of Japan, assigned to Anjar Co. in New York.
Mattel Inc. once held a trademark for "Reversi" as a video game but that
expired in 1989. There is no current trademark in the United States
for "Reversi" as a board game.)
<p>The playing board is a rectangular grid. Your positions are shown
as black circles. Positions occupied by the computer are shown in
white. You move first.
<p>A legal move is any empty position that traps one or more of the computer's
positions in a straight line (horizontal, vertical, or diagonal) between
the empty position and another of your positions. The trapped positions
are then "flipped" (reversed) and become your positions. To help
you, legal moves are highlighted when you hold the mouse over an empty
position.
<p>If you can't move, then you lose your turn and the computer moves next.
The game ends when nobody can move. The player with the most occupied
positions is the winner.
<p>You may change the size of the game board. The number of rows
and columns may be changed independently. The standard size is 8x8.
You may also select "easy" or "medium" difficulty. On "easy" play,
the computer moves randomly. On "medium" play, the computer flips
the maximum number of positions.
<p>A more difficult level has not been implemented. This would require
hundreds or thousands of lines of additional code to develop a better <a href="http://free.pages.at/xmav/data/strategy1/strategy1.pdf">strategy</a>.
The extra code would detract from this game's primary purpose, which is
to demonstrate graphical Java programming. Should you feel like doing
the work, the program does contain hooks for two additional levels called
"hard" and "expert".
<p><hr>
<p><a NAME="java"></a>If this web page begins with an error message saying
that your browser does not support Java, then either your computer doesn't
have Java, or Java is not enabled. If you see an empty rectangle
where the applet should be, then you have Java but need a newer browser
or a newer version of Java. For Internet Explorer 5 or later, Firefox,
Mozilla, and Netscape 7.x or later on Windows, you may download the Sun
Java run-time environment (JRE) from <a href="http://www.java.com/getjava/">http://www.java.com/getjava/</a>
on Sun's web site. This program was written on and tested against
Sun Java 1.4.
<p>The <a href="revers2c.txt">source code</a> for this applet is available,
even though writing a similar Java program is an assignment for students,
and I'm sure that some students won't do their own homework. (Hint:
eight directions of play don't need eight different sections of code.)
You may also <a href="revers2d.zip">download the application</a> as a <a href="freesoft.htm#zip">ZIP
archive</a> with the executable Java class files and the documentation
in <a href="freesoft.htm#acrobat">Adobe Acrobat</a> PDF format. More
programming assignments and solutions can be found on my "<a href="cpindex.htm">Computer
Programming Examples</a>" web page.
<p>Copyright (c) 2004 by Keith Fenske. Released under the GNU General
Public License (GPL).
<p><hr>
</body>
</html>