Format fix 2000/robison/README.md

This commit is contained in:
Cody Boone Ferguson committed 2023-04-20 10:22:21 -07:00
1 parent 4d19b7a11c
commit e6dfaf0d52
1 file changed
+47 -43
+47 -43
View File
@@ -42,17 +42,20 @@ Highly Compressed Program for Playing Hygienic Checkers
### FIELD OF INVENTION ### FIELD OF INVENTION
The present invention generally relates to checkers. The present invention generally relates to
[checkers](https://en.wikipedia.org/wiki/Checkers).
### BACKGROUND OF THE INVENTION ### BACKGROUND OF THE INVENTION
Within the field of checkers, the problem of finding a hygienic opponent Within the field of [checkers](https://en.wikipedia.org/wiki/Checkers), the
is difficult, as good opponents are peculiar to the tavern habitat of problem of finding a hygienic opponent is difficult, as good opponents are
cracker-barrels, pot-belly stoves, tobacco, and spittoons. peculiar to the tavern habitat of cracker-barrels, pot-belly stoves, tobacco,
and spittoons.
### BRIEF SUMMARY OF THE INVENTION ### BRIEF SUMMARY OF THE INVENTION
The present invention plays checkers without spitting. The present invention plays [checkers](https://en.wikipedia.org/wiki/Checkers)
without spitting.
### BRIEF DESCRIPTION OF SEVERAL VIEWS OF THE INVENTION ### BRIEF DESCRIPTION OF SEVERAL VIEWS OF THE INVENTION
@@ -66,36 +69,34 @@ FIG. 4 shows a method in accordance with the present invention.
### DETAILED DESCRIPTION OF THE INVENTION ### DETAILED DESCRIPTION OF THE INVENTION
Operator plays Black (x); the program plays White (o). Said Black goes Operator plays Black (`x`); the program plays White (`o`). Said Black goes first.
first. On operators turn, said program requests a position and direction. On operator's turn, said program requests a position and direction. FIG. 1 shows
FIG. 1 shows the numbering of the squares. FIG. 2 shows the numbering of the numbering of the squares. FIG. 2 shows the numbering of directions. As per
directions. As per standard rules, if one or more jumps are possible, one standard rules, if one or more jumps are possible, one of the jumps must be
of the jumps must be taken in preference to other moves. Said operator taken in preference to other moves. Said operator enters the numbers for the
enters the numbers for the position and direction. If after jumping over a position and direction. If after jumping over a piece, another jump is
piece, another jump is possible, and said piece did not become a king after possible, and said piece did not become a king after said jump, standard rules
said jump, standard rules require that another jump be taken. In said case, require that another jump be taken. In said case, said program requests a
said program requests a direction only in which to continue jumping from the direction only in which to continue jumping from the present position. Kings
present position. Kings are denoted by upper case. FIG 3. shows a sample are denoted by upper case. FIG. 3 shows a sample board. There is a black king
board. There is a black king (X) on square 30 and a red king (O) on square (`X`) on square 30 and a red king (`O`) on square 2. The numbers on the right are
2. The numbers on the right are the numbers of the rightmost square in each the numbers of the rightmost square in each row.
row.
A player loses if they cannot make a legal move. Said loss is trivially A player loses if they cannot make a legal move. Said loss is trivially
true if player loses all of his/her pieces. The present invention announces true if player loses all of his/her pieces. The present invention announces
said loser. said loser.
FIG. 4 shows a C program in accordance with the present invention. Control FIG. 4 shows a C program in accordance with the present invention. Control flow
flow is straightforward: control enters routine ``main'', executes a is straightforward: control enters routine `main()`, executes a plurality of
plurality of statements, and exits via return statement. FIG. 4 presumes statements, and exits via `return` statement. FIG. 4 presumes that type `int`
that type int is 32 bits and short is 16 bits, which are essential to the is `32 bits` and `short` is `16 bits`, which are essential to the preferred
preferred embodiment of the invention. FIG. 4 also presumes that the host embodiment of the invention. FIG. 4 also presumes that the host computer uses
computer uses ASCII encoding for characters. It should be obvious that ASCII encoding for characters. It should be obvious that practitioners skilled
practitioners skilled in the art of C programming can remove said in the art of C programming can remove said limitations.
limitations.
The disclosure here describes a particular embodiment of the present The disclosure here describes a particular embodiment of the present invention,
invention, and other embodiments within the spirit of this disclosure and other embodiments within the spirit of this disclosure are possible, as well
are possible, as well as consumption of spirits while playing. as consumption of spirits while playing.
### CLAIMS ### CLAIMS
@@ -104,9 +105,8 @@ I claim, by letters patently absurd:
1. A method for playing checkers on a computer-based system, where said 1. A method for playing checkers on a computer-based system, where said
method's source code fits into 1536 countable bytes of source code, method's source code fits into 1536 countable bytes of source code,
where a byte is countable if where a byte is countable if
* it is not whitespace and
(a) it is not whitespace and * it is not a '`{`', '`}`', or '`;`' immediately followed by whitespace.
(b) it is not a {, }, or ; immediately followed by whitespace.
2. The method of claim 1, further comprising a method of alpha-beta pruning 2. The method of claim 1, further comprising a method of alpha-beta pruning
that exploits the zero-sum nature of the game to unify alpha that exploits the zero-sum nature of the game to unify alpha
@@ -120,24 +120,23 @@ I claim, by letters patently absurd:
skeptical manager that this is the well-known technique of skeptical manager that this is the well-known technique of
"linear programming". "linear programming".
5. The method of claim 1, where ~- and -~ replace the obvious arithmetic 5. The method of claim 1, where `~-` and `-~` replace the obvious arithmetic
operations. operations.
6. The method of claim 1, further comprising a method where 6. The method of claim 1, further comprising a method where
* strings are encrypted in a manner suitable as C strings, and
(a) strings are encrypted in a manner suitable as C strings, and * 7-bit ASCII characters with uniform distribution are maximally packed
(b) 7-bit ASCII characters with uniform distribution are maximally subject to the restriction that each byte is not countable
packed subject to the restriction that
(c) each byte is not countable.
7. A method for a computer-based system that uses a single shared code 7. A method for a computer-based system that uses a single shared code
sequence to either sum a plurality of bits in an N-bit word or reverses sequence to either sum a plurality of bits in an N-bit word or reverses
them, in lg(N) time, depending upon a parameter. them, in lg(N) time, depending upon a parameter.
DRAWINGS ### DRAWINGS
FIG 1. #### FIG 1.
```
+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
|32| |31| |30| |29| | |32| |31| |30| |29| |
+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
@@ -155,17 +154,21 @@ FIG 1.
+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
| | 4| | 3| | 2| | 1| | | 4| | 3| | 2| | 1|
+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
```
FIG. 2. #### FIG. 2.
```
1 0 1 0
\ / \ /
. .
/ \ / \
3 2 3 2
```
FIG. 3. #### FIG. 3.
```
o o X . 29 o o X . 29
o . . . 25 o . . . 25
o . . o 21 o . . o 21
@@ -174,8 +177,9 @@ FIG. 3.
. . x . 9 . . x . 9
x x . . 5 x x . . 5
x x O x 1 x x O x 1
```
FIG. 4 #### FIG. 4
[See attached listing.] [See attached listing.]