* Copyright (c) 1980 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)table.c 5.3 (Berkeley) %G%";
" Enter moves as <s>-<f> or <s>/<r> where <s> is the starting",
"position, <f> is the finishing position, and <r> is the roll.",
"Remember, each die roll must be moved separately.",
struct state atmata
[] = {
'R', 1, 0, '?', 7, 0, 'Q', 0, -3, 'B', 8, 25,
'9', 2, 25, '8', 2, 25, '7', 2, 25, '6', 2, 25,
'5', 2, 25, '4', 2, 25, '3', 2, 25, '2', 2, 19,
'1', 2, 15, '0', 2, 25, '.', 0, 0, '9', 2, 25,
'8', 2, 25, '7', 2, 25, '6', 2, 25, '5', 2, 25,
'4', 2, 25, '3', 2, 25, '2', 2, 25, '1', 2, 25,
'0', 2, 25, '/', 0, 32, '-', 0, 39, '.', 0, 0,
'/', 5, 32, ' ', 6, 3, ',', 6, 3, '\n', 0, -1,
'6', 3, 28, '5', 3, 28, '4', 3, 28, '3', 3, 28,
'2', 3, 28, '1', 3, 28, '.', 0, 0, 'H', 9, 61,
'9', 4, 61, '8', 4, 61, '7', 4, 61, '6', 4, 61,
'5', 4, 61, '4', 4, 61, '3', 4, 61, '2', 4, 53,
'1', 4, 51, '0', 4, 61, '.', 0, 0, '9', 4, 61,
'8', 4, 61, '7', 4, 61, '6', 4, 61, '5', 4, 61,
'4', 4, 61, '3', 4, 61, '2', 4, 61, '1', 4, 61,
'0', 4, 61, ' ', 6, 3, ',', 6, 3, '-', 5, 39,
curmove (cturn
== -1? 18: 19,39);
if (c
== tty
.sg_erase
&& ncin
> 0) {
if (tty
.sg_erase
== '\010')
if (c
== tty
.sg_kill
&& ncin
> 0) {
} else if (tty
.sg_erase
== '\010') {
for (j
= 0; j
< ncin
; j
++)
if ((! tflag
) || c
!= '\n')
if (n
== -1 && mvl
>= mvlim
)
if (n
== -1 && mvl
< mvlim
-1)
curmove (cturn
== -1? 18:19,ncin
+39);
while ( (a
= atmata
[i
].ch
) != '.') {
if (a
== c
|| (test
&& a
== '\n')) {
switch (atmata
[i
].fcode
) {
curmove (cturn
== -1? 18: 19,0);
p
[mvl
] = p
[mvl
]*10+c
-'0';
g
[mvl
] = p
[mvl
]+cturn
*(c
-'0');
g
[mvl
] = g
[mvl
]*10+c
-'0';
curmove (cturn
== -1? 18: 19,39);
return (atmata
[i
].newst
);
for (j
= 0; j
< ncin
; j
++)