Chess Board
A two-player chess game with ANSI graphics.
Commands:
@adescribe,
@create,
@describe,
@dolist,
@force,
@idescribe,
@pemit,
@set,
@switch,
@trigger,
@wait.
Functions:
abs(),
add(),
and(),
ansi(),
capstr(),
cat(),
center(),
comp(),
dec(),
div(),
edit(),
eq(),
extract(),
first(),
foreach(),
grab(),
gt(),
gte(),
hasflag(),
idle(),
ifelse(),
inc(),
isdbref(),
iter(),
last(),
lattr(),
lcon(),
lcstr(),
ldelete(),
ljust(),
lnum(),
lt(),
lte(),
match(),
member(),
mid(),
mod(),
mul(),
name(),
not(),
num(),
or(),
pemit(),
pmatch(),
pos(),
remove(),
repeat(),
replace(),
reverse(),
rjust(),
secs(),
secure(),
set(),
setq(),
setr(),
sort(),
space(),
squish(),
strcat(),
strlen(),
sub(),
switch(),
trim(),
trunc(),
type(),
u(),
v(),
wipe(),
words(),
xget().
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Chess Board
@set me=quiet
@switch [isdbref(num(Chess Board))]=0,{think [ansi(hm,INSTALL:)] No "Chess Board" object found -- creating...;@create Chess Board},1,{think [ansi(hm,INSTALL:)] "Chess Board" object already exists... skipping creation.}
@switch [isdbref(num(Chess Save Database))]=0,{think [ansi(hm,INSTALL:)] No "Chess Save Database" object found -- creating...;@create Chess Save Database},1,{think [ansi(hm,INSTALL:)] "Chess Save Database" object already exists... skipping creation.}
think [ansi(hm,INSTALL:)] Setting object flags...
@set Chess Board=!no_command
@set Chess Board=!halt
think [ansi(hm,INSTALL:)] Downloading Chess Commands...
&CMD_CHESS.COMMANDS Chess Board=$chess/comm*:[pemit(%#,[u(TXT_TITLE,CHESS HELP - Commands)][u(HELP_Commands)]%r[ansi(hb,repeat(-,78))])]
&CMD_CHESS.COPYRIGHT Chess Board=$chess/copy*:[pemit(%#,Chess Code v[v(DATA_VERSION)] -- Created by: Demonic \(1999\))]
&CMD_CHESS.PROMOTION Chess Board=$chess/promo* *:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][not(not(match(Queen Knight Rook Bishop,%1*)))],0??,u(TRI_ERROR,%#,PLR_!PLAYING),10?,u(TRI_ERROR,%#,GAME_!BUSY),110,u(TRI_ERROR,%#,PROMO_!VALID),111,u(TRI_Promotion.Ok,%#,extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%#),1),secure(%1)),u(TRI_SYSERR,%#))]
&CMD_CHESS.RESIGN Chess Board=$chess/resign:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)],0?,u(TRI_ERROR,%#,PLR_!PLAYING),10,u(TRI_ERROR,%#,GAME_!BUSY),11,u(TRI_RESIGN.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.HELP2 Chess Board=$chess/help *:[ifelse(match(lattr(me/HELP_*),HELP_[secure(%0)]*),pemit(%#,[u(TXT_TITLE,CHESS HELP - [capstr(lcstr(setr(0,edit(grab(lattr(me/HELP_*),HELP_[secure(%0)]*),HELP_,space(0)))))])][u(HELP_%q0)]%r[ansi(hb,repeat(-,78))]),u(TRI_ERROR,%#,HELP_!VALID,secure(%0)))]
&CMD_CHESS.HELP Chess Board=$chess/help:[pemit(%#,[u(TXT_TITLE,CHESS HELP -- MAIN SECTION)]Please note this Chess Help is NOT intended to teach you how to play the game. If you are unsure of how to play chess\, this is not a good place to start learning. It is recommended you buy a book or contact someone who does know how to play before using this code.%r%rIf you already know how to play \(even on just a basic level\)\, these help sections should be able to assist you on using this code. If you find ANY bugs\, do not abuse them -- instead report it to an Administrator.%r%rUse the following commands for more information:%r[space(5)][ansi(hm,ljust(chess/commands,18))] - Lists all available commands.%r[space(5)][ansi(hm,ljust(chess/help <topic>,18))] - Returns a help section where <topic> is%r[space(26)]INTRO or a any command.%r[space(5)][ansi(hm,ljust(chess/copyright,18))] - Returns Copyright information.%r[ansi(hb,repeat(-,78))])]
&CMD_CHESS.ENPASSANT Chess Board=$chess/en-pa* *:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_PLR.Turn,%#)][u(FUN_COORDS.Valid,lcstr(%1))][member(u(FUN_Coord2Piece,lcstr(%1)),ifelse(member(v(DATA_PLAYER.White),%#),P,p))][match(first(v(DATA_EnPassant)),ifelse(member(v(DATA_PLAYER.White),%#),White,Black))][eq(abs(sub(last(v(DATA_EnPassant)),u(FUN_Coord2Num,lcstr(%1)))),1)],0??????,u(TRI_ERROR,%#,PLR_!PLAYING),10?????,u(TRI_ERROR,%#,GAME_!BUSY),110????,u(TRI_ERROR,%#,PLR_!TURN),1110???,u(TRI_ERROR,%#,COORD_!VALID,lcstr(%1)),11110??,u(TRI_ERROR,%#,COORD_!PAWN,lcstr(%1)),111110?,u(TRI_ERROR,%#,CANT_ENPASSANT),1111110,u(TRI_ERROR,%#,PAWN_!VALID,lcstr(%1)),1111111,u(TRI_EnPassant2.Ok,%#,lcstr(%1),u(FUN_Coord2Piece,lcstr(%1)),u(FUN_Coord2Num,lcstr(%1))),u(TRI_SYSERR,%#))]
&CMD_CHESS.STYLE Chess Board=$chess/style ?:[ifelse(match(lattr(me/DRAW_BOARD.Style*),DRAW_BOARD.Style[secure(%0)]),ifelse(member(v(DATA_PLAYER.White),%#),u(TRI_STYLE.White,%#,secure(%0)),ifelse(member(v(DATA_PLAYER.Black),%#),u(TRI_STYLE.Black,%#,secure(%0)),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_STYLE.Watching,%#,secure(%0)),u(TRI_ERROR,%#,STYLE_!VALID)))),u(TRI_ERROR,%#,STYLE_!VALID2))]
&CMD_CHESS.CLOCK Chess Board=$chess/clock:[pemit(%#,u(DRAW_FOOTER,%#))]
&CMD_CHESS.CASTLE Chess Board=$chess/castle *:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_PLR.Turn,%#)][not(not(match(Kingside Queenside,%0*)))][u(FUN_Castle.Valid1,%#,setr(1,grab(Kingside Queenside,%0*)))][u(FUN_Castle.Valid2,%#,%q1)],0?????,u(TRI_ERROR,%#,PLR_!PLAYING),10????,u(TRI_ERROR,%#,GAME_BUSY!),110???,u(TRI_ERROR,%#,PLR_!TURN),1110??,u(TRI_ERROR,%#,CASTLE_!MATCH,secure(%0)),11110?,u(TRI_ERROR,%#,CASTLE_!VALID1),111110,u(TRI_ERROR,%#,CASTLE_!VALID2),111111,u(TRI_CASTLE.Ok,%#,%q1),u(TRI_SYSERR,%#))]
&CMD_CHESS.LOAD Chess Board=$chess/load *:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][v(FLAG_BUSY)][and(lte(trunc(%0),words(v(LIST_SAVES))),gt(trunc(%0),0))][or(member(xget(v(DATA_DB),SAVE_White.[setr(9,extract(v(LIST_SAVES),trunc(%0),1))]),%#),member(xget(v(DATA_DB),SAVE_Black.%q9),%#))][and(member(lcon(%l),first(xget(v(DATA_DB),SAVE_White.%q9))),member(lcon(%l),first(xget(v(DATA_DB),SAVE_Black.%q9))))][and(u(FUN_PLR.Connected,first(xget(v(DATA_DB),SAVE_White.%q9))),u(FUN_PLR.Connected,first(xget(v(DATA_DB),SAVE_Black.%q9))))],0??????,u(TRI_ERROR,%#,PLR_!AUTH),11?????,u(TRI_ERROR,%#,PLR_BANNED),101????,u(TRI_ERROR,%#,GAME_BUSY),1000???,u(TRI_ERROR,%#,LOAD_!RANGE),10010??,u(TRI_ERROR,%#,LOAD_!PLAYER),100110?,u(TRI_ERROR,%#,LOAD_!HERE),1001110,u(TRI_ERROR,%#,LOAD_!CONNECTED),1001111,u(TRI_LOAD.Ok,%#,%q9),u(TRI_SYSERR,%#))]
&CMD_CHESS.GAMES Chess Board=$chess/games:[pemit(%#,[repeat(-,78)]%r<<<<<[center(CHESS GAMES,68)]>>>>>%r[repeat(-,78)]%r[space(6)][ljust(White,16)] [ljust(Black,20)] [ljust(White,16)] Black%r[space(6)][ljust(-----,16)] [ljust(-----,16)][space(4)] [ljust(-----,16)] -----%r%b[iter(v(LIST_SAVES),[rjust(#@.,4)] [ljust(mid(name(first(xget(v(DATA_DB),SAVE_White.##))),0,12),12)] vs. [ifelse(mod(#@,2),[ljust(mid(name(first(xget(v(DATA_DB),SAVE_Black.##))),0,12),12)][space(3)],[mid(name(first(xget(v(DATA_DB),SAVE_Black.##))),0,12)]%r)])]%r%r* Type 'chess load <#>' to load a saved game.)]
&CMD_CHESS.CHOOSE Chess Board=$chess/choose *:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][v(FLAG_BUSY)][not(not(match(white black,%0*)))][not(not(member(cat(v(DATA_PLAYER.White),v(DATA_PLAYER.Black)),%#)))],0????,u(TRI_ERROR,%#,PLR_!AUTH),11???,u(TRI_ERROR,%#,PLR_BANNED),101??,u(TRI_ERROR,%#,GAME_BUSY),1000?,u(TRI_ERROR,%#,COLOR_!VALID,secure(%0)),10011,u(TRI_ERROR,%#,PLR_CHOSEN),10010,u(TRI_Choose.Ok,%#,grab(White Black,%0*)),u(TRI_SYSERR,%#))]
&CMD_CHESS.FLIP Chess Board=$chess/flip:[ifelse(member(v(DATA_PLAYER.White),%#),u(TRI_FLIP.White,%#),ifelse(member(v(DATA_PLAYER.Black),%#),u(TRI_FLIP.Black,%#),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_FLIP.Watching,%#),u(TRI_ERROR,%#,FLIP_!VALID))))]
&CMD_CHESS.FOOTER Chess Board=$chess/foot*:[ifelse(member(v(DATA_PLAYER.White),%#),u(TRI_FOOTER.White,%#),ifelse(member(v(DATA_PLAYER.Black),%#),u(TRI_FOOTER.Black,%#),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_FOOTER.Watching,%#),u(TRI_ERROR,%#,FOOTER_!VALID))))]
&CMD_CHESS.WATCH Chess Board=$chess/watch:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][or(or(member(v(DATA_PLAYER.White),%#),member(v(DATA_PLAYER.Black),%#)),member(v(DATA_WATCHING.Players),%#))],0??,u(TRI_ERROR,%#,PLR_!AUTH),11?,u(TRI_ERROR,%#,PLR_BANNED),101,u(TRI_ERROR,%#,WATCH_!VALID),100,u(TRI_WATCH.OK,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.BOARD Chess Board=$chess/boar*:@tr me/DRAW_BOARD.Style[u(FUN_STYLE,%#)]=%#,[v(DATA_Board)]
&CMD_CHESS.MOVE Chess Board=$chess/move *-*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_PLR.Turn,%#)][u(FUN_COORDS.Valid,lcstr(%0))][u(FUN_COORDS.Valid,lcstr(%1))][setr(5,u(FUN_PIECE.Valid,%#,u(FUN_Coord2Piece,lcstr(%0))))][ifelse(%q5,u(FUN_MOVE.Valid,%#,lcstr(%0),lcstr(%1)),0)],0??????,u(TRI_ERROR,%#,PLR_!PLAYING),10?????,u(TRI_ERROR,%#,GAME_!BUSY),110????,u(TRI_ERROR,%#,PLR_!TURN),1110???,u(TRI_ERROR,%#,COORD_!VALID,lcstr(%0)),11110??,u(TRI_ERROR,%#,COORD_!VALID,lcstr(%1)),111110?,u(TRI_ERROR,%#,PIECE_!VALID,lcstr(%0)),1111110,u(TRI_ERROR,%#,MOVE_!VALID,lcstr(%0),lcstr(%1)),1111111,u(TRI_MOVE2.Ok,%#,lcstr(%0),u(FUN_Coord2Piece,lcstr(%0)),lcstr(%1),u(FUN_Coord2Piece,lcstr(%1))),u(TRI_SYSERR,%#))]
&CMD_CHESS.START Chess Board=$chess/start*:[switch([u(FUN_PLR.Auth,%#)][not(u(FUN_PLR.Banned,%#))][u(FUN_PLR.Valid,%#)][and(words(v(DATA_PLAYER.White)),words(v(DATA_PLAYER.Black)))][v(FLAG_BUSY)],0????,u(TRI_ERROR,%#,PLR_!AUTH),10???,u(TRI_ERROR,%#,PLR_BANNED),110??,u(TRI_ERROR,%#,PLR_!PLAYING),1110?,u(TRI_ERROR,%#,!TWO_PLAYERS),11111,u(TRI_ERROR,%#,GAME_BUSY),11110,u(TRI_START.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.RESET Chess Board=$chess/reset:[switch([u(FUN_PLR.Auth,%#)][not(u(FUN_PLR.Banned,%#))][u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)],0???,u(TRI_ERROR,%#,PLR_!AUTH),10??,u(TRI_ERROR,%#,PLR_BANNED),110?,u(TRI_ERROR,%#,PLR_!PLAYING),1111,u(TRI_ERROR,%#,GAME_BUSY),1110,u(TRI_RESET.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.TAKEBACK Chess Board=$chess/take*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][v(FLAG_TAKEBACK)],0??,u(TRI_ERROR,%#,PLR_!PLAYING),10?,u(TRI_ERROR,%#,GAME_!BUSY),111,u(TRI_ERROR,%#,TAKEBACK_EXISTS),110,u(TRI_TAKEBACK.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.ACCEPT Chess Board=$chess/acc*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][v(FLAG_TAKEBACK)][member(v(DATA_TAKEBACK),%#)],0???,u(TRI_ERROR,%#,PLR_!PLAYING),10??,u(TRI_ERROR,%#,GAME_!BUSY),110?,u(TRI_ERROR,%#,TAKEBACK_!EXISTS),1111,u(TRI_ERROR,%#,TAKEBACK_SamePlr),1110,u(TRI_ACCEPT.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.DECLINE Chess Board=$chess/decl*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][v(FLAG_TAKEBACK)][member(v(DATA_TAKEBACK),%#)],0???,u(TRI_ERROR,%#,PLR_!PLAYING),10??,u(TRI_ERROR,%#,GAME_!BUSY),110?,u(TRI_ERROR,%#,TAKEBACK_!EXISTS),1111,u(TRI_ERROR,%#,TAKEBACK_SamePlr),1110,u(TRI_DECLINE.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.MOVES Chess Board=$chess/moves:[pemit(%#,[repeat(-,78)]%r<<<<<[center(CHESS MOVES,68)]>>>>>%r[repeat(-,78)]%r[space(6)][ljust(White,8)] [ljust(Black,25)] [ljust(White,8)] Black%r[space(6)][ljust(-----,8)] [ljust(-----,25)] [ljust(-----,8)] -----%r%b[iter(lnum(trunc(div(inc(words(v(HIST_MOVES))),2))),[rjust(#@.,4)] [ljust(extract(v(HIST_MOVES),dec(mul(2,#@)),1),8)] [ifelse(mod(#@,2),ljust(extract(v(HIST_MOVES),mul(2,#@),1),20),[extract(v(HIST_MOVES),mul(2,#@),1)]%r)])])]
&CMD_CHESS.SAVE Chess Board=$chess/save:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)],0?,u(TRI_ERROR,%#,PLR_!PLAYING),10,u(TRI_ERROR,%#,GAME_!BUSY),11,u(TRI_SAVE.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.TIME Chess Board=$chess/time *h *m *s:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][and(gte(trunc(%0),0),lte(trunc(%0),24))][and(gte(trunc(%1),0),lt(trunc(%1),60))][and(gte(trunc(%2),0),lt(trunc(%2),60))],0??????,u(TRI_ERROR,%#,PLR_!AUTH),11?????,u(TRI_ERROR,%#,PLR_BANNED),100????,u(TRI_ERROR,%#,PLR_!PLAYING),1011???,u(TRI_ERROR,%#,GAME_BUSY),10100??,u(TRI_ERROR,%#,HOURS_!VALID,trunc(%0)),101010?,u(TRI_ERROR,%#,MINUTES_!VALID,trunc(%1)),1010110,u(TRI_ERROR,%#,SECONDS_!VALID,trunc(%2)),1010111,u(TRI_TIME.Ok,%#,trunc(%0),trunc(%1),trunc(%2)),u(TRI_SYSERR,%#))]
&CMD_CHESS.FLAG Chess Board=$chess/flag:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_TIME.Expired,extract(Black White,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%#),1))],0??,u(TRI_ERROR,%#,PLR_!PLAYING),10?,u(TRI_ERROR,%#,GAME_!BUSY),110,u(TRI_ERROR,%#,TIME_!EXPIRED),111,u(TRI_FLAG.Ok,%#),u(TRI_SYSERR,%#))]
think [ansi(hm,INSTALL:)] Downloading Chess Triggers...
&TRI_PROMOTION.OK Chess Board=[set(me,DATA_PLAYER.%1:[replace(v(DATA_PLAYER.%1),7,extract(extract(Q N R B | q n r b,match(White Black,%1),1,|),match(Queen Knight Rook Bishop,%2),1))])][pemit(%0,GAME: You change your promotion piece to: [grab(Queen Knight Rook Bishop,%2*)])]
&TRI_RESIGN.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) resigns the Chess match.)][set(me,FLAG_BUSY:0)]
&TRI_CASTLE2.OK Chess Board=[ifelse(u(FUN_Check4Check,%0,%1),u(TRI_ERROR,%0,MOVE_CHECKS),ifelse(u(FUN_Check4Check,%0,%2),u(TRI_ERROR,%0,CASTLE_!VALID3),ifelse(u(FUN_Check4Check,%0,%3),u(TRI_ERROR,%0,CASTLE_!VALID3),u(DO_CASTLE,%0,%1,%4,%5))))]
&TRI_ENPASSANT2.OK Chess Board=[ifelse(u(FUN_Check4Check,%0,setr(9,u(FUN_CREPLACE,u(FUN_CREPLACE,u(FUN_CREPLACE,v(DATA_BOARD),%2,member(v(DATA_BOARD.Numbers),ifelse(member(v(DATA_PLAYER.White),%0),add(last(v(DATA_EnPassant)),10),sub(last(v(DATA_EnPassant)),10))),1),-,member(v(DATA_BOARD.Coords),%1),1),-,member(v(DATA_BOARD.Numbers),last(v(DATA_EnPassant))),1))),u(TRI_ERROR,%0,MOVE_CHECKS),u(TRI_EnPassant.OK,%0,%1,%2,u(FUN_Coord2Num,%1),%q9))]
&TRI_ENPASSANT.OK Chess Board=[u(TRI_UPDATE.Hist,setr(4,extract(White Black,inc(v(DATA_PLAYER.Turn)),1)),v(DATA_BOARD))][set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),5,u(FUN_CSORT.[v(DATA_MU.Type)],edit(strcat(extract(v(DATA_PLAYER.%q4),5,1),extract(P p,match(Black White,%q4),1)),-,space(0)),a))]))][set(me,DATA_BOARD:%4)][set(me,DATA_EnPassant:)][set(me,HIST_MOVES:[squish(trim(cat(v(HIST_MOVES),en-pas[ifelse(gt(setr(7,u(FUN_Check4Check,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),0),ifelse(setr(6,u(FUN_Check4Mate,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),++,+),space(0))])))])][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][u(TRI_Game.Emit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) makes the Chess move 'en-passant' ... Pawn captures Pawn.)][ifelse(gt(trunc(%q7),0),u(TRI_GAME.Emit,[name(%0)] calls CHECK!),space(0))][ifelse(v(FLAG_TAKEBACK),u(TRI_TAKEBACK.AutoDecline,%0),space(0))][u(TRI_UPDATE.Time,%q4)][set(me,DATA_TIMER.Start:[secs()])][ifelse(%q6,u(DO_MATE,%0),space(0))]
&TRI_STYLE.BLACK Chess Board=[set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),6,%1)])][pemit(%0,GAME: [u(TXT_STYLE.Board,%1)])]
&TRI_STYLE.WATCHING Chess Board=[set(me,DATA_WATCHING.Style:[replace(v(DATA_WATCHING.Style),member(v(DATA_WATCHING.Players),%0),%1)])][pemit(%0,GAME: [u(TXT_STYLE.Board,%1)])]
&TRI_STYLE.WHITE Chess Board=[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),6,%1)])][pemit(%0,GAME: [u(TXT_STYLE.Board,%1)])]
&TRI_TAKEBACK.AUTODECLINE Chess Board=[set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][u(TRI_GAME.Emit,[name(%0)] auto-declines the takeback request.)]
&TRI_UPDATE.TIME Chess Board=[set(me,DATA_PLAYER.%0:[replace(v(DATA_PLAYER.%0),2,sub(extract(v(DATA_PLAYER.%0),2,1),sub(secs(),v(DATA_TIMER.Start))))])]
&TRI_UPDATE.HIST Chess Board=[set(me,HIST_CAPTURES:[squish(trim(cat(v(HIST_CAPTURES),extract(v(DATA_PLAYER.%0),5,1))))])][set(me,HIST_BOARDS:[squish(trim(cat(v(HIST_BOARDS),%1)))])][set(me,HIST_TIMES:[squish(trim(cat(v(HIST_TIMES),extract(v(DATA_PLAYER.%0),2,1))))])]
&TRI_LOAD.OK Chess Board=[set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][set(me,DATA_BOARD:[xget(v(DATA_DB),SAVE_BOARD.%1)])][set(me,HIST_BOARDS:[xget(v(DATA_DB),SAVE_BOARDS.%1)])][set(me,HIST_CAPTURES:[xget(v(DATA_DB),SAVE_CAPTURES.%1)])][set(me,HIST_TIMES:[xget(v(DATA_DB),SAVE_TIMES.%1)])][set(me,HIST_MOVES:[xget(v(DATA_DB),SAVE_MOVES.%1)])][set(me,DATA_PLAYER.Turn:[xget(v(DATA_DB),SAVE_TURN.%1)])][set(me,DATA_PLAYER.White:[xget(v(DATA_DB),SAVE_White.%1)])][set(me,DATA_PLAYER.Black:[xget(v(DATA_DB),SAVE_Black.%1)])][pemit(lcon(%l),GAME: [name(%0)] has loaded game [name(first(v(DATA_PLAYER.White)))] vs. [name(first(v(DATA_PLAYER.Black)))].)][u(TRI_CLEAR.Save.[v(DATA_MU.Type)],%1)]
&TRI_CLEAR.SAVE.MUSH Chess Board=[set(me,LIST_SAVES:[remove(v(LIST_SAVES),%0)])][wipe([v(DATA_DB)]/SAVE_BOARD.%0)][wipe([v(DATA_DB)]/SAVE_BOARDS.%0)][wipe([v(DATA_DB)]/SAVE_CAPTURES.%0)][wipe([v(DATA_DB)]/SAVE_MOVES.%0)][wipe([v(DATA_DB)]/SAVE_TURN.%0)][wipe([v(DATA_DB)]/SAVE_White.%0)][wipe([v(DATA_DB)]/SAVE_Black.%0)][wipe([v(DATA_DB)]/SAVE_TIMES.%0)]
&TRI_CLEAR.SAVE.MUX Chess Board=[set(me,LIST_SAVES:[remove(v(LIST_SAVES),%0)])][set(v(DATA_DB),SAVE_BOARD.%0:)][set(v(DATA_DB),SAVE_BOARDS.%0:)][set(v(DATA_DB),SAVE_CAPTURES.%0:)][set(v(DATA_DB),SAVE_MOVES.%0:)][set(v(DATA_DB),SAVE_TURN.%0:)][set(v(DATA_DB),SAVE_WHITE.%0:)][set(v(DATA_DB),SAVE_BLACK.%0:)][set(v(DATA_DB),SAVE_TIMES.%1:)]
&TRI_CASTLE.OK Chess Board=[u(TRI_Castle.[extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)].%1,%0,%1)]
&TRI_CASTLE.WHITE.KINGSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),-RK-,61,4),u(FUN_CREPLACE,v(DATA_BOARD),-K-R,61,4),v(DATA_BOARD),White,King)]
&TRI_CASTLE.WHITE.QUEENSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),--KR-,57,5),u(FUN_CREPLACE,v(DATA_BOARD),R--K-,57,5),v(DATA_BOARD),White,Queen)]
&TRI_CASTLE.BLACK.QUEENSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),--kr-,1,5),u(FUN_CREPLACE,v(DATA_BOARD),r--k-,1,5),v(DATA_BOARD),Black,Queen)]
&TRI_CASTLE.BLACK.KINGSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),-rk-,5,4),u(FUN_CREPLACE,v(DATA_BOARD),-k-r,5,4),v(DATA_BOARD),Black,King)]
&TRI_ERROR Chess Board=[pemit(%0,[v(PREFIX_ERROR)][space(not(not(words(v(PREFIX_ERROR)))))][u(ERR_%1,%2,%3,%4)])]
&TRI_SYSERR Chess Board=[pemit(%0,SYSERR: There is a bug in the code. Report this to an Admin immediately.)]
&TRI_CHOOSE.OK Chess Board=[ifelse(words(v(DATA_PLAYER.%1)),pemit(lcon(%l),GAME: [name(%0)] pushes [name(first(v(DATA_PLAYER.%1)))] out of the way and settles before the %1 pieces of the Chess Board.),pemit(lcon(%l),GAME: [name(%0)] settles before the %1 pieces of the Chess Board.))][set(me,DATA_PLAYER.%1:%0 0 [ifelse(match(%1,Black),1,0)] 1 - 1 [ifelse(match(%1,Black),q,Q)] 1 1 1)][u(TRI_REMOVE.Watching,%0)]
&TRI_FLIP.WHITE Chess Board=[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),3,not(extract(v(DATA_PLAYER.White),3,1)))])][pemit(%0,GAME: [v(TXT_FLIP.Board)])]
&TRI_FLIP.BLACK Chess Board=[set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),3,not(extract(v(DATA_PLAYER.Black),3,1)))])][pemit(%0,GAME: [v(TXT_FLIP.Board)])]
&TRI_FLIP.WATCHING Chess Board=[set(me,DATA_WATCHING.Flip:[replace(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0),not(extract(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0),1)))])][pemit(%0,GAME: [v(TXT_FLIP.Board)]
&TRI_FOOTER.BLACK Chess Board=[set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),4,not(extract(v(DATA_PLAYER.Black),4,1)))])][pemit(%0,GAME: [v(TXT_FOOTER.Board)])]
&TRI_FOOTER.WHITE Chess Board=[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),4,not(extract(v(DATA_PLAYER.White),4,1)))])][pemit(%0,GAME: [v(TXT_FOOTER.Board)])]
&TRI_FOOTER.WATCHING Chess Board=[set(me,DATA_WATCHING.Footer:[replace(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0),not(extract(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0),1)))])][pemit(%0,GAME: [v(TXT_FOOTER.Board)]
&TRI_WATCH.OK Chess Board=[pemit(lcon(%l),GAME: [name(%0)] walks over to the Chess Board to observe the game.)][set(me,DATA_WATCHING.Players:[squish(trim(cat(v(DATA_WATCHING.Players),%0)))])][set(me,DATA_WATCHING.Flip:[squish(trim(cat(v(DATA_WATCHING.Flip),0)))])][set(me,DATA_WATCHING.Footer:[squish(trim(cat(v(DATA_WATCHING.Footer),1)))])][set(me,DATA_WATCHING.Style:[squish(trim(cat(v(DATA_WATCHING.Style),1)))])]
&TRI_MOVE.OK Chess Board=[u(TRI_UPDATE.Hist,setr(4,extract(White Black,inc(v(DATA_PLAYER.Turn)),1)),v(DATA_BOARD))][ifelse(member(%4,-),,set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),5,u(FUN_CSORT.[v(DATA_MU.Type)],edit(strcat(extract(v(DATA_PLAYER.%q4),5,1),%4),-,space(0)),a))]))][set(me,DATA_BOARD:%5)][ifelse(match(%2,p),ifelse(or(gt(%7,80),lt(%7,20)),u(DO_Pawn.Promotion,%0,%7,%q4),ifelse(and(eq(abs(sub(%7,%6)),20),ifelse(match(%q4,White),member([u(FUN_Num2Piece,add(%6,19))] [u(FUN_Num2Piece,add(%6,21))],p),member([u(FUN_Num2Piece,add(%6,-19))] [u(FUN_Num2Piece,add(%6,-21))],P))),u(DO_Pawn.EnPassant,extract(Black White,match(White Black,%q4),1),%7),set(me,DATA_EnPassant:))),set(me,DATA_EnPassant:))][ifelse(match(%2,k),set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),8,0)]),ifelse(and(match(%2,r),member(ifelse(match(%q4,WHITE),a1 h1,a8 h8),%1)),set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),ifelse(match(h1 h8,%1),9,10),0)]),space(0)))][set(me,HIST_MOVES:[squish(trim(cat(v(HIST_MOVES),%1[ifelse(member(%4,-),-,x)]%3[ifelse(gt(setr(7,u(FUN_Check4Check,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),0),ifelse(setr(6,u(FUN_Check4Mate,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),++,+),space(0))])))])][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][u(TRI_Game.EMit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) makes the Chess move '%1[ifelse(member(%4,-),-,x)]%3' ... [u(FUN_Piece2Name,%2)] [ifelse(member(%4,-),to %3,captures [u(FUN_Piece2Name,%4)])].)][ifelse(gt(trunc(%q7),0),u(TRI_GAME.Emit,[name(%0)] calls CHECK!),space(0))][ifelse(v(FLAG_TAKEBACK),u(TRI_TAKEBACK.AutoDecline,%0),space(0))][u(TRI_UPDATE.Time,%q4)][set(me,DATA_TIMER.Start:[secs()])][ifelse(%q6,u(DO_MATE,%0),space(0))]
&TRI_GAME.EMIT Chess Board=[pemit([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))] [v(DATA_WATCHING.Players)],GAME: %0)]
&TRI_REMOVE.WATCHING Chess Board=[set(me,DATA_WATCHING.Style:[ldelete(v(DATA_WATCHING.Style),member(v(DATA_WATCHING.Players),%0))])][set(me,DATA_WATCHING.Flip:[ldelete(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0))])][set(me,DATA_WATCHING.Footer:[ldelete(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0))])][set(me,DATA_WATCHING.Players:[remove(v(DATA_WATCHING.Players),%0)])]
&TRI_START.OK Chess Board=[set(me,FLAG_BUSY:1)][pemit(lcon(%l),GAME: A Chess game is starting. Type 'chess watch' to observe.)][ifelse(member(v(DATA_BOARD),v(DATA_BOARD.Default)),[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),2,v(DATA_TIMER.Total))])][set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),2,v(DATA_TIMER.Total))])],space(0))][set(me,DATA_TIMER.START:[secs()])][set(me,DATA_PLAYER.Turn:0)]
&TRI_RESET.OK Chess Board=[set(me,HIST_TIMES:)][set(me,HIST_CAPTURES:)][set(me,HIST_MOVES:)][set(me,HIST_BOARDS:)][set(me,DATA_BOARD:[v(DATA_BOARD.Default)])][set(me,DATA_PLAYER.Turn:0)][u(TRI_GAME.Emit,The board has been reset by [name(%0)].)][ifelse(words(v(DATA_PLAYER.White)),set(me,DATA_PLAYER.White:[first(v(DATA_PLAYER.White))] 0 0 1 - 1 Q 1 1 1),space(0))][ifelse(words(v(DATA_PLAYER.Black)),set(me,DATA_PLAYER.Black:[first(v(DATA_PLAYER.Black))] 0 1 1 - 1 q 1 1 1),space(0))]
&TRI_TAKEBACK.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] has requested a takeback! Type 'chess accept' or 'chess decline'.)][set(me,FLAG_TAKEBACK:1)][set(me,DATA_TAKEBACK:%0)]
&TRI_DECLINE.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] declines the takeback request.)][set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)]
&TRI_ACCEPT.OK Chess Board=[set(me,DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]:[replace(v(DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]),2,last(v(HIST_TIMES)))])][set(me,DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]:[replace(v(DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]),5,last(v(HIST_CAPTURES)))])][set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][set(me,DATA_BOARD:[last(v(HIST_BOARDS))])][set(me,HIST_BOARDS:[ldelete(v(HIST_BOARDS),words(v(HIST_BOARDS)))])][u(TRI_GAME.Emit,[name(%0)] accepts the takeback request.)][u(TRI_GAME.Emit,The system [ifelse(member(O-O-O O-O,last(v(HIST_MOVES))),removes the [extract(Queenside Kingside,member(O-O-O O-O,last(v(HIST_MOVES))),1)]-Castle.,ifelse(member(en-pass,last(v(HIST_MOVES))),undoes the en-passant.,ifelse(pos(x,last(v(HIST_MOVES))),moves [last(last(v(HIST_MOVES)),x)] back to [first(last(v(HIST_MOVES)),x)].,moves [last(last(v(HIST_MOVES)),-)] back to [first(last(v(HIST_MOVES)),-)].)))])][set(me,HIST_MOVES:[ldelete(v(HIST_MOVES),words(v(HIST_MOVES)))])][set(me,HIST_CAPTURES:[ldelete(v(HIST_CAPTURES),words(v(HIST_CAPTURES)))])][set(me,HIST_TIMES:[ldelete(v(HIST_TIMES),words(v(HIST_TIMES)))])]
&TRI_GAME.SAVE Chess Board=[set(me,FLAG_BUSY:0)][set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][set(me,DATA_SAVE.Current:[inc(v(DATA_SAVE.Current))])][set(me,LIST_SAVES:[cat(v(LIST_SAVES),v(DATA_SAVE.Current))])][set([v(DATA_DB)],SAVE_BOARD.[v(DATA_SAVE.Current)]:[v(DATA_BOARD)])][set([v(DATA_DB)],SAVE_BOARDS.[v(DATA_SAVE.Current)]:[v(HIST_BOARDS)])][set([v(DATA_DB)],SAVE_CAPTURES.[v(DATA_SAVE.Current)]:[v(HIST_CAPTURES)])][set([v(DATA_DB)],SAVE_TIMES.[v(DATA_SAVE.Current)]:[v(HIST_TIMES)])][set([v(DATA_DB)],SAVE_MOVES.[v(DATA_SAVE.Current)]:[v(HIST_MOVES)])][set([v(DATA_DB)],SAVE_TURN.[v(DATA_SAVE.Current)]:[v(DATA_PLAYER.Turn)])][set([v(DATA_DB)],SAVE_White.[v(DATA_SAVE.Current)]:[v(DATA_PLAYER.White)])][set([v(DATA_DB)],SAVE_Black.[v(DATA_SAVE.Current)]:[v(DATA_PLAYER.Black)])][u(TRI_GAME.Emit,The game has been saved as [name(first(v(DATA_PLAYER.White)))] vs. [name(first(v(DATA_PLAYER.Black)))].)][u(TRI_RESET.Ok,%0)]
&TRI_SAVE.OK Chess Board=[u(TRI_GAME.Save,%0)][set(me,DATA_PLAYER.White:)][set(me,DATA_PLAYER.Black:)]
&TRI_REMOVE.PLAYER Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),set(me,DATA_PLAYER.White:),ifelse(member(v(DATA_PLAYER.Black),%0),set(me,DATA_PLAYER.Black:),space(0)))]
&TRI_TIME.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] sets the time controls to %1h %2m %3s.)][set(me,DATA_TIMER.Start:[secs()])][set(me,DATA_TIMER.Total:[add(%3,mul(%2,60),mul(%1,3600))])]
&TRI_FLAG.OK Chess Board=[u(TRI_Game.Emit,[name(%0)] has called 'FLAG' and wins the game!)][set(me,FLAG_BUSY:0)]
&TRI_MOVE2.OK Chess Board=[ifelse(u(FUN_Check4Check,%0,setr(9,u(FUN_CREPLACE,u(FUN_CREPLACE,v(DATA_BOARD),%2,member(v(DATA_BOARD.Coords),%3),1),-,member(v(DATA_BOARD.Coords),%1),1))),u(TRI_ERROR,%0,MOVE_CHECKS),u(TRI_MOVE.Ok,%0,%1,%2,%3,%4,%q9,u(FUN_Coord2Num,%1),u(FUN_Coord2Num,%3)))]
think [ansi(hm,INSTALL:)] Downloading Chess Flags...
&FLAG_BUSY Chess Board=0
&FLAG_TAKEBACK Chess Board=0
think [ansi(hm,INSTALL:)] Downloading Chess Ascii-Art...
&DRAW_BOARD.STYLE1 Chess Board=@pemit %0=[setr(9,u(DRAW_HEADER.[ifelse(u(FUN_Flip,%0),Flip,Norm)],%0,5,6))]%b%b%b[repeat(.-----.=====,4)].;@dol [lnum(8)]={@pemit %0=%b[u(DRAW2_Board,%0,#@,u(FUN_Flip,%0),%1)]};@wait 0={@pemit %0=%q9[ifelse(u(FUN_Footer,%0),%r[u(DRAW_FOOTER,%0)],space(0))]}
&DRAW4_BOARD Chess Board=[ifelse(%2,%1,abs(sub(%1,9)))]%b|[edit(| [iter(lnum(8),![ifelse(mod(add(#@,%1),2),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.Black-Ansi),u(DATA_Fill.Black))),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.White-Ansi),u(DATA_Fill.White))))][ifelse(or(member(setr(1,mid(ifelse(%2,reverse(%3),%3),dec(add(#@,mul(dec(%1),8))),1)),-),eq(words(%q1),0)),repeat(%q0,3),[ifelse(eq(comp(%q1,a),-1),[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.WHITE-Piece)],[v(DATA_Char1.WP)]%q1[v(DATA_Char2.WP)])],[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.BLACK-Piece)],[v(DATA_Char1.BP)]%q1[v(DATA_Char2.BP)])])])]%q0|)],| !,space(0))][ifelse(eq(%1,8),%r%b%b%b`[repeat(-,40)]',)]
&DRAW_BOARD Chess Board=@tr me/DRAW_BOARD.Style[u(FUN_STYLE,%0)]=%0,[v(DATA_Board)]
&DRAW_BOARD.STYLE0 Chess Board=@pemit %0=[setr(9,u(DRAW_HEADER.[ifelse(u(FUN_Flip,%0),Flip,Norm)],%0,4,6))]%b%b%b.[repeat(-,40)].;@dol [lnum(8)]={@pemit %0=%b[u(DRAW4_Board,%0,#@,u(FUN_Flip,%0),%1)]};@wait 0={@pemit %0=%q9[ifelse(u(FUN_Footer,%0),%r[u(DRAW_FOOTER,%0)],space(0))]}
&DRAW_BOARD.STYLE2 Chess Board=@pemit %0=[setr(9,u(DRAW_HEADER.[ifelse(u(FUN_Flip,%0),Flip,Norm)],%0,6,7))]%b%b%b.[repeat(-,56)].;@dol [lnum(24)]={@pemit %0=%b[u(DRAW3_Board,%0,#@,u(FUN_Flip,%0),%1)]};@wait 0={@pemit %0=%q9[ifelse(u(FUN_Footer,%0),%r[u(DRAW_FOOTER,%0)],space(0))]}
&DRAW3_BOARD Chess Board=[ifelse(mod(sub(%1,2),3),ifelse(mod(div(dec(%1),3),2),%b%b%|[repeat(ifelse(hasflag(%0,ANSI),[ansi(u(DATA_COLOR.BLACK-Square),%b%b%b%b%b%b%b)][ansi(u(DATA_COLOR.WHITE-Square),%b%b%b%b%b%b%b)],[repeat(u(DATA_FILL.Black),7)][repeat(u(DATA_FILL.White),7)]),4)]|,%b%b%|[repeat(ifelse(hasflag(%0,ANSI),[ansi(u(DATA_COLOR.WHITE-Square),%b%b%b%b%b%b%b)][ansi(u(DATA_COLOR.BLACK-Square),%b%b%b%b%b%b%b)],[repeat(u(DATA_FILL.White),7)][repeat(u(DATA_FILL.Black),7)]),4)]|),[ifelse(%2,inc(div(sub(%1,2),3)),abs(sub(inc(div(sub(%1,2),3)),9)))]%b|[edit(| [iter(lnum(8),![ifelse(mod(add(#@,inc(div(sub(%1,2),3))),2),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.Black-Ansi),u(DATA_Fill.Black))),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.White-Ansi),u(DATA_Fill.White))))]%q0[ifelse(or(member(setr(1,mid(ifelse(%2,reverse(%3),%3),dec(add(#@,mul(dec(inc(div(sub(%1,2),3))),8))),1)),-),eq(words(%q1),0)),repeat(%q0,3),[ifelse(eq(comp(%q1,a),-1),[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,inc(div(sub(%1,2),3))),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.WHITE-Piece)],[v(DATA_Char1.WP)]%q1[v(DATA_Char2.WP)])],[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,inc(div(sub(%1,2),3))),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.BLACK-Piece)],[v(DATA_Char1.BP)]%q1[v(DATA_Char2.BP)])])])]%q0%q0|)],| !,space(0))])][ifelse(eq(%1,24),%r%b%b%b`[repeat(-,56)]',)]
&DRAW2_BOARD Chess Board=[ifelse(%2,%1,abs(sub(%1,9)))] [edit(| [iter(lnum(8),![ifelse(mod(add(#@,%1),2),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.Black-Ansi),u(DATA_Fill.Black))),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.White-Ansi),u(DATA_Fill.White))))][ifelse(or(member(setr(1,mid(ifelse(%2,reverse(%3),%3),dec(add(#@,mul(dec(%1),8))),1)),-),eq(words(%q1),0)),repeat(%q0,3),[ifelse(eq(comp(%q1,a),-1),[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.WHITE-Piece)],[v(DATA_Char1.WP)]%q1[v(DATA_Char2.WP)])],[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.BLACK-Piece)],[v(DATA_Char1.BP)]%q1[v(DATA_Char2.BP)])])])]%q0|)],| !,|)]%r%b%b%b[ifelse(eq(%1,8),`-----[repeat(^=====^-----,3)]^=====',ifelse(mod(%1,2),|[repeat(=====+-----+,3)]=====+-----|,|[repeat(-----+=====+,3)]-----+=====|))]
&DRAW_FOOTER Chess Board=%b[ansi(u(DATA_COLOR.WHITE-Piece),[ljust([v(DATA_CHAR1.WP)]White[v(DATA_CHAR2.WP)]%b%b: [ifelse(words(v(DATA_PLAYER.White)),ifelse(and(eq(v(DATA_PLAYER.Turn),0),v(FLAG_BUSY)),** [name(first(v(DATA_PLAYER.White)))] **,name(first(v(DATA_PLAYER.White)))),-None-)],37)])][ansi(u(DATA_COLOR.BLACK-Piece),[v(DATA_CHAR1.BP)]Black[v(DATA_CHAR2.BP)]%b%b: [ifelse(words(v(DATA_PLAYER.Black)),ifelse(and(eq(v(DATA_PLAYER.Turn),1),v(FLAG_BUSY)),** [name(first(v(DATA_PLAYER.Black)))] **,name(first(v(DATA_PLAYER.Black)))),-None-)])]%r%b[ljust(TimeLeft : [ifelse(words(v(DATA_PLAYER.White)),u(FUN_ConvSecs,ifelse(and(eq(v(DATA_PLAYER.Turn),0),v(FLAG_BUSY)),sub(extract(v(DATA_PLAYER.White),2,1),sub(secs(),v(DATA_TIMER.Start))),extract(v(DATA_PLAYER.White),2,1))),-None-)],37)]TimeLeft : [ifelse(words(v(DATA_PLAYER.Black)),u(FUN_ConvSecs,ifelse(and(eq(v(DATA_PLAYER.Turn),1),v(FLAG_BUSY)),sub(extract(v(DATA_PLAYER.Black),2,1),sub(secs(),v(DATA_TIMER.Start))),extract(v(DATA_PLAYER.Black),2,1))),-None-)]%r%b[ljust(Captured : \[[ifelse(not(member(extract(v(dATA_PLAYER.White),5,1),-)),edit(extract(v(DATA_PLAYER.White),5,1),space(1),space(0)),-None-)]\],37)]Captured : \[[ifelse(not(member(extract(v(DATA_PLAYER.Black),5,1),-)),edit(extract(v(DATA_PLAYER.Black),5,1),space(1),space(0)),-None-)]\]
&DRAW_HEADER.NORM Chess Board=[space(%2)]A[space(%1)]B[space(%1)]C[space(%1)]D[space(%1)]E[space(%1)]F[space(%1)]G[space(%1)]H%r
&DRAW_HEADER.FLIP Chess Board=[space(%2)]H[space(%1)]G[space(%1)]F[space(%1)]E[space(%1)]D[space(%1)]C[space(%1)]B[space(%1)]A%r
think [ansi(hm,INSTALL:)] Downloading Chess Actions...
&DO_MATE Chess Board=[u(TRI_GAME.Emit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) calls *** CHECK MATE!! ***)][set(me,FLAG_BUSY:0)]
&DO_CASTLE Chess Board=[u(TRI_UPDATE.Hist,%2,v(DATA_BOARD))][set(me,DATA_PLAYER.%2:[extract(v(DATA_PLAYER.%2),1,7)] 0 0 0)][set(me,DATA_BOARD:%1)][set(me,DATA_EnPassant:)][set(me,HIST_MOVES:[squish(trim(cat(v(HIST_MOVES),[ifelse(match(%3,KING),O-O,O-O-O)][ifelse(gt(setr(7,u(FUN_Check4Check,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%2),1)])),v(DATA_BOARD))),0),ifelse(setr(6,u(FUN_Check4Mate,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%2),1)])),v(DATA_BOARD))),++,+),space(0))])))])][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][u(TRI_Game.Emit,[name(%0)] \(%2\) makes the Chess move '[ifelse(match(%3,KING),O-O,O-O-O)]' ... Castle [capstr(lcstr(%3))]-Side.)][ifelse(gt(trunc(%q7),0),u(TRI_GAME.Emit,[name(%0)] calls CHECK!),space(0))][ifelse(v(FLAG_TAKEBACK),u(TRI_TAKEBACK.AutoDecline,%0),space(0))][u(TRI_UPDATE.Time,%q4)][set(me,DATA_TIMER.Start:[secs()])][ifelse(%q6,u(DO_MATE,%0),space(0))]
&DO_PAWN.ENPASSANT Chess Board=[set(me,DATA_EnPassant:%0 %1)]
&DO_PAWN.PROMOTION Chess Board=[set(me,DATA_BOARD:[u(FUN_CREPLACE,v(DATA_BOARD),extract(v(DATA_PLAYER.%2),7,1),member(v(DATA_BOARD.Numbers),%1),1)])][u(TRI_Game.Emit,[name(%0)]'s pawn is promoted to a [extract(QUEEN ROOK BISHOP KNIGHT,match(Q R B N,extract(v(DATA_PLAYER.%2),7,1)),1)]!)]
think [ansi(hm,INSTALL:)] Downloading Chess Error-Messages...
&ERR_PROMO_!VALID Chess Board=That is not a valid promotion piece. You must use: Queen, Rook, Knight, or Bishop.
&ERR_HELP_!VALID Chess Board=There is no help section on '%0'.
&ERR_PAWN_!VALID Chess Board=You cannot en passant with that pawn.
&ERR_CANT_ENPASSANT Chess Board=You cannot en passant right now.
&ERR_COORD_!PAWN Chess Board=You do not have a pawn on '%0'.
&ERR_STYLE_!VALID2 Chess Board=That is not a valid style. Choose one of the following:%r[space(10)][edit(trim(squish(edit(lattr(me/DRAW_BOARD.Style*),DRAW_BOARD.STYLE,space(0)))),space(1),\,[space(1)])]
&ERR_STYLE_!VALID Chess Board=You must be a "player" or "watcher" to change the board style.
&ERR_LOAD_!RANGE Chess Board=[ifelse(eq(words(v(LIST_SAVES)),0),There are no saved games.,ifelse(eq(words(v(LIST_SAVES)),1),The specified game number must be 1.,The specified game number must be between 1 and [words(v(LIST_SAVES))].))]
&ERR_LOAD_!PLAYER Chess Board=You are not one of the players in that game.
&ERR_LOAD_!HERE Chess Board=Both players of the game must be present to load it.
&ERR_LOAD_!CONNECTED Chess Board=Both players of the game must be connected to load it.
&ERR_CASTLE_!MATCH Chess Board='%0' is not valid. You must choose Kingside or Queenside.
&ERR_CASTLE_!VALID1 Chess Board=You have already moved either the King or Rook and cannot castle.
&ERR_CASTLE_!VALID2 Chess Board=There are pieces between the King and Rook. You cannot castle to that side.
&ERR_CASTLE_!VALID3 Chess Board=You cannot castle: 1) into check, 2) through check, or 3) while in check.
&ERR_PLR_!AUTH Chess Board=You are not an authorized player.
&ERR_PLR_BANNED Chess Board=You are banned from using the Chess Board.
&ERR_GAME_BUSY Chess Board=There is a game in progress. Do not disturb.
&ERR_COLOR_!VALID Chess Board='%0' is not a valid color. Please choose 'white' or 'black'.
&ERR_PLR_CHOSEN Chess Board=You have already chosen a Chess piece color.
&ERR_FLIP_!VALID Chess Board=You must be a "player" or "watcher" to flip your view of the board.
&ERR_FOOTER_!VALID Chess Board=You must be a "player" or "watcher" to toggle the view of the footer.
&ERR_WATCH_!VALID Chess Board=You have already chosen to either play the game or to watch it.
&ERR_PLR_!PLAYING Chess Board=You must be a "player" to use that command.
&ERR_GAME_!BUSY Chess Board=There is no game in progress. Use 'chess start' first.
&ERR_PLR_!TURN Chess Board=It is not your turn.
&ERR_COORD_!VALID Chess Board=The coordinate '%0' is not valid. Coords must be between a1 and h8.
&ERR_PIECE_!VALID Chess Board=You do not have a piece on coordinate %0.
&ERR_MOVE_!VALID Chess Board=That is an invalid move.
&ERR_TAKEBACK_EXISTS Chess Board=A takeback request already exists.
&ERR_TAKEBACK_!EXISTS Chess Board=There is no pending takeback request.
&ERR_TAKEBACK_SAMEPLR Chess Board=You cannot accept or decline your own takeback request.
&ERR_TIME_!EXPIRED Chess Board=Your opponent's time has not expired.
&ERR_!TWO_PLAYERS Chess Board=There must be a player at both sets of pieces before a game can start.
&ERR_MOVE_CHECKS Chess Board=Your King would be in check with that move.
think [ansi(hm,INSTALL:)] Downloading Chess Messages...
&TXT_TITLE Chess Board=[ansi(hb,repeat(-,78))]%r[ansi(hb,<<<<<)][ansi(hc,center(%0,68))][ansi(hb,>>>>>)]%r[ansi(hb,repeat(-,78))]%r
&TXT_STYLE.BOARD Chess Board=You change the view of the board to Style %0.
&TXT_FLIP.BOARD Chess Board=You flip the board around.
&TXT_FOOTER.BOARD Chess Board=You toggle the view of the Chess footer.
think [ansi(hm,INSTALL:)] Downloading Chess Monitors...
&LISTEN_LEAVE Chess Board=^* has left.:[ifelse(match(pmatch(%0),%#),ifelse(or(member(v(DATA_PLAYER.White),%#),member(v(DATA_PLAYER.Black),%#)),ifelse(v(FLAG_BUSY),[u(TRI_GAME.Save,%#)][u(TRI_REMOVE.Player,%#)],u(TRI_REMOVE.Player,%#)),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_REMOVE.Watching,%#),space(0))),space(0))]
&LISTEN_DISCONNECT Chess Board=^* has disconnected.:[ifelse(match(pmatch(%0),%#),ifelse(or(member(v(DATA_PLAYER.White),%#),member(v(DATA_PLAYER.Black),%#)),ifelse(v(FLAG_BUSY),[u(TRI_GAME.Save,%#)][u(TRI_REMOVE.Player,%#)],u(TRI_REMOVE.Player,%#)),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_REMOVE.Watching,%#),space(0))),space(0))]
think [ansi(hm,INSTALL:)] Downloading Chess Data...
&DATA_VERSION Chess Board=2.1
&DATA_ENPASSANT Chess Board=
&DATA_WATCHING.STYLE Chess Board=
&DATA_FILL2.BLACK-ANSI Chess Board=[ansi(u(DATA_COLOR.Black-Square),%b%b)]
&DATA_FILL2.WHITE-ANSI Chess Board=[ansi(u(DATA_COLOR.White-Square),%b%b)]
&DATA_COLOR.WHITE-PIECE Chess Board=hy
&DATA_COLOR.BLACK-PIECE Chess Board=hm
&DATA_COLOR.WHITE-SQUARE Chess Board=C
&DATA_COLOR.BLACK-SQUARE Chess Board=X
&DATA_FILL.WHITE-ANSI Chess Board=[ansi(u(DATA_COLOR.White-Square),%b)]
&DATA_FILL.BLACK-ANSI Chess Board=[ansi(u(DATA_COLOR.Black-Square),%b)]
&DATA_DB Chess Board=<DB# OF DATA-OBJECT>
&DATA_MU.TYPE Chess Board=MUSH
&DATA_PLAYER.BLACK Chess Board=
&DATA_CHAR1.BP Chess Board=(
&DATA_CHAR1.WP Chess Board=_
&DATA_CHAR2.WP Chess Board=_
&DATA_CHAR2.BP Chess Board=)
&DATA_FILL.BLACK Chess Board=:
&DATA_FILL.WHITE Chess Board=%b
&DATA_BOARD Chess Board=rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNR
&DATA_BOARD.COORDS Chess Board=a8 b8 c8 d8 e8 f8 g8 h8 a7 b7 c7 d7 e7 f7 g7 h7 a6 b6 c6 d6 e6 f6 g6 h6 a5 b5 c5 d5 e5 f5 g5 h5 a4 b4 c4 d4 e4 f4 g4 h4 a3 b3 c3 d3 e3 f3 g3 h3 a2 b2 c2 d2 e2 f2 g2 h2 a1 b1 c1 d1 e1 f1 g1 h1
&DATA_BOARD.NUMBERS Chess Board=81 82 83 84 85 86 87 88 71 72 73 74 75 76 77 78 61 62 63 64 65 66 67 68 51 52 53 54 55 56 57 58 41 42 43 44 45 46 47 48 31 32 33 34 35 36 37 38 21 22 23 24 25 26 27 28 11 12 13 14 15 16 17 18
&DATA_BANNED Chess Board=<LIST OF BAD PEOPLE!>
&DATA_BOARD.DEFAULT Chess Board=rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNR
&DATA_WATCHING.PLAYERS Chess Board=
&DATA_WATCHING.FLIP Chess Board=
&DATA_WATCHING.FOOTER Chess Board=
&DATA_TAKEBACK Chess Board=
&DATA_SAVE.CURRENT Chess Board=1
&DATA_TIMER.START Chess Board=924018192
&DATA_TIMER.TOTAL Chess Board=18000
&DATA_PLAYER.TURN Chess Board=1
&DATA_PLAYER.WHITE Chess Board=
&LIST_SAVES Chess Board=
think [ansi(hm,INSTALL:)] Downloading Chess Functions...
&FUN_CHECK.NUMS2 Chess Board=[ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),2,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),4,1,|),[mid(%2,dec(member(v(dATA_BOARD.Numbers),##)),1)] ##),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),6,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),8,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))]
&FUN_CHECK4CHECK.NUMS Chess Board=[u(FUN_Check.Nums,extract(v(DATA_BOARD.Numbers),pos(extract(K k,setr(8,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0)),1),%1),1),extract(White Black,%q8,1),%1,match(Black White,[extract(White Black,%q8,1)]*))]
&FUN_CHECK.NUMS Chess Board=[ifelse(member(extract(R Q | r q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),1,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(R Q | r q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),3,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(R Q | r q,%3,1,|),setr(6,first(edit(iter(extract(v(PATH_%0),5,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(R Q | r q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),7,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),2,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),4,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),6,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),8,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [iter(extract(v(PATH_%0),9,1,|),ifelse(member(mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1),extract(N n,%3,1)),N_##,space(0)))] [ifelse(setr(5,member(cat(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-9 9,%3,1)))),1),mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-11 11,%3,1)))),1)),extract(P p,%3,1))),P_[add(%0,ifelse(eq(%q5,1),extract(-9 9,%3,1),extract(-11 11,%3,1)))],space(0))]
&FUN_MOVE.VALID-P.BLACK Chess Board=[ifelse(and(eq(sub(%2,%1),-10),member(u(FUN_Num2Piece,%2),-)),1,ifelse(and(and(eq(sub(%2,%1),-20),and(gte(%1,70),lt(%1,80))),and(member(u(FUN_Num2Piece,add(%1,-10)),-),member(u(FUN_Num2Piece,%2),-))),ifelse(member([u(FUN_Num2Piece,add(%1,-9))] [u(FUN_Num2Piece,add(%1,-11))],P),1[u(DO_Pawn.EnPassant)],1),ifelse(or(eq(sub(%2,%1),-9),eq(sub(%2,%1),-11)),not(not(member(Q N P B R,u(FUN_Num2Piece,%2)))),0)))]
&FUN_MOVE.VALID-P.WHITE Chess Board=[ifelse(and(eq(sub(%2,%1),10),member(u(FUN_Num2Piece,%2),-)),1,ifelse(and(and(eq(sub(%2,%1),20),and(gte(%1,20),lt(%1,30))),and(member(u(FUN_Num2Piece,add(%1,10)),-),member(u(FUN_Num2Piece,%2),-))),ifelse(member([u(FUN_Num2Piece,add(%1,9))] [u(FUN_Num2Piece,add(%1,11))],p),1[u(DO_Pawn.EnPassant)],1),ifelse(or(eq(sub(%2,%1),9),eq(sub(%2,%1),11)),not(not(member(q n p b r,u(FUN_Num2Piece,%2)))),0)))]
&FUN_NUM2PIECE Chess Board=[u(FUN_Coord2Piece,extract(v(DATA_BOARD.Coords),match(v(DATA_BOARD.Numbers),%0),1))]
&FUN_COORD2NUM Chess Board=[extract(v(DATA_BOARD.Numbers),match(v(DATA_BOARD.Coords),%0),1)]
&FUN_MOVE.VALID-P Chess Board=[u(FUN_MOVE.Valid-P.[extract(White Black,member(cat(first(v(DATA_PLAYER.White)),first(v(DATA_PLAYER.Black))),%0),1)],%0,u(FUN_Coord2Num,%1),u(FUN_Coord2Num,%2))]
&FUN_MOVE.VALID-B Chess Board=[and(member(setr(1,[extract(setr(3,v(PATH_[u(FUN_Coord2Num,%1)])),2,1,|)] | [extract(%q3,4,1,|)] | [extract(%q3,6,1,|)] | [extract(%q3,8,1,|)]),setr(2,u(FUN_Coord2Num,%2))),not(words(edit(edit(iter(extract(grab(%q1,*%q2*,|),1,dec(member(grab(%q1,*%q2*,|),%q2))),u(FUN_Num2Piece,##)),-,space(0)),space(1),space(0)))))]
&FUN_MOVE.VALID-N Chess Board=[not(not(member(extract(v(PATH_[u(FUN_Coord2Num,%1)]),9,1,|),u(FUN_Coord2Num,%2))))]
&FUN_MOVE.VALID-R Chess Board=[and(member(setr(1,[extract(setr(3,v(PATH_[u(FUN_Coord2Num,%1)])),1,1,|)] | [extract(%q3,3,1,|)] | [extract(%q3,5,1,|)] | [extract(%q3,7,1,|)]),setr(2,u(FUN_Coord2Num,%2))),not(words(edit(edit(iter(extract(grab(%q1,*%q2*,|),1,dec(member(grab(%q1,*%q2*,|),%q2))),u(FUN_Num2Piece,##)),-,space(0)),space(1),space(0)))))]
&FUN_MOVE.VALID-K Chess Board=[not(not(member(extract(v(PATH_[u(FUN_Coord2Num,%1)]),10,1,|),u(FUN_Coord2Num,%2))))]
&FUN_MOVE.VALID-Q Chess Board=[and(member(setr(1,extract(v(PATH_[u(FUN_Coord2Num,%1)]),1,8,|)),setr(2,u(FUN_Coord2Num,%2))),not(words(edit(edit(iter(extract(grab(%q1,*%q2*,|),1,dec(member(grab(%q1,*%q2*,|),%q2))),u(FUN_Num2Piece,##)),-,space(0)),space(1),space(0)))))]
&FUN_STYLE Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),extract(v(DATA_PLAYER.White),6,1),ifelse(member(v(DATA_PLAYER.Black),%0),extract(v(DATA_PLAYER.Black),6,1),ifelse(member(v(DATA_WATCHING.Players),%0),extract(v(DATA_WATCHING.Style),member(v(DATA_WATCHING.Players),%0),1),1)))]
&FUN_CHECK4MATE Chess Board=[setq(9,squish(trim(u(FUN_Check4Check.Nums,%0,v(DATA_BOARD)))))][not(member(u(FUN_KING.Mate,extract(v(DATA_BOARD.Numbers),pos(extract(K k,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),%1),1),extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),%1,last(first(%q9),_),extract(Black White,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),first(first(%q9),_),words(%q9)),0))]
&FUN_PIECE.BLOCK Chess Board=[member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),1,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),3,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),5,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),7,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),2,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),4,1,|),mid(%2,dec(member(v(dATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),6,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),8,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(iter(extract(v(PATH_%0),9,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),extract(N n,match(Black White,%1*),1))][or(member(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-10 10,match(Black White,%1*),1)))),1),extract(P p,match(Black White,%1*),1)),ifelse(eq(mid(%0,0,1),extract(4 5,match(Black White,%1*),1)),member(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-20 20,match(Black White,%1*),1)))),1),extract(P p,match(Black White,%1*),1)),0))]
&FUN_KING.MATE Chess Board=[setq(8,u(FUN_CREPLACE,%2,-,member(v(DATA_BOARD.Numbers),%0),1))][iter(extract(v(PATH_%0),10,1,|),ifelse(member(extract(N B R Q P | n b r q p,match(White Black,%1),1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),1,not(not(u(FUN_KING.Check,##,%1,%q8,match(Black White,%1*))))))] [ifelse(gt(%6,1),1,not(u(FUN_KING.Check,%3,%4,%2,match(Black White,%4*))))] [ifelse(or(member(p P n N,%5),gt(%6,1)),1,iter(extract(grab(v(PATH_%0),*%3*,|),1,dec(member(grab(v(PATH_%0),*%3*,|),%3))),not(u(FUN_Piece.Block,##,%4,%2))))]
&FUN_CASTLE.SPACES Chess Board=[mid(v(DATA_BOARD),add(ifelse(match(Kingside,%1*),4,0),ifelse(match(Black,%0*),1,57)),ifelse(match(Kingside,%1*),2,3))]
&FUN_PLR.CONNECTED Chess Board=[not(eq(idle(%0),-1))]
&FUN_CSORT.MUSH Chess Board=[edit(sort(edit(%0,space(0),space(1))),space(1),space(0))]
&FUN_CSORT.MUX Chess Board=[edit(sort(foreach(fun_separate.string,%0)),space(1),space(1))]
&FUN_SEPARATE.STRING Chess Board=[cat(%0,space(0))]
&FUN_CASTLE.VALID1 Chess Board=[and(and(extract(setr(2,v(DATA_PLAYER.[ifelse(member(v(DATA_PLAYER.White),%0),White,Black)])),8,1),extract(%q2,ifelse(match(%1,Kingside),9,10),1)),match(R,u(FUN_Coord2Piece,extract(h1 a1 h8 a8,match(WhiteKingside WhiteQueenside BlackKingside BlackQueenside,[ifelse(member(v(DATA_PLAYER.White),%0),White,Black)]%1),1))))]
&FUN_CASTLE.VALID2 Chess Board=[member(u(FUN_castle.spaces,extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),%1),ifelse(match(%1,King*),--,ifelse(match(%1,Queen*),---,0)))]
&FUN_CASTLE.VALID3 Chess Board=1
&FUN_PLR.AUTH Chess Board=[match(type(%0),PLAYER)]
&FUN_PATH Chess Board=[ifelse(&vert&,do-vert,ifelse(&horiz&,do-horiz,ifelse(&diag&,do-diag,#-1 INVALID PATH)))]
&FUN_FLIP Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),extract(v(DATA_PLAYER.White),3,1),ifelse(member(v(DATA_PLAYER.Black),%0),extract(v(DATA_PLAYER.Black),3,1),ifelse(member(v(DATA_WATCHING.Players),%0),extract(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0),1),0)))]
&FUN_PLR.BANNED Chess Board=[member(v(DATA_BANNED),%0)]
&FUN_FOOTER Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),extract(v(DATA_PLAYER.White),4,1),ifelse(member(v(DATA_PLAYER.Black),%0),extract(v(DATA_PLAYER.Black),4,1),ifelse(member(v(DATA_WATCHING.Players),%0),extract(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0),1),1)))]
&FUN_CREPLACE2 Chess Board=[ifelse(%2,[mid(%0,0,sub(%2,1))]%1[mid(%0,sub(add(%2,ifelse(words(%3),%3,1)),1),sub(strlen(%0),sub(add(%2,ifelse(words(%3),%3,1)),1)))],%0)]
&FUN_CREPLACE Chess Board=[edit(replace(foreach(FUN_SEPARATE,%0),%2,%1),%b,)]
&FUN_SEPARATE Chess Board=%0%b
&FUN_PLR.VALID Chess Board=[or(member(v(DATA_PLAYER.White),%0),member(v(DATA_PLAYER.Black),%0))]
&FUN_PLR.TURN Chess Board=[eq(v(DATA_PLAYER.Turn),dec(member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0)))]
&FUN_COORDS.VALID Chess Board=[and(and(eq(strlen(%0),2),pos(mid(%0,0,1),abcdefgh)),pos(mid(%0,1,1),12345678))]
&FUN_PIECE.VALID Chess Board=[not(not(pos(%1,extract(KQRNBP kqrnbp,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1))))]
&FUN_MOVE.VALID Chess Board=[and(or(member(setr(4,u(FUN_Coord2Piece,lcstr(%2))),-),member(ifelse(member(v(DATA_PLAYER.White),%0),q n b r p,Q N B R P),%q4)),u(FUN_MOVE.Valid-[u(FUN_Coord2Piece,lcstr(%1))],%0,%1,%2))]
&FUN_COORD2PIECE Chess Board=[mid(v(DATA_BOARD),dec(match(v(DATA_BOARD.Coords),%0)),1)]
&FUN_PIECE2NAME Chess Board=[extract(King Queen Knight Bishop Rook Pawn,match(K Q N B R P,%0),1)]
&FUN_CONVSECS Chess Board=[ifelse(lt(setr(6,trunc(div(%0,3600))),10),0%q6,%q6)]:[ifelse(lt(setr(7,trunc(div(sub(%0,mul(%q6,3600)),60))),10),0%q7,%q7)]:[ifelse(lt(setr(8,trunc(sub(%0,add(mul(%q6,3600),mul(%q7,60))))),10),0%q8,%q8)]
&FUN_TIME.EXPIRED Chess Board=[ifelse(lte(ifelse(eq(v(DATA_PLAYER.Turn),dec(member(White Black,%0))),sub(extract(v(DATA_PLAYER.%0),2,1),sub(secs(),v(DATA_TIMER.Start))),extract(v(DATA_PLAYER.%0),2,1)),0),1,0)]
&FUN_NORTH Chess Board=[ifelse(gte(%0,80),-,iter(lnum(sub(8,mid(%0,0,1))),add(%0,mul(#@,10))))]
&FUN_SOUTH Chess Board=[ifelse(lte(%0,19),-,iter(lnum(sub(mid(%0,0,1),1)),sub(%0,mul(#@,10))))]
&FUN_EAST Chess Board=[ifelse(eq(mid(%0,1,1),8),-,iter(lnum(sub(8,mid(%0,1,1))),add(%0,#@)))]
&FUN_WEST Chess Board=[ifelse(eq(mid(%0,1,1),1),-,iter(lnum(sub(mid(%0,1,1),1)),sub(%0,#@)))]
&FUN_NORTHEAST Chess Board=[ifelse(or(gte(%0,80),eq(mid(%0,1,1),8)),-,iter(lnum(first(sort([sub(8,mid(%0,0,1))] [sub(8,mid(%0,1,1))]))),add(%0,mul(#@,11))))]
&FUN_SOUTHEAST Chess Board=[ifelse(or(lte(%0,19),eq(mid(%0,1,1),8)),-,iter(lnum(first(sort([sub(mid(%0,0,1),1)] [sub(8,mid(%0,1,1))]))),sub(%0,mul(#@,9))))]
&FUN_NORTHWEST Chess Board=[ifelse(or(gte(%0,80),eq(mid(%0,1,1),1)),-,iter(lnum(first(sort([sub(8,mid(%0,0,1))] [sub(mid(%0,1,1),1)]))),add(%0,mul(#@,9))))]
&FUN_SOUTHWEST Chess Board=[ifelse(or(lte(%0,19),eq(mid(%0,1,1),1)),-,iter(lnum(first(sort([sub(mid(%0,1,1),1)] [sub(mid(%0,0,1),1)]))),sub(%0,mul(11,#@))))]
&FUN_SCATTER Chess Board=[squish(trim(iter([add(%0,-21)] [add(%0,-12)] [add(%0,8)] [add(%0,19)] [add(%0,21)] [add(%0,12)] [add(%0,-8)] [add(%0,-19)],ifelse(or(or(lt(##,11),gt(##,88)),or(eq(mid(##,1,1),0),eq(mid(##,1,1),9))),space(0),##))))]
&FUN_KING.CHECK Chess Board=[member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),1,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),3,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),5,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),7,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),2,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),4,1,|),mid(%2,dec(member(v(dATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),6,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),8,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(iter(extract(v(PATH_%0),9,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),extract(N n,%3,1))][member(cat(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-9 9,%3,1)))),1),mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-11 11,%3,1)))),1)),extract(P p,%3,1))]
&FUN_CHECK4CHECK Chess Board=[u(FUN_King.Check,extract(v(DATA_BOARD.Numbers),pos(extract(K k,setr(8,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0)),1),%1),1),extract(White Black,%q8,1),%1,match(Black White,[extract(White Black,%q8,1)]*))]
think [ansi(hm,INSTALL:)] Downloading Chess Paths...
&PATH_82 Chess Board=- | - | 83 84 85 86 87 88 | 73 64 55 46 37 28 | 72 62 52 42 32 22 12 | 71 | 81 | - | 61 74 63 | 83 73 72 71 81
&PATH_81 Chess Board=- | - | 82 83 84 85 86 87 88 | 72 63 54 45 36 27 18 | 71 61 51 41 31 21 11 | - | - | - | 73 62 | 82 72 71
&PATH_83 Chess Board=- | - | 84 85 86 87 88 | 74 65 56 47 38 | 73 63 53 43 33 23 13 | 72 61 | 82 81 | - | 62 71 75 64 | 84 74 73 72 82
&PATH_84 Chess Board=- | - | 85 86 87 88 | 75 66 57 48 | 74 64 54 44 34 24 14 | 73 62 51 | 83 82 81 | - | 63 72 76 65 | 85 75 74 73 83
&PATH_85 Chess Board=- | - | 86 87 88 | 76 67 58 | 75 65 55 45 35 25 15 | 74 63 52 41 | 84 83 82 81 | - | 64 73 77 66 | 86 76 75 74 84
&PATH_86 Chess Board=- | - | 87 88 | 77 68 | 76 66 56 46 36 26 16 | 75 64 53 42 31 | 85 84 83 82 81 | - | 65 74 78 67 | 87 77 76 75 85
&PATH_87 Chess Board=- | - | 88 | 78 | 77 67 57 47 37 27 17 | 76 65 54 43 32 21 | 86 85 84 83 82 81 | - | 66 75 68 | 88 78 77 76 86
&PATH_88 Chess Board=- | - | - | - | 78 68 58 48 38 28 18 | 77 66 55 44 33 22 11 | 87 86 85 84 83 82 81 | - | 67 76 | 78 77 87
&PATH_71 Chess Board=81 | 82 | 72 73 74 75 76 77 78 | 62 53 44 35 26 17 | 61 51 41 31 21 11 | - | - | - | 83 63 52 | 81 82 72 62 61 41
&PATH_72 Chess Board=82 | 83 | 73 74 75 76 77 78 | 63 54 45 36 27 18 | 62 52 42 32 22 12 | 61 | 71 | 81 | 51 84 64 53 | 82 83 73 63 62 61 71 81
&PATH_73 Chess Board=83 | 84 | 74 75 76 77 78 | 64 55 46 37 28 | 63 53 43 33 23 13 | 62 51 | 72 71 | 82 | 52 61 81 85 65 54 | 83 84 74 64 63 62 72 82
&PATH_74 Chess Board=84 | 85 | 75 76 77 78 | 65 56 47 38 | 64 54 44 34 24 14 | 63 52 41 | 73 72 71 | 83 | 53 62 82 86 66 55 | 84 85 75 65 64 63 73 83
&PATH_75 Chess Board=85 | 86 | 76 77 78 | 66 57 48 | 65 55 45 35 25 15 | 64 53 42 31 | 74 73 72 71 | 84 | 54 63 83 87 67 56 | 85 86 76 66 65 64 74 84
&PATH_76 Chess Board=86 | 87 | 77 78 | 67 58 | 66 56 46 36 26 16 | 65 54 43 32 21 | 75 74 73 72 71 | 85 | 55 64 84 88 68 57 | 86 87 77 67 66 65 75 85
&PATH_77 Chess Board=87 | 88 | 78 | 68 | 67 57 47 37 27 17 | 66 55 44 33 22 11 | 76 75 74 73 72 71 | 86 | 56 65 85 58 | 87 88 78 68 67 66 76 86
&PATH_78 Chess Board=88 | - | - | - | 68 58 48 38 28 18 | 67 56 45 34 23 12 | 77 76 75 74 73 72 71 | 87 | 57 66 86 | 88 68 67 77 87
&PATH_61 Chess Board=71 81 | 72 83 | 62 63 64 65 66 67 68 | 52 43 34 25 16 | 51 41 31 21 11 | - | - | - | 82 73 53 42 | 71 72 62 52 51
&PATH_62 Chess Board=72 82 | 73 84 | 63 64 65 66 67 68 | 53 44 35 26 17 | 52 42 32 22 12 | 51 | 61 | 71 | 41 81 83 74 54 43 | 72 73 63 53 52 51 61 71
&PATH_63 Chess Board=73 83 | 74 85 | 64 65 66 67 68 | 54 45 36 27 18 | 53 43 33 23 13 | 52 41 | 62 61 | 72 81 | 42 51 71 82 84 75 55 44 | 73 74 64 54 53 52 62 72
&PATH_64 Chess Board=74 84 | 75 86 | 65 66 67 68 | 55 46 37 28 | 54 44 34 24 14 | 53 42 31 | 63 62 61 | 73 82 | 43 52 72 83 85 76 56 45 | 74 75 65 55 54 53 63 73
&PATH_65 Chess Board=75 85 | 76 87 | 66 67 68 | 56 47 38 | 55 45 35 25 15 | 54 43 32 21 | 64 63 62 61 | 74 83 | 44 53 73 84 86 77 57 46 | 75 76 66 56 55 54 64 74
&PATH_66 Chess Board=76 86 | 77 88 | 67 68 | 57 48 | 56 46 36 26 16 | 55 44 33 22 11 | 65 64 63 62 61 | 75 84 | 45 54 74 85 87 78 58 47 | 76 67 57 56 55 65 75
&PATH_67 Chess Board=77 87 | 78 | 68 | 58 | 57 47 37 27 17 | 56 45 34 23 12 | 66 65 64 63 62 61 | 76 85 | 46 55 75 86 88 48 | 77 78 68 58 57 56 66 76
&PATH_68 Chess Board=78 88 | - | - | - | 58 48 38 28 18 | 57 46 35 24 13 | 67 66 65 64 63 62 61 | 77 86 | 47 56 76 87 | 78 58 57 67 77
&PATH_51 Chess Board=61 71 81 | 62 73 84 | 52 53 54 55 56 57 58 | 42 33 24 15 | 41 31 21 11 | - | - | - | 72 63 43 32 | 61 62 52 42 41
&PATH_52 Chess Board=62 72 82 | 63 74 85 | 53 54 55 56 57 58 | 43 34 25 16 | 42 32 22 12 | 41 | 51 | 61 | 31 71 73 64 44 33 | 62 63 53 43 42 41 51 61
&PATH_53 Chess Board=63 73 83 | 64 75 86 | 54 55 56 57 58 | 44 35 26 17 | 43 33 23 13 | 42 31 | 52 51 | 62 71 | 32 41 61 72 74 65 45 34 | 63 64 54 44 43 42 52 62
&PATH_54 Chess Board=64 74 84 | 65 76 87 | 55 56 57 58 | 45 36 27 18 | 44 34 24 14 | 43 32 21 | 53 52 51 | 63 72 81 | 33 42 62 73 75 66 46 35 | 64 65 55 45 44 43 53 63
&PATH_55 Chess Board=65 75 85 | 66 77 88 | 56 57 58 | 46 37 28 | 45 35 25 15 | 44 33 22 11 | 54 53 52 51 | 64 73 82 | 34 43 63 74 76 67 47 36 | 65 66 56 46 45 44 54 64
&PATH_56 Chess Board=66 76 86 | 67 78 | 57 58 | 47 38 | 46 36 26 16 | 45 34 23 12 | 55 54 53 52 51 | 65 74 83 | 35 44 64 75 77 68 48 37 | 66 67 57 47 46 45 55 65
&PATH_57 Chess Board=67 77 87 | 68 | 58 | 48 | 47 37 27 17 | 46 35 24 13 | 56 55 54 53 52 51 | 66 75 84 | 36 45 65 76 78 38 | 67 68 58 48 47 46 56 66
&PATH_58 Chess Board=68 78 88 | - | - | - | 48 38 28 18 | 47 36 25 14 | 57 56 55 54 53 52 51 | 67 76 85 | 37 46 66 77 | 68 48 47 57 67
&PATH_41 Chess Board=51 61 71 81 | 52 63 74 85 | 42 43 44 45 46 47 48 | 32 23 14 | 31 21 11 | - | - | - | 62 53 33 22 | 51 52 42 32 31
&PATH_42 Chess Board=52 62 72 82 | 53 64 75 86 | 43 44 45 46 47 48 | 33 24 15 | 32 22 12 | 31 | 41 | 51 | 21 61 63 54 34 23 | 62 53 43 33 32 31 41 51
&PATH_43 Chess Board=53 63 73 83 | 54 65 76 87 | 44 45 46 47 48 | 34 25 16 | 33 23 13 | 32 21 | 42 41 | 52 61 | 22 31 51 62 64 55 35 24 | 53 54 44 34 33 32 42 52
&PATH_44 Chess Board=54 64 74 84 | 55 66 77 88 | 45 46 47 48 | 35 26 17 | 34 24 14 | 33 22 11 | 43 42 41 | 53 62 71 | 23 32 52 63 65 56 36 25 | 54 55 45 35 34 33 43 53
&PATH_45 Chess Board=55 65 75 85 | 56 67 78 | 46 47 48 | 36 27 18 | 35 25 15 | 34 23 12 | 44 43 42 41 | 54 63 72 81 | 24 33 53 64 66 57 37 26 | 55 56 46 35 34 44 54 36
&PATH_46 Chess Board=56 66 76 86 | 57 68 | 47 48 | 37 28 | 36 26 16 | 35 24 13 | 45 44 43 42 41 | 55 64 73 82 | 25 34 54 65 67 58 38 27 | 56 57 47 37 36 35 45 55
&PATH_47 Chess Board=57 67 77 87 | 58 | 48 | 38 | 37 27 17 | 36 25 14 | 46 45 44 43 42 41 | 56 65 74 83 | 26 35 55 66 68 28 | 57 58 48 38 37 36 46 56
&PATH_48 Chess Board=58 68 78 88 | - | - | - | 38 28 18 | 37 26 15 | 47 46 45 44 43 42 41 | 57 66 75 84 | 27 36 56 67 | 58 38 37 47 43 57
&PATH_31 Chess Board=41 51 61 71 81 | 42 53 64 75 86 | 32 33 34 35 36 37 38 | 22 13 | 21 11 | - | - | - | 52 43 23 12 | 41 42 32 22 21
&PATH_32 Chess Board=42 52 62 72 82 | 43 54 65 76 87 | 33 34 35 36 37 38 | 23 14 | 22 12 | 21 | 31 | 41 | 11 51 53 44 24 13 | 42 43 33 23 22 21 31 41
&PATH_33 Chess Board=43 53 63 73 83 | 44 55 66 77 88 | 34 35 36 37 38 | 24 15 | 23 13 | 22 11 | 32 31 | 42 51 | 12 21 41 52 54 45 25 14 | 43 44 34 24 23 22 32 42
&PATH_34 Chess Board=44 54 64 74 84 | 45 56 67 78 | 35 36 37 38 | 25 16 | 24 14 | 23 12 | 33 32 31 | 43 52 61 | 13 22 42 53 55 46 26 15 | 44 45 35 25 24 23 33 43
&PATH_35 Chess Board=45 55 65 75 85 | 46 57 68 | 36 37 38 | 26 17 | 25 15 | 24 13 | 34 33 32 31 | 44 53 62 71 | 14 23 43 54 56 47 27 16 | 45 46 36 26 25 24 34 44
&PATH_36 Chess Board=46 56 66 76 86 | 47 58 | 37 38 | 27 18 | 26 16 | 25 14 | 35 34 33 32 31 | 45 54 63 72 81 | 15 24 44 55 57 48 28 17 | 46 47 37 27 26 25 35 45
&PATH_37 Chess Board=47 57 67 77 87 | 48 | 38 | 28 | 27 17 | 26 15 | 36 35 34 33 32 31 | 46 55 64 73 82 | 16 25 45 56 58 18 | 47 48 38 28 27 26 36 46
&PATH_38 Chess Board=48 58 68 78 88 | - | - | - | 28 18 | 27 16 | 37 36 35 34 33 32 31 | 47 56 65 74 83 | 17 26 46 57 | 48 28 27 37 47
&PATH_21 Chess Board=31 41 51 61 71 81 | 32 43 54 65 76 87 | 22 23 24 25 26 27 28 | 12 | 11 | - | - | - | 42 33 13 | 41 32 22 12 11
&PATH_22 Chess Board=32 42 52 62 72 82 | 33 44 55 66 77 88 | 23 24 25 26 27 28 | 13 | 12 | 11 | 21 | 31 | 41 43 34 14 | 32 33 23 13 12 11 21 31
&PATH_23 Chess Board=33 43 53 63 73 83 | 34 45 56 67 78 | 24 25 26 27 28 | 14 | 13 | 12 | 22 21 | 32 41 | 11 31 42 44 35 15 | 33 34 24 14 13 12 22 32
&PATH_24 Chess Board=34 44 54 64 74 84 | 35 46 57 68 | 25 26 27 28 | 15 | 14 | 13 | 23 22 21 | 33 42 51 | 12 32 43 45 36 16 | 34 35 25 15 14 13 23 33 12
&PATH_25 Chess Board=35 45 55 65 75 85 | 36 47 58 | 26 27 28 | 16 | 15 | 14 | 24 23 22 21 | 34 43 52 61 | 13 33 44 46 37 17 | 35 36 26 16 15 14 24 34
&PATH_26 Chess Board=36 46 56 66 76 86 | 37 48 | 27 28 | 17 | 16 | 15 | 25 24 23 22 21 | 35 44 53 62 71 | 14 34 45 47 38 18 | 36 37 27 17 16 15 25 35
&PATH_27 Chess Board=37 47 57 67 77 87 | 38 | 28 | 18 | 17 | 16 | 26 25 24 23 22 21 | 36 45 54 63 72 81 | 15 35 46 48 | 37 38 28 18 17 16 26 36
&PATH_28 Chess Board=38 48 58 68 78 88 | - | - | - | 18 | 17 | 27 26 25 24 23 22 21 | 37 46 55 64 73 82 | 16 36 47 | 38 18 17 27 37
&PATH_11 Chess Board=21 31 41 51 61 71 81 | 22 33 44 55 66 77 88 | 12 13 14 15 16 17 18 | - | - | - | - | - | 32 23 | 21 22 12
&PATH_12 Chess Board=22 32 42 52 62 72 82 | 23 34 45 56 67 78 | 13 14 15 16 17 18 | - | - | - | 11 | 21 | 31 33 24 | 22 23 13 11 21
&PATH_13 Chess Board=23 33 43 53 63 73 83 | 24 35 46 57 68 | 14 15 16 17 18 | - | - | - | 12 11 | 22 31 | 21 32 34 25 | 23 24 14 12 22
&PATH_14 Chess Board=24 34 44 54 64 74 84 | 25 36 47 58 | 15 16 17 18 | - | - | - | 13 12 11 | 23 32 41 | 22 33 35 26 | 24 25 15 13 23
&PATH_15 Chess Board=25 35 45 55 65 75 85 | 26 37 48 | 16 17 18 | - | - | - | 14 13 12 11 | 24 33 42 51 | 23 34 36 27 | 25 26 16 14 24
&PATH_16 Chess Board=26 36 46 56 66 76 86 | 27 38 | 17 18 | - | - | - | 15 14 13 12 11 | 25 34 43 52 61 | 24 35 37 28 | 26 27 17 15 25
&PATH_17 Chess Board=27 37 47 57 67 77 87 | 28 | 18 | - | - | - | 16 15 14 13 12 11 | 26 35 44 53 62 71 | 25 36 38 | 27 28 18 16 26
&PATH_18 Chess Board=28 38 48 58 68 78 88 | - | - | - | - | - | 17 16 15 14 13 12 11 | 27 36 45 54 63 72 81 | 26 37 | 28 17 27
think [ansi(hm,INSTALL:)] Downloading Chess Help Files...
&HELP_INTRO Chess Board=This chess program is very CPU-intensive, and is not meant to be used for fast-paced speed (or blitz) matches. It is recommended the time-controls be set to at least 10 minutes each and that you setup a board at home to move along with the program.%r%rThe colors of the pieces and squares can be fairly easily changed by editting the DATA_COLOR.* attributes. You may have to contact an Administrator if you do not have permission to change these.%r%rThis code will also determine CHECK and CHECKMATE -- however, it may not properly diagnose ALL instances of checkmate. In such an event, the player who was checkmated should chess/resign.%r%rDistribution of this code is permitted as long as you keep the COPYRIGHT information on it.
&HELP_GAMES Chess Board=Lists all the games currently in the database, as well as its players and which color they were using.
&HELP_LOAD Chess Board=Loads a game from the database. You must use the <#> as indicated in 'chess/games'.
&HELP_SAVE Chess Board=This command saves the current game into a database. Please try to finish your saved games as soon as possible, so as not to bloat the DB.
&HELP_MOVES Chess Board=This will list all the moves of the current game. A '-' indicates a piece was moved from coord1 to coord2. An 'x' means a piece was moved from coord1 to coord2, and captured a piece in the processes. A '+' indicates CHECK was called on the move, and a '++' indicates CHECKMATE. 'O-O' means the player castled Kingside, while 'O-O-O' means the player castled Queenside. Finally, 'en-pas' is short for en-passant.
&HELP_PROMOTION Chess Board=When a pawn reaches the last rank, it is promoted to a piece of your choice. By default it is changed to a Queen \(naturally)\. However, you can change this by using this command. You can specify a Queen, Knight, Rook, or Bishop.
&HELP_RESIGN Chess Board=When you are in a losing position, you should use this command to end the game.
&HELP_FLAG Chess Board=If you use this command when your opponent runs out of time, it will cause him/her to automatically FORFEIT the game.
&HELP_DECLINE Chess Board=Declines a takeback request of your opponent.
&HELP_ACCEPT Chess Board=Accepts a takeback request of your opponent.
&HELP_TAKEBACK Chess Board=Requests a takeback of one move. Your opponent may then 'chess/accept' or 'chess/decline'. If your opponent moves without accepting or declining, it will AUTOMATICALLY decline the request.
&HELP_EN-PASSANT Chess Board=This command performs the 'en-passant' maneuver using the pawn on the specified coordinate.
&HELP_CASTLE Chess Board=This command performs the 'castle' maneuver to whichever side you specify.
&HELP_MOVE Chess Board=To move a piece on the board, use this command in the following format: 'chess/move <coord1>-<coord2>'.%r%r[space(5)]Example: chess/move e2-e4%r%rYou should use this command to capture pieces as well. You do NOT have to use a different command for that. If the move you are trying to make is not valid for some reason, the code should return an error.
&HELP_FOOTER Chess Board=The 'footer' is the bottom part of the chess board which contains Player, Time, and Captured-Pieces information. If you do not want to see this every time you look at the board, you can toggle it off using this command. You can view the footer information alone by using the 'chess/clock' command.
&HELP_FLIP Chess Board=Flips the board around to view it from the opposing piece's point of view.
&HELP_STYLE Chess Board=Changes the style of the board when you look at it. You can choose 0 \(small\), 1 \(Medium\), or 2 \(LARGE\). You may need to increaes your window's height to use the large style.
&HELP_WATCH Chess Board=Allows you to watch all moves of any on-going chess match. This also permits you to use the 'chess/flip', 'chess/style', and 'chess/footer' commands. If you do not use this command, you will not see ANY of the game's chess moves.
&HELP_START Chess Board=Starts a new game from whatever position the board is currently in. To start a game from scratch use the 'chess/reset' command first.
&HELP_TIME Chess Board=Using this command, you can specify how long you want each person to have to complete all of his/her moves. You must indicate the time in the format ?h ?m ?s.%r%r[space(5)]Example: 1h 30m 0s \(would give each person 1 hr, 30 mins, and 0 secs\)
&HELP_RESET Chess Board=Moves all the pieces back onto the board and to their original starting position. The players and watchers are NOT reset with this command.
&HELP_CHOOSE Chess Board=Determines which pieces you will play with. Valid choices are 'White' and 'Black', with white always moving first.
&HELP_COMMANDS Chess Board=Here's a list of commands and a short description for each.%r%r[ansi(hm,ljust(chess/choose <color>,20))] - Sit behind WHITE or BLACK pieces to play a game.%r[ansi(hm,ljust(chess/reset,20))] - Resets the board to normal starting position.%r[ansi(hm,ljust(chess/time <time>,20))] - Sets time controls. Specify in "?h ?m ?s" format.%r[ansi(hm,ljust(chess/start,20))] - Begins a new game.%r[ansi(hm,ljust(chess/watch,20))] - Allows you to see each move on the chess board.%r[ansi(hm,ljust(chess/style <#>,20))] - Changes the style you view the board with.%r[space(23)]\(0 = Small .. 1 = Medium <default> .. 2 = Large\)%r[ansi(hm,ljust(chess/flip,20))] - Flips the view of the board around.%r[ansi(hm,ljust(chess/footer,20))] - Toggles the footer information on and off.%r%r[ansi(hm,ljust(chess/move <coords>,20))] - Moves piece from coord1 to coord2 \(i.e. e2-e4\)%r[ansi(hm,ljust(chess/castle <side>,20))] - Castles kingside or queenside.%r[ansi(hm,ljust(chess/en-pas <coord>,20))] - Performs the en-passant move with the pawn on <coord>.%r[ansi(hm,ljust(chess/takeback,20))] - Request a takeback of one move.%r[ansi(hm,ljust(chess/accept,20))] - Accepts a takeback request.%r[ansi(hm,ljust(chess/decline,20))] - Declines a takeback request.%r[ansi(hm,ljust(chess/flag,20))] - Causes your opponent to forfeit if \(s\)he is out of time.%r[ansi(hm,ljust(chess/resign,20))] - Forfeit the game to your opponent.%r[ansi(hm,ljust(chess/promo <piece>,20))] - Changes the piece your pawns are promoted to.%r[ansi(hm,ljust(chess/moves,20))] - Lists all the current moves of the game.%r%r[ansi(hm,ljust(chess/save,20))] - Saves the current game into the database.%r[ansi(hm,ljust(chess/load <#>,20))] - Loads the specified game as listed in chess/games.%r[ansi(hm,ljust(chess/games,20))] - Lists all stored games.%r%r* Type 'chess/help <command>' for more information.
think [ansi(hm,INSTALL:)] Downloading Chess Descriptions...
@DESCRIBE Chess Board=Type '[ansi(hc,chess/help)]' for more information.
@ADESCRIBE Chess Board=@tr me/DRAW_BOARD.Style[u(FUN_STYLE,%#)]=%#,[v(DATA_Board)]
@IDESCRIBE Chess Board=CMD_* TRI_* FLAG_* DRAW* DO_* ERR_* TXT_* LISTEN_* DATA_* FUN_* PATH_* HELP_* DESC IDESC
think [ansi(hm,INSTALL:)] Attempting to set pointers...
@fo me=&DATA_DB Chess Board=[num(Chess Save Database)]
think [ansi(hm,INSTALL:)] [ansi(hr,Download is complete! Now you must do the following:)]
think [ansi(hm,INSTALL:)] To install the Chess System, make sure the DATA_DB attribute is set to the
think [ansi(hm,INSTALL:)] DB# of the object that will be storing saved games. To get a list of
think [ansi(hm,INSTALL:)] commands, type 'chess/help'.
think [ansi(hm,INSTALL:)]
think [ansi(hm,INSTALL:)] There are TWO more things to note. First, this code has never been
think [ansi(hm,INSTALL:)] tested as a 'parent'. Therefore, it is recommended you do not @parent
think [ansi(hm,INSTALL:)] objects to this, unless you know what you are doing and feel you can
think [ansi(hm,INSTALL:)] debug any problems you may encounter.
think [ansi(hm,INSTALL:)]
think [ansi(hm,INSTALL:)] Secondly, the Copyright code should remain on the object AS IS -- it
think [ansi(hm,INSTALL:)] should not be modified. The only exception to this is IF you improve
think [ansi(hm,INSTALL:)] the code or add to it, you may ADD 'Modified By: <your name>' after
think [ansi(hm,INSTALL:)] the original text.
think [ansi(hm,INSTALL:)]
think [ansi(hm,INSTALL:)] If you have any problems with this code, e-mail:
think [ansi(hm,INSTALL:)] %b%b[ansi(hc,worldwar@bb6.betterbox.net)]
@set me=!quiet
@switch [isdbref(num(Chess Board))]=0,{think [ansi(hm,INSTALL:)] No "Chess Board" object found -- creating...;@create Chess Board},1,{think [ansi(hm,INSTALL:)] "Chess Board" object already exists... skipping creation.}
@switch [isdbref(num(Chess Save Database))]=0,{think [ansi(hm,INSTALL:)] No "Chess Save Database" object found -- creating...;@create Chess Save Database},1,{think [ansi(hm,INSTALL:)] "Chess Save Database" object already exists... skipping creation.}
think [ansi(hm,INSTALL:)] Setting object flags...
@set Chess Board=!no_command
@set Chess Board=!halt
think [ansi(hm,INSTALL:)] Downloading Chess Commands...
&CMD_CHESS.COMMANDS Chess Board=$chess/comm*:[pemit(%#,[u(TXT_TITLE,CHESS HELP - Commands)][u(HELP_Commands)]%r[ansi(hb,repeat(-,78))])]
&CMD_CHESS.COPYRIGHT Chess Board=$chess/copy*:[pemit(%#,Chess Code v[v(DATA_VERSION)] -- Created by: Demonic \(1999\))]
&CMD_CHESS.PROMOTION Chess Board=$chess/promo* *:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][not(not(match(Queen Knight Rook Bishop,%1*)))],0??,u(TRI_ERROR,%#,PLR_!PLAYING),10?,u(TRI_ERROR,%#,GAME_!BUSY),110,u(TRI_ERROR,%#,PROMO_!VALID),111,u(TRI_Promotion.Ok,%#,extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%#),1),secure(%1)),u(TRI_SYSERR,%#))]
&CMD_CHESS.RESIGN Chess Board=$chess/resign:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)],0?,u(TRI_ERROR,%#,PLR_!PLAYING),10,u(TRI_ERROR,%#,GAME_!BUSY),11,u(TRI_RESIGN.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.HELP2 Chess Board=$chess/help *:[ifelse(match(lattr(me/HELP_*),HELP_[secure(%0)]*),pemit(%#,[u(TXT_TITLE,CHESS HELP - [capstr(lcstr(setr(0,edit(grab(lattr(me/HELP_*),HELP_[secure(%0)]*),HELP_,space(0)))))])][u(HELP_%q0)]%r[ansi(hb,repeat(-,78))]),u(TRI_ERROR,%#,HELP_!VALID,secure(%0)))]
&CMD_CHESS.HELP Chess Board=$chess/help:[pemit(%#,[u(TXT_TITLE,CHESS HELP -- MAIN SECTION)]Please note this Chess Help is NOT intended to teach you how to play the game. If you are unsure of how to play chess\, this is not a good place to start learning. It is recommended you buy a book or contact someone who does know how to play before using this code.%r%rIf you already know how to play \(even on just a basic level\)\, these help sections should be able to assist you on using this code. If you find ANY bugs\, do not abuse them -- instead report it to an Administrator.%r%rUse the following commands for more information:%r[space(5)][ansi(hm,ljust(chess/commands,18))] - Lists all available commands.%r[space(5)][ansi(hm,ljust(chess/help <topic>,18))] - Returns a help section where <topic> is%r[space(26)]INTRO or a any command.%r[space(5)][ansi(hm,ljust(chess/copyright,18))] - Returns Copyright information.%r[ansi(hb,repeat(-,78))])]
&CMD_CHESS.ENPASSANT Chess Board=$chess/en-pa* *:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_PLR.Turn,%#)][u(FUN_COORDS.Valid,lcstr(%1))][member(u(FUN_Coord2Piece,lcstr(%1)),ifelse(member(v(DATA_PLAYER.White),%#),P,p))][match(first(v(DATA_EnPassant)),ifelse(member(v(DATA_PLAYER.White),%#),White,Black))][eq(abs(sub(last(v(DATA_EnPassant)),u(FUN_Coord2Num,lcstr(%1)))),1)],0??????,u(TRI_ERROR,%#,PLR_!PLAYING),10?????,u(TRI_ERROR,%#,GAME_!BUSY),110????,u(TRI_ERROR,%#,PLR_!TURN),1110???,u(TRI_ERROR,%#,COORD_!VALID,lcstr(%1)),11110??,u(TRI_ERROR,%#,COORD_!PAWN,lcstr(%1)),111110?,u(TRI_ERROR,%#,CANT_ENPASSANT),1111110,u(TRI_ERROR,%#,PAWN_!VALID,lcstr(%1)),1111111,u(TRI_EnPassant2.Ok,%#,lcstr(%1),u(FUN_Coord2Piece,lcstr(%1)),u(FUN_Coord2Num,lcstr(%1))),u(TRI_SYSERR,%#))]
&CMD_CHESS.STYLE Chess Board=$chess/style ?:[ifelse(match(lattr(me/DRAW_BOARD.Style*),DRAW_BOARD.Style[secure(%0)]),ifelse(member(v(DATA_PLAYER.White),%#),u(TRI_STYLE.White,%#,secure(%0)),ifelse(member(v(DATA_PLAYER.Black),%#),u(TRI_STYLE.Black,%#,secure(%0)),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_STYLE.Watching,%#,secure(%0)),u(TRI_ERROR,%#,STYLE_!VALID)))),u(TRI_ERROR,%#,STYLE_!VALID2))]
&CMD_CHESS.CLOCK Chess Board=$chess/clock:[pemit(%#,u(DRAW_FOOTER,%#))]
&CMD_CHESS.CASTLE Chess Board=$chess/castle *:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_PLR.Turn,%#)][not(not(match(Kingside Queenside,%0*)))][u(FUN_Castle.Valid1,%#,setr(1,grab(Kingside Queenside,%0*)))][u(FUN_Castle.Valid2,%#,%q1)],0?????,u(TRI_ERROR,%#,PLR_!PLAYING),10????,u(TRI_ERROR,%#,GAME_BUSY!),110???,u(TRI_ERROR,%#,PLR_!TURN),1110??,u(TRI_ERROR,%#,CASTLE_!MATCH,secure(%0)),11110?,u(TRI_ERROR,%#,CASTLE_!VALID1),111110,u(TRI_ERROR,%#,CASTLE_!VALID2),111111,u(TRI_CASTLE.Ok,%#,%q1),u(TRI_SYSERR,%#))]
&CMD_CHESS.LOAD Chess Board=$chess/load *:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][v(FLAG_BUSY)][and(lte(trunc(%0),words(v(LIST_SAVES))),gt(trunc(%0),0))][or(member(xget(v(DATA_DB),SAVE_White.[setr(9,extract(v(LIST_SAVES),trunc(%0),1))]),%#),member(xget(v(DATA_DB),SAVE_Black.%q9),%#))][and(member(lcon(%l),first(xget(v(DATA_DB),SAVE_White.%q9))),member(lcon(%l),first(xget(v(DATA_DB),SAVE_Black.%q9))))][and(u(FUN_PLR.Connected,first(xget(v(DATA_DB),SAVE_White.%q9))),u(FUN_PLR.Connected,first(xget(v(DATA_DB),SAVE_Black.%q9))))],0??????,u(TRI_ERROR,%#,PLR_!AUTH),11?????,u(TRI_ERROR,%#,PLR_BANNED),101????,u(TRI_ERROR,%#,GAME_BUSY),1000???,u(TRI_ERROR,%#,LOAD_!RANGE),10010??,u(TRI_ERROR,%#,LOAD_!PLAYER),100110?,u(TRI_ERROR,%#,LOAD_!HERE),1001110,u(TRI_ERROR,%#,LOAD_!CONNECTED),1001111,u(TRI_LOAD.Ok,%#,%q9),u(TRI_SYSERR,%#))]
&CMD_CHESS.GAMES Chess Board=$chess/games:[pemit(%#,[repeat(-,78)]%r<<<<<[center(CHESS GAMES,68)]>>>>>%r[repeat(-,78)]%r[space(6)][ljust(White,16)] [ljust(Black,20)] [ljust(White,16)] Black%r[space(6)][ljust(-----,16)] [ljust(-----,16)][space(4)] [ljust(-----,16)] -----%r%b[iter(v(LIST_SAVES),[rjust(#@.,4)] [ljust(mid(name(first(xget(v(DATA_DB),SAVE_White.##))),0,12),12)] vs. [ifelse(mod(#@,2),[ljust(mid(name(first(xget(v(DATA_DB),SAVE_Black.##))),0,12),12)][space(3)],[mid(name(first(xget(v(DATA_DB),SAVE_Black.##))),0,12)]%r)])]%r%r* Type 'chess load <#>' to load a saved game.)]
&CMD_CHESS.CHOOSE Chess Board=$chess/choose *:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][v(FLAG_BUSY)][not(not(match(white black,%0*)))][not(not(member(cat(v(DATA_PLAYER.White),v(DATA_PLAYER.Black)),%#)))],0????,u(TRI_ERROR,%#,PLR_!AUTH),11???,u(TRI_ERROR,%#,PLR_BANNED),101??,u(TRI_ERROR,%#,GAME_BUSY),1000?,u(TRI_ERROR,%#,COLOR_!VALID,secure(%0)),10011,u(TRI_ERROR,%#,PLR_CHOSEN),10010,u(TRI_Choose.Ok,%#,grab(White Black,%0*)),u(TRI_SYSERR,%#))]
&CMD_CHESS.FLIP Chess Board=$chess/flip:[ifelse(member(v(DATA_PLAYER.White),%#),u(TRI_FLIP.White,%#),ifelse(member(v(DATA_PLAYER.Black),%#),u(TRI_FLIP.Black,%#),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_FLIP.Watching,%#),u(TRI_ERROR,%#,FLIP_!VALID))))]
&CMD_CHESS.FOOTER Chess Board=$chess/foot*:[ifelse(member(v(DATA_PLAYER.White),%#),u(TRI_FOOTER.White,%#),ifelse(member(v(DATA_PLAYER.Black),%#),u(TRI_FOOTER.Black,%#),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_FOOTER.Watching,%#),u(TRI_ERROR,%#,FOOTER_!VALID))))]
&CMD_CHESS.WATCH Chess Board=$chess/watch:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][or(or(member(v(DATA_PLAYER.White),%#),member(v(DATA_PLAYER.Black),%#)),member(v(DATA_WATCHING.Players),%#))],0??,u(TRI_ERROR,%#,PLR_!AUTH),11?,u(TRI_ERROR,%#,PLR_BANNED),101,u(TRI_ERROR,%#,WATCH_!VALID),100,u(TRI_WATCH.OK,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.BOARD Chess Board=$chess/boar*:@tr me/DRAW_BOARD.Style[u(FUN_STYLE,%#)]=%#,[v(DATA_Board)]
&CMD_CHESS.MOVE Chess Board=$chess/move *-*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_PLR.Turn,%#)][u(FUN_COORDS.Valid,lcstr(%0))][u(FUN_COORDS.Valid,lcstr(%1))][setr(5,u(FUN_PIECE.Valid,%#,u(FUN_Coord2Piece,lcstr(%0))))][ifelse(%q5,u(FUN_MOVE.Valid,%#,lcstr(%0),lcstr(%1)),0)],0??????,u(TRI_ERROR,%#,PLR_!PLAYING),10?????,u(TRI_ERROR,%#,GAME_!BUSY),110????,u(TRI_ERROR,%#,PLR_!TURN),1110???,u(TRI_ERROR,%#,COORD_!VALID,lcstr(%0)),11110??,u(TRI_ERROR,%#,COORD_!VALID,lcstr(%1)),111110?,u(TRI_ERROR,%#,PIECE_!VALID,lcstr(%0)),1111110,u(TRI_ERROR,%#,MOVE_!VALID,lcstr(%0),lcstr(%1)),1111111,u(TRI_MOVE2.Ok,%#,lcstr(%0),u(FUN_Coord2Piece,lcstr(%0)),lcstr(%1),u(FUN_Coord2Piece,lcstr(%1))),u(TRI_SYSERR,%#))]
&CMD_CHESS.START Chess Board=$chess/start*:[switch([u(FUN_PLR.Auth,%#)][not(u(FUN_PLR.Banned,%#))][u(FUN_PLR.Valid,%#)][and(words(v(DATA_PLAYER.White)),words(v(DATA_PLAYER.Black)))][v(FLAG_BUSY)],0????,u(TRI_ERROR,%#,PLR_!AUTH),10???,u(TRI_ERROR,%#,PLR_BANNED),110??,u(TRI_ERROR,%#,PLR_!PLAYING),1110?,u(TRI_ERROR,%#,!TWO_PLAYERS),11111,u(TRI_ERROR,%#,GAME_BUSY),11110,u(TRI_START.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.RESET Chess Board=$chess/reset:[switch([u(FUN_PLR.Auth,%#)][not(u(FUN_PLR.Banned,%#))][u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)],0???,u(TRI_ERROR,%#,PLR_!AUTH),10??,u(TRI_ERROR,%#,PLR_BANNED),110?,u(TRI_ERROR,%#,PLR_!PLAYING),1111,u(TRI_ERROR,%#,GAME_BUSY),1110,u(TRI_RESET.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.TAKEBACK Chess Board=$chess/take*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][v(FLAG_TAKEBACK)],0??,u(TRI_ERROR,%#,PLR_!PLAYING),10?,u(TRI_ERROR,%#,GAME_!BUSY),111,u(TRI_ERROR,%#,TAKEBACK_EXISTS),110,u(TRI_TAKEBACK.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.ACCEPT Chess Board=$chess/acc*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][v(FLAG_TAKEBACK)][member(v(DATA_TAKEBACK),%#)],0???,u(TRI_ERROR,%#,PLR_!PLAYING),10??,u(TRI_ERROR,%#,GAME_!BUSY),110?,u(TRI_ERROR,%#,TAKEBACK_!EXISTS),1111,u(TRI_ERROR,%#,TAKEBACK_SamePlr),1110,u(TRI_ACCEPT.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.DECLINE Chess Board=$chess/decl*:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][v(FLAG_TAKEBACK)][member(v(DATA_TAKEBACK),%#)],0???,u(TRI_ERROR,%#,PLR_!PLAYING),10??,u(TRI_ERROR,%#,GAME_!BUSY),110?,u(TRI_ERROR,%#,TAKEBACK_!EXISTS),1111,u(TRI_ERROR,%#,TAKEBACK_SamePlr),1110,u(TRI_DECLINE.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.MOVES Chess Board=$chess/moves:[pemit(%#,[repeat(-,78)]%r<<<<<[center(CHESS MOVES,68)]>>>>>%r[repeat(-,78)]%r[space(6)][ljust(White,8)] [ljust(Black,25)] [ljust(White,8)] Black%r[space(6)][ljust(-----,8)] [ljust(-----,25)] [ljust(-----,8)] -----%r%b[iter(lnum(trunc(div(inc(words(v(HIST_MOVES))),2))),[rjust(#@.,4)] [ljust(extract(v(HIST_MOVES),dec(mul(2,#@)),1),8)] [ifelse(mod(#@,2),ljust(extract(v(HIST_MOVES),mul(2,#@),1),20),[extract(v(HIST_MOVES),mul(2,#@),1)]%r)])])]
&CMD_CHESS.SAVE Chess Board=$chess/save:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)],0?,u(TRI_ERROR,%#,PLR_!PLAYING),10,u(TRI_ERROR,%#,GAME_!BUSY),11,u(TRI_SAVE.Ok,%#),u(TRI_SYSERR,%#))]
&CMD_CHESS.TIME Chess Board=$chess/time *h *m *s:[switch([u(FUN_PLR.Auth,%#)][u(FUN_PLR.Banned,%#)][u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][and(gte(trunc(%0),0),lte(trunc(%0),24))][and(gte(trunc(%1),0),lt(trunc(%1),60))][and(gte(trunc(%2),0),lt(trunc(%2),60))],0??????,u(TRI_ERROR,%#,PLR_!AUTH),11?????,u(TRI_ERROR,%#,PLR_BANNED),100????,u(TRI_ERROR,%#,PLR_!PLAYING),1011???,u(TRI_ERROR,%#,GAME_BUSY),10100??,u(TRI_ERROR,%#,HOURS_!VALID,trunc(%0)),101010?,u(TRI_ERROR,%#,MINUTES_!VALID,trunc(%1)),1010110,u(TRI_ERROR,%#,SECONDS_!VALID,trunc(%2)),1010111,u(TRI_TIME.Ok,%#,trunc(%0),trunc(%1),trunc(%2)),u(TRI_SYSERR,%#))]
&CMD_CHESS.FLAG Chess Board=$chess/flag:[switch([u(FUN_PLR.Valid,%#)][v(FLAG_BUSY)][u(FUN_TIME.Expired,extract(Black White,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%#),1))],0??,u(TRI_ERROR,%#,PLR_!PLAYING),10?,u(TRI_ERROR,%#,GAME_!BUSY),110,u(TRI_ERROR,%#,TIME_!EXPIRED),111,u(TRI_FLAG.Ok,%#),u(TRI_SYSERR,%#))]
think [ansi(hm,INSTALL:)] Downloading Chess Triggers...
&TRI_PROMOTION.OK Chess Board=[set(me,DATA_PLAYER.%1:[replace(v(DATA_PLAYER.%1),7,extract(extract(Q N R B | q n r b,match(White Black,%1),1,|),match(Queen Knight Rook Bishop,%2),1))])][pemit(%0,GAME: You change your promotion piece to: [grab(Queen Knight Rook Bishop,%2*)])]
&TRI_RESIGN.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) resigns the Chess match.)][set(me,FLAG_BUSY:0)]
&TRI_CASTLE2.OK Chess Board=[ifelse(u(FUN_Check4Check,%0,%1),u(TRI_ERROR,%0,MOVE_CHECKS),ifelse(u(FUN_Check4Check,%0,%2),u(TRI_ERROR,%0,CASTLE_!VALID3),ifelse(u(FUN_Check4Check,%0,%3),u(TRI_ERROR,%0,CASTLE_!VALID3),u(DO_CASTLE,%0,%1,%4,%5))))]
&TRI_ENPASSANT2.OK Chess Board=[ifelse(u(FUN_Check4Check,%0,setr(9,u(FUN_CREPLACE,u(FUN_CREPLACE,u(FUN_CREPLACE,v(DATA_BOARD),%2,member(v(DATA_BOARD.Numbers),ifelse(member(v(DATA_PLAYER.White),%0),add(last(v(DATA_EnPassant)),10),sub(last(v(DATA_EnPassant)),10))),1),-,member(v(DATA_BOARD.Coords),%1),1),-,member(v(DATA_BOARD.Numbers),last(v(DATA_EnPassant))),1))),u(TRI_ERROR,%0,MOVE_CHECKS),u(TRI_EnPassant.OK,%0,%1,%2,u(FUN_Coord2Num,%1),%q9))]
&TRI_ENPASSANT.OK Chess Board=[u(TRI_UPDATE.Hist,setr(4,extract(White Black,inc(v(DATA_PLAYER.Turn)),1)),v(DATA_BOARD))][set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),5,u(FUN_CSORT.[v(DATA_MU.Type)],edit(strcat(extract(v(DATA_PLAYER.%q4),5,1),extract(P p,match(Black White,%q4),1)),-,space(0)),a))]))][set(me,DATA_BOARD:%4)][set(me,DATA_EnPassant:)][set(me,HIST_MOVES:[squish(trim(cat(v(HIST_MOVES),en-pas[ifelse(gt(setr(7,u(FUN_Check4Check,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),0),ifelse(setr(6,u(FUN_Check4Mate,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),++,+),space(0))])))])][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][u(TRI_Game.Emit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) makes the Chess move 'en-passant' ... Pawn captures Pawn.)][ifelse(gt(trunc(%q7),0),u(TRI_GAME.Emit,[name(%0)] calls CHECK!),space(0))][ifelse(v(FLAG_TAKEBACK),u(TRI_TAKEBACK.AutoDecline,%0),space(0))][u(TRI_UPDATE.Time,%q4)][set(me,DATA_TIMER.Start:[secs()])][ifelse(%q6,u(DO_MATE,%0),space(0))]
&TRI_STYLE.BLACK Chess Board=[set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),6,%1)])][pemit(%0,GAME: [u(TXT_STYLE.Board,%1)])]
&TRI_STYLE.WATCHING Chess Board=[set(me,DATA_WATCHING.Style:[replace(v(DATA_WATCHING.Style),member(v(DATA_WATCHING.Players),%0),%1)])][pemit(%0,GAME: [u(TXT_STYLE.Board,%1)])]
&TRI_STYLE.WHITE Chess Board=[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),6,%1)])][pemit(%0,GAME: [u(TXT_STYLE.Board,%1)])]
&TRI_TAKEBACK.AUTODECLINE Chess Board=[set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][u(TRI_GAME.Emit,[name(%0)] auto-declines the takeback request.)]
&TRI_UPDATE.TIME Chess Board=[set(me,DATA_PLAYER.%0:[replace(v(DATA_PLAYER.%0),2,sub(extract(v(DATA_PLAYER.%0),2,1),sub(secs(),v(DATA_TIMER.Start))))])]
&TRI_UPDATE.HIST Chess Board=[set(me,HIST_CAPTURES:[squish(trim(cat(v(HIST_CAPTURES),extract(v(DATA_PLAYER.%0),5,1))))])][set(me,HIST_BOARDS:[squish(trim(cat(v(HIST_BOARDS),%1)))])][set(me,HIST_TIMES:[squish(trim(cat(v(HIST_TIMES),extract(v(DATA_PLAYER.%0),2,1))))])]
&TRI_LOAD.OK Chess Board=[set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][set(me,DATA_BOARD:[xget(v(DATA_DB),SAVE_BOARD.%1)])][set(me,HIST_BOARDS:[xget(v(DATA_DB),SAVE_BOARDS.%1)])][set(me,HIST_CAPTURES:[xget(v(DATA_DB),SAVE_CAPTURES.%1)])][set(me,HIST_TIMES:[xget(v(DATA_DB),SAVE_TIMES.%1)])][set(me,HIST_MOVES:[xget(v(DATA_DB),SAVE_MOVES.%1)])][set(me,DATA_PLAYER.Turn:[xget(v(DATA_DB),SAVE_TURN.%1)])][set(me,DATA_PLAYER.White:[xget(v(DATA_DB),SAVE_White.%1)])][set(me,DATA_PLAYER.Black:[xget(v(DATA_DB),SAVE_Black.%1)])][pemit(lcon(%l),GAME: [name(%0)] has loaded game [name(first(v(DATA_PLAYER.White)))] vs. [name(first(v(DATA_PLAYER.Black)))].)][u(TRI_CLEAR.Save.[v(DATA_MU.Type)],%1)]
&TRI_CLEAR.SAVE.MUSH Chess Board=[set(me,LIST_SAVES:[remove(v(LIST_SAVES),%0)])][wipe([v(DATA_DB)]/SAVE_BOARD.%0)][wipe([v(DATA_DB)]/SAVE_BOARDS.%0)][wipe([v(DATA_DB)]/SAVE_CAPTURES.%0)][wipe([v(DATA_DB)]/SAVE_MOVES.%0)][wipe([v(DATA_DB)]/SAVE_TURN.%0)][wipe([v(DATA_DB)]/SAVE_White.%0)][wipe([v(DATA_DB)]/SAVE_Black.%0)][wipe([v(DATA_DB)]/SAVE_TIMES.%0)]
&TRI_CLEAR.SAVE.MUX Chess Board=[set(me,LIST_SAVES:[remove(v(LIST_SAVES),%0)])][set(v(DATA_DB),SAVE_BOARD.%0:)][set(v(DATA_DB),SAVE_BOARDS.%0:)][set(v(DATA_DB),SAVE_CAPTURES.%0:)][set(v(DATA_DB),SAVE_MOVES.%0:)][set(v(DATA_DB),SAVE_TURN.%0:)][set(v(DATA_DB),SAVE_WHITE.%0:)][set(v(DATA_DB),SAVE_BLACK.%0:)][set(v(DATA_DB),SAVE_TIMES.%1:)]
&TRI_CASTLE.OK Chess Board=[u(TRI_Castle.[extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)].%1,%0,%1)]
&TRI_CASTLE.WHITE.KINGSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),-RK-,61,4),u(FUN_CREPLACE,v(DATA_BOARD),-K-R,61,4),v(DATA_BOARD),White,King)]
&TRI_CASTLE.WHITE.QUEENSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),--KR-,57,5),u(FUN_CREPLACE,v(DATA_BOARD),R--K-,57,5),v(DATA_BOARD),White,Queen)]
&TRI_CASTLE.BLACK.QUEENSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),--kr-,1,5),u(FUN_CREPLACE,v(DATA_BOARD),r--k-,1,5),v(DATA_BOARD),Black,Queen)]
&TRI_CASTLE.BLACK.KINGSIDE Chess Board=[u(TRI_CASTLE2.OK,%0,u(FUN_CREPLACE,v(DATA_BOARD),-rk-,5,4),u(FUN_CREPLACE,v(DATA_BOARD),-k-r,5,4),v(DATA_BOARD),Black,King)]
&TRI_ERROR Chess Board=[pemit(%0,[v(PREFIX_ERROR)][space(not(not(words(v(PREFIX_ERROR)))))][u(ERR_%1,%2,%3,%4)])]
&TRI_SYSERR Chess Board=[pemit(%0,SYSERR: There is a bug in the code. Report this to an Admin immediately.)]
&TRI_CHOOSE.OK Chess Board=[ifelse(words(v(DATA_PLAYER.%1)),pemit(lcon(%l),GAME: [name(%0)] pushes [name(first(v(DATA_PLAYER.%1)))] out of the way and settles before the %1 pieces of the Chess Board.),pemit(lcon(%l),GAME: [name(%0)] settles before the %1 pieces of the Chess Board.))][set(me,DATA_PLAYER.%1:%0 0 [ifelse(match(%1,Black),1,0)] 1 - 1 [ifelse(match(%1,Black),q,Q)] 1 1 1)][u(TRI_REMOVE.Watching,%0)]
&TRI_FLIP.WHITE Chess Board=[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),3,not(extract(v(DATA_PLAYER.White),3,1)))])][pemit(%0,GAME: [v(TXT_FLIP.Board)])]
&TRI_FLIP.BLACK Chess Board=[set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),3,not(extract(v(DATA_PLAYER.Black),3,1)))])][pemit(%0,GAME: [v(TXT_FLIP.Board)])]
&TRI_FLIP.WATCHING Chess Board=[set(me,DATA_WATCHING.Flip:[replace(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0),not(extract(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0),1)))])][pemit(%0,GAME: [v(TXT_FLIP.Board)]
&TRI_FOOTER.BLACK Chess Board=[set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),4,not(extract(v(DATA_PLAYER.Black),4,1)))])][pemit(%0,GAME: [v(TXT_FOOTER.Board)])]
&TRI_FOOTER.WHITE Chess Board=[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),4,not(extract(v(DATA_PLAYER.White),4,1)))])][pemit(%0,GAME: [v(TXT_FOOTER.Board)])]
&TRI_FOOTER.WATCHING Chess Board=[set(me,DATA_WATCHING.Footer:[replace(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0),not(extract(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0),1)))])][pemit(%0,GAME: [v(TXT_FOOTER.Board)]
&TRI_WATCH.OK Chess Board=[pemit(lcon(%l),GAME: [name(%0)] walks over to the Chess Board to observe the game.)][set(me,DATA_WATCHING.Players:[squish(trim(cat(v(DATA_WATCHING.Players),%0)))])][set(me,DATA_WATCHING.Flip:[squish(trim(cat(v(DATA_WATCHING.Flip),0)))])][set(me,DATA_WATCHING.Footer:[squish(trim(cat(v(DATA_WATCHING.Footer),1)))])][set(me,DATA_WATCHING.Style:[squish(trim(cat(v(DATA_WATCHING.Style),1)))])]
&TRI_MOVE.OK Chess Board=[u(TRI_UPDATE.Hist,setr(4,extract(White Black,inc(v(DATA_PLAYER.Turn)),1)),v(DATA_BOARD))][ifelse(member(%4,-),,set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),5,u(FUN_CSORT.[v(DATA_MU.Type)],edit(strcat(extract(v(DATA_PLAYER.%q4),5,1),%4),-,space(0)),a))]))][set(me,DATA_BOARD:%5)][ifelse(match(%2,p),ifelse(or(gt(%7,80),lt(%7,20)),u(DO_Pawn.Promotion,%0,%7,%q4),ifelse(and(eq(abs(sub(%7,%6)),20),ifelse(match(%q4,White),member([u(FUN_Num2Piece,add(%6,19))] [u(FUN_Num2Piece,add(%6,21))],p),member([u(FUN_Num2Piece,add(%6,-19))] [u(FUN_Num2Piece,add(%6,-21))],P))),u(DO_Pawn.EnPassant,extract(Black White,match(White Black,%q4),1),%7),set(me,DATA_EnPassant:))),set(me,DATA_EnPassant:))][ifelse(match(%2,k),set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),8,0)]),ifelse(and(match(%2,r),member(ifelse(match(%q4,WHITE),a1 h1,a8 h8),%1)),set(me,DATA_PLAYER.%q4:[replace(v(DATA_PLAYER.%q4),ifelse(match(h1 h8,%1),9,10),0)]),space(0)))][set(me,HIST_MOVES:[squish(trim(cat(v(HIST_MOVES),%1[ifelse(member(%4,-),-,x)]%3[ifelse(gt(setr(7,u(FUN_Check4Check,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),0),ifelse(setr(6,u(FUN_Check4Mate,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%q4),1)])),v(DATA_BOARD))),++,+),space(0))])))])][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][u(TRI_Game.EMit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) makes the Chess move '%1[ifelse(member(%4,-),-,x)]%3' ... [u(FUN_Piece2Name,%2)] [ifelse(member(%4,-),to %3,captures [u(FUN_Piece2Name,%4)])].)][ifelse(gt(trunc(%q7),0),u(TRI_GAME.Emit,[name(%0)] calls CHECK!),space(0))][ifelse(v(FLAG_TAKEBACK),u(TRI_TAKEBACK.AutoDecline,%0),space(0))][u(TRI_UPDATE.Time,%q4)][set(me,DATA_TIMER.Start:[secs()])][ifelse(%q6,u(DO_MATE,%0),space(0))]
&TRI_GAME.EMIT Chess Board=[pemit([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))] [v(DATA_WATCHING.Players)],GAME: %0)]
&TRI_REMOVE.WATCHING Chess Board=[set(me,DATA_WATCHING.Style:[ldelete(v(DATA_WATCHING.Style),member(v(DATA_WATCHING.Players),%0))])][set(me,DATA_WATCHING.Flip:[ldelete(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0))])][set(me,DATA_WATCHING.Footer:[ldelete(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0))])][set(me,DATA_WATCHING.Players:[remove(v(DATA_WATCHING.Players),%0)])]
&TRI_START.OK Chess Board=[set(me,FLAG_BUSY:1)][pemit(lcon(%l),GAME: A Chess game is starting. Type 'chess watch' to observe.)][ifelse(member(v(DATA_BOARD),v(DATA_BOARD.Default)),[set(me,DATA_PLAYER.White:[replace(v(DATA_PLAYER.White),2,v(DATA_TIMER.Total))])][set(me,DATA_PLAYER.Black:[replace(v(DATA_PLAYER.Black),2,v(DATA_TIMER.Total))])],space(0))][set(me,DATA_TIMER.START:[secs()])][set(me,DATA_PLAYER.Turn:0)]
&TRI_RESET.OK Chess Board=[set(me,HIST_TIMES:)][set(me,HIST_CAPTURES:)][set(me,HIST_MOVES:)][set(me,HIST_BOARDS:)][set(me,DATA_BOARD:[v(DATA_BOARD.Default)])][set(me,DATA_PLAYER.Turn:0)][u(TRI_GAME.Emit,The board has been reset by [name(%0)].)][ifelse(words(v(DATA_PLAYER.White)),set(me,DATA_PLAYER.White:[first(v(DATA_PLAYER.White))] 0 0 1 - 1 Q 1 1 1),space(0))][ifelse(words(v(DATA_PLAYER.Black)),set(me,DATA_PLAYER.Black:[first(v(DATA_PLAYER.Black))] 0 1 1 - 1 q 1 1 1),space(0))]
&TRI_TAKEBACK.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] has requested a takeback! Type 'chess accept' or 'chess decline'.)][set(me,FLAG_TAKEBACK:1)][set(me,DATA_TAKEBACK:%0)]
&TRI_DECLINE.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] declines the takeback request.)][set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)]
&TRI_ACCEPT.OK Chess Board=[set(me,DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]:[replace(v(DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]),2,last(v(HIST_TIMES)))])][set(me,DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]:[replace(v(DATA_PLAYER.[extract(Black White,inc(v(DATA_PLAYER.Turn)),1)]),5,last(v(HIST_CAPTURES)))])][set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][set(me,DATA_BOARD:[last(v(HIST_BOARDS))])][set(me,HIST_BOARDS:[ldelete(v(HIST_BOARDS),words(v(HIST_BOARDS)))])][u(TRI_GAME.Emit,[name(%0)] accepts the takeback request.)][u(TRI_GAME.Emit,The system [ifelse(member(O-O-O O-O,last(v(HIST_MOVES))),removes the [extract(Queenside Kingside,member(O-O-O O-O,last(v(HIST_MOVES))),1)]-Castle.,ifelse(member(en-pass,last(v(HIST_MOVES))),undoes the en-passant.,ifelse(pos(x,last(v(HIST_MOVES))),moves [last(last(v(HIST_MOVES)),x)] back to [first(last(v(HIST_MOVES)),x)].,moves [last(last(v(HIST_MOVES)),-)] back to [first(last(v(HIST_MOVES)),-)].)))])][set(me,HIST_MOVES:[ldelete(v(HIST_MOVES),words(v(HIST_MOVES)))])][set(me,HIST_CAPTURES:[ldelete(v(HIST_CAPTURES),words(v(HIST_CAPTURES)))])][set(me,HIST_TIMES:[ldelete(v(HIST_TIMES),words(v(HIST_TIMES)))])]
&TRI_GAME.SAVE Chess Board=[set(me,FLAG_BUSY:0)][set(me,FLAG_TAKEBACK:0)][set(me,DATA_TAKEBACK:)][set(me,DATA_SAVE.Current:[inc(v(DATA_SAVE.Current))])][set(me,LIST_SAVES:[cat(v(LIST_SAVES),v(DATA_SAVE.Current))])][set([v(DATA_DB)],SAVE_BOARD.[v(DATA_SAVE.Current)]:[v(DATA_BOARD)])][set([v(DATA_DB)],SAVE_BOARDS.[v(DATA_SAVE.Current)]:[v(HIST_BOARDS)])][set([v(DATA_DB)],SAVE_CAPTURES.[v(DATA_SAVE.Current)]:[v(HIST_CAPTURES)])][set([v(DATA_DB)],SAVE_TIMES.[v(DATA_SAVE.Current)]:[v(HIST_TIMES)])][set([v(DATA_DB)],SAVE_MOVES.[v(DATA_SAVE.Current)]:[v(HIST_MOVES)])][set([v(DATA_DB)],SAVE_TURN.[v(DATA_SAVE.Current)]:[v(DATA_PLAYER.Turn)])][set([v(DATA_DB)],SAVE_White.[v(DATA_SAVE.Current)]:[v(DATA_PLAYER.White)])][set([v(DATA_DB)],SAVE_Black.[v(DATA_SAVE.Current)]:[v(DATA_PLAYER.Black)])][u(TRI_GAME.Emit,The game has been saved as [name(first(v(DATA_PLAYER.White)))] vs. [name(first(v(DATA_PLAYER.Black)))].)][u(TRI_RESET.Ok,%0)]
&TRI_SAVE.OK Chess Board=[u(TRI_GAME.Save,%0)][set(me,DATA_PLAYER.White:)][set(me,DATA_PLAYER.Black:)]
&TRI_REMOVE.PLAYER Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),set(me,DATA_PLAYER.White:),ifelse(member(v(DATA_PLAYER.Black),%0),set(me,DATA_PLAYER.Black:),space(0)))]
&TRI_TIME.OK Chess Board=[u(TRI_GAME.Emit,[name(%0)] sets the time controls to %1h %2m %3s.)][set(me,DATA_TIMER.Start:[secs()])][set(me,DATA_TIMER.Total:[add(%3,mul(%2,60),mul(%1,3600))])]
&TRI_FLAG.OK Chess Board=[u(TRI_Game.Emit,[name(%0)] has called 'FLAG' and wins the game!)][set(me,FLAG_BUSY:0)]
&TRI_MOVE2.OK Chess Board=[ifelse(u(FUN_Check4Check,%0,setr(9,u(FUN_CREPLACE,u(FUN_CREPLACE,v(DATA_BOARD),%2,member(v(DATA_BOARD.Coords),%3),1),-,member(v(DATA_BOARD.Coords),%1),1))),u(TRI_ERROR,%0,MOVE_CHECKS),u(TRI_MOVE.Ok,%0,%1,%2,%3,%4,%q9,u(FUN_Coord2Num,%1),u(FUN_Coord2Num,%3)))]
think [ansi(hm,INSTALL:)] Downloading Chess Flags...
&FLAG_BUSY Chess Board=0
&FLAG_TAKEBACK Chess Board=0
think [ansi(hm,INSTALL:)] Downloading Chess Ascii-Art...
&DRAW_BOARD.STYLE1 Chess Board=@pemit %0=[setr(9,u(DRAW_HEADER.[ifelse(u(FUN_Flip,%0),Flip,Norm)],%0,5,6))]%b%b%b[repeat(.-----.=====,4)].;@dol [lnum(8)]={@pemit %0=%b[u(DRAW2_Board,%0,#@,u(FUN_Flip,%0),%1)]};@wait 0={@pemit %0=%q9[ifelse(u(FUN_Footer,%0),%r[u(DRAW_FOOTER,%0)],space(0))]}
&DRAW4_BOARD Chess Board=[ifelse(%2,%1,abs(sub(%1,9)))]%b|[edit(| [iter(lnum(8),![ifelse(mod(add(#@,%1),2),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.Black-Ansi),u(DATA_Fill.Black))),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.White-Ansi),u(DATA_Fill.White))))][ifelse(or(member(setr(1,mid(ifelse(%2,reverse(%3),%3),dec(add(#@,mul(dec(%1),8))),1)),-),eq(words(%q1),0)),repeat(%q0,3),[ifelse(eq(comp(%q1,a),-1),[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.WHITE-Piece)],[v(DATA_Char1.WP)]%q1[v(DATA_Char2.WP)])],[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.BLACK-Piece)],[v(DATA_Char1.BP)]%q1[v(DATA_Char2.BP)])])])]%q0|)],| !,space(0))][ifelse(eq(%1,8),%r%b%b%b`[repeat(-,40)]',)]
&DRAW_BOARD Chess Board=@tr me/DRAW_BOARD.Style[u(FUN_STYLE,%0)]=%0,[v(DATA_Board)]
&DRAW_BOARD.STYLE0 Chess Board=@pemit %0=[setr(9,u(DRAW_HEADER.[ifelse(u(FUN_Flip,%0),Flip,Norm)],%0,4,6))]%b%b%b.[repeat(-,40)].;@dol [lnum(8)]={@pemit %0=%b[u(DRAW4_Board,%0,#@,u(FUN_Flip,%0),%1)]};@wait 0={@pemit %0=%q9[ifelse(u(FUN_Footer,%0),%r[u(DRAW_FOOTER,%0)],space(0))]}
&DRAW_BOARD.STYLE2 Chess Board=@pemit %0=[setr(9,u(DRAW_HEADER.[ifelse(u(FUN_Flip,%0),Flip,Norm)],%0,6,7))]%b%b%b.[repeat(-,56)].;@dol [lnum(24)]={@pemit %0=%b[u(DRAW3_Board,%0,#@,u(FUN_Flip,%0),%1)]};@wait 0={@pemit %0=%q9[ifelse(u(FUN_Footer,%0),%r[u(DRAW_FOOTER,%0)],space(0))]}
&DRAW3_BOARD Chess Board=[ifelse(mod(sub(%1,2),3),ifelse(mod(div(dec(%1),3),2),%b%b%|[repeat(ifelse(hasflag(%0,ANSI),[ansi(u(DATA_COLOR.BLACK-Square),%b%b%b%b%b%b%b)][ansi(u(DATA_COLOR.WHITE-Square),%b%b%b%b%b%b%b)],[repeat(u(DATA_FILL.Black),7)][repeat(u(DATA_FILL.White),7)]),4)]|,%b%b%|[repeat(ifelse(hasflag(%0,ANSI),[ansi(u(DATA_COLOR.WHITE-Square),%b%b%b%b%b%b%b)][ansi(u(DATA_COLOR.BLACK-Square),%b%b%b%b%b%b%b)],[repeat(u(DATA_FILL.White),7)][repeat(u(DATA_FILL.Black),7)]),4)]|),[ifelse(%2,inc(div(sub(%1,2),3)),abs(sub(inc(div(sub(%1,2),3)),9)))]%b|[edit(| [iter(lnum(8),![ifelse(mod(add(#@,inc(div(sub(%1,2),3))),2),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.Black-Ansi),u(DATA_Fill.Black))),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.White-Ansi),u(DATA_Fill.White))))]%q0[ifelse(or(member(setr(1,mid(ifelse(%2,reverse(%3),%3),dec(add(#@,mul(dec(inc(div(sub(%1,2),3))),8))),1)),-),eq(words(%q1),0)),repeat(%q0,3),[ifelse(eq(comp(%q1,a),-1),[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,inc(div(sub(%1,2),3))),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.WHITE-Piece)],[v(DATA_Char1.WP)]%q1[v(DATA_Char2.WP)])],[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,inc(div(sub(%1,2),3))),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.BLACK-Piece)],[v(DATA_Char1.BP)]%q1[v(DATA_Char2.BP)])])])]%q0%q0|)],| !,space(0))])][ifelse(eq(%1,24),%r%b%b%b`[repeat(-,56)]',)]
&DRAW2_BOARD Chess Board=[ifelse(%2,%1,abs(sub(%1,9)))] [edit(| [iter(lnum(8),![ifelse(mod(add(#@,%1),2),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.Black-Ansi),u(DATA_Fill.Black))),setr(0,ifelse(hasflag(%0,ANSI),u(DATA_FILL.White-Ansi),u(DATA_Fill.White))))][ifelse(or(member(setr(1,mid(ifelse(%2,reverse(%3),%3),dec(add(#@,mul(dec(%1),8))),1)),-),eq(words(%q1),0)),repeat(%q0,3),[ifelse(eq(comp(%q1,a),-1),[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.WHITE-Piece)],[v(DATA_Char1.WP)]%q1[v(DATA_Char2.WP)])],[ansi([u(DATA_COLOR.[ifelse(mod(add(#@,%1),2),BLACK,WHITE)]-SQUARE)][u(DATA_COLOR.BLACK-Piece)],[v(DATA_Char1.BP)]%q1[v(DATA_Char2.BP)])])])]%q0|)],| !,|)]%r%b%b%b[ifelse(eq(%1,8),`-----[repeat(^=====^-----,3)]^=====',ifelse(mod(%1,2),|[repeat(=====+-----+,3)]=====+-----|,|[repeat(-----+=====+,3)]-----+=====|))]
&DRAW_FOOTER Chess Board=%b[ansi(u(DATA_COLOR.WHITE-Piece),[ljust([v(DATA_CHAR1.WP)]White[v(DATA_CHAR2.WP)]%b%b: [ifelse(words(v(DATA_PLAYER.White)),ifelse(and(eq(v(DATA_PLAYER.Turn),0),v(FLAG_BUSY)),** [name(first(v(DATA_PLAYER.White)))] **,name(first(v(DATA_PLAYER.White)))),-None-)],37)])][ansi(u(DATA_COLOR.BLACK-Piece),[v(DATA_CHAR1.BP)]Black[v(DATA_CHAR2.BP)]%b%b: [ifelse(words(v(DATA_PLAYER.Black)),ifelse(and(eq(v(DATA_PLAYER.Turn),1),v(FLAG_BUSY)),** [name(first(v(DATA_PLAYER.Black)))] **,name(first(v(DATA_PLAYER.Black)))),-None-)])]%r%b[ljust(TimeLeft : [ifelse(words(v(DATA_PLAYER.White)),u(FUN_ConvSecs,ifelse(and(eq(v(DATA_PLAYER.Turn),0),v(FLAG_BUSY)),sub(extract(v(DATA_PLAYER.White),2,1),sub(secs(),v(DATA_TIMER.Start))),extract(v(DATA_PLAYER.White),2,1))),-None-)],37)]TimeLeft : [ifelse(words(v(DATA_PLAYER.Black)),u(FUN_ConvSecs,ifelse(and(eq(v(DATA_PLAYER.Turn),1),v(FLAG_BUSY)),sub(extract(v(DATA_PLAYER.Black),2,1),sub(secs(),v(DATA_TIMER.Start))),extract(v(DATA_PLAYER.Black),2,1))),-None-)]%r%b[ljust(Captured : \[[ifelse(not(member(extract(v(dATA_PLAYER.White),5,1),-)),edit(extract(v(DATA_PLAYER.White),5,1),space(1),space(0)),-None-)]\],37)]Captured : \[[ifelse(not(member(extract(v(DATA_PLAYER.Black),5,1),-)),edit(extract(v(DATA_PLAYER.Black),5,1),space(1),space(0)),-None-)]\]
&DRAW_HEADER.NORM Chess Board=[space(%2)]A[space(%1)]B[space(%1)]C[space(%1)]D[space(%1)]E[space(%1)]F[space(%1)]G[space(%1)]H%r
&DRAW_HEADER.FLIP Chess Board=[space(%2)]H[space(%1)]G[space(%1)]F[space(%1)]E[space(%1)]D[space(%1)]C[space(%1)]B[space(%1)]A%r
think [ansi(hm,INSTALL:)] Downloading Chess Actions...
&DO_MATE Chess Board=[u(TRI_GAME.Emit,[name(%0)] \([extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1)]\) calls *** CHECK MATE!! ***)][set(me,FLAG_BUSY:0)]
&DO_CASTLE Chess Board=[u(TRI_UPDATE.Hist,%2,v(DATA_BOARD))][set(me,DATA_PLAYER.%2:[extract(v(DATA_PLAYER.%2),1,7)] 0 0 0)][set(me,DATA_BOARD:%1)][set(me,DATA_EnPassant:)][set(me,HIST_MOVES:[squish(trim(cat(v(HIST_MOVES),[ifelse(match(%3,KING),O-O,O-O-O)][ifelse(gt(setr(7,u(FUN_Check4Check,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%2),1)])),v(DATA_BOARD))),0),ifelse(setr(6,u(FUN_Check4Mate,first(v(DATA_PLAYER.[extract(White Black,match(Black White,%2),1)])),v(DATA_BOARD))),++,+),space(0))])))])][set(me,DATA_PLAYER.Turn:[not(v(DATA_PLAYER.Turn))])][u(TRI_Game.Emit,[name(%0)] \(%2\) makes the Chess move '[ifelse(match(%3,KING),O-O,O-O-O)]' ... Castle [capstr(lcstr(%3))]-Side.)][ifelse(gt(trunc(%q7),0),u(TRI_GAME.Emit,[name(%0)] calls CHECK!),space(0))][ifelse(v(FLAG_TAKEBACK),u(TRI_TAKEBACK.AutoDecline,%0),space(0))][u(TRI_UPDATE.Time,%q4)][set(me,DATA_TIMER.Start:[secs()])][ifelse(%q6,u(DO_MATE,%0),space(0))]
&DO_PAWN.ENPASSANT Chess Board=[set(me,DATA_EnPassant:%0 %1)]
&DO_PAWN.PROMOTION Chess Board=[set(me,DATA_BOARD:[u(FUN_CREPLACE,v(DATA_BOARD),extract(v(DATA_PLAYER.%2),7,1),member(v(DATA_BOARD.Numbers),%1),1)])][u(TRI_Game.Emit,[name(%0)]'s pawn is promoted to a [extract(QUEEN ROOK BISHOP KNIGHT,match(Q R B N,extract(v(DATA_PLAYER.%2),7,1)),1)]!)]
think [ansi(hm,INSTALL:)] Downloading Chess Error-Messages...
&ERR_PROMO_!VALID Chess Board=That is not a valid promotion piece. You must use: Queen, Rook, Knight, or Bishop.
&ERR_HELP_!VALID Chess Board=There is no help section on '%0'.
&ERR_PAWN_!VALID Chess Board=You cannot en passant with that pawn.
&ERR_CANT_ENPASSANT Chess Board=You cannot en passant right now.
&ERR_COORD_!PAWN Chess Board=You do not have a pawn on '%0'.
&ERR_STYLE_!VALID2 Chess Board=That is not a valid style. Choose one of the following:%r[space(10)][edit(trim(squish(edit(lattr(me/DRAW_BOARD.Style*),DRAW_BOARD.STYLE,space(0)))),space(1),\,[space(1)])]
&ERR_STYLE_!VALID Chess Board=You must be a "player" or "watcher" to change the board style.
&ERR_LOAD_!RANGE Chess Board=[ifelse(eq(words(v(LIST_SAVES)),0),There are no saved games.,ifelse(eq(words(v(LIST_SAVES)),1),The specified game number must be 1.,The specified game number must be between 1 and [words(v(LIST_SAVES))].))]
&ERR_LOAD_!PLAYER Chess Board=You are not one of the players in that game.
&ERR_LOAD_!HERE Chess Board=Both players of the game must be present to load it.
&ERR_LOAD_!CONNECTED Chess Board=Both players of the game must be connected to load it.
&ERR_CASTLE_!MATCH Chess Board='%0' is not valid. You must choose Kingside or Queenside.
&ERR_CASTLE_!VALID1 Chess Board=You have already moved either the King or Rook and cannot castle.
&ERR_CASTLE_!VALID2 Chess Board=There are pieces between the King and Rook. You cannot castle to that side.
&ERR_CASTLE_!VALID3 Chess Board=You cannot castle: 1) into check, 2) through check, or 3) while in check.
&ERR_PLR_!AUTH Chess Board=You are not an authorized player.
&ERR_PLR_BANNED Chess Board=You are banned from using the Chess Board.
&ERR_GAME_BUSY Chess Board=There is a game in progress. Do not disturb.
&ERR_COLOR_!VALID Chess Board='%0' is not a valid color. Please choose 'white' or 'black'.
&ERR_PLR_CHOSEN Chess Board=You have already chosen a Chess piece color.
&ERR_FLIP_!VALID Chess Board=You must be a "player" or "watcher" to flip your view of the board.
&ERR_FOOTER_!VALID Chess Board=You must be a "player" or "watcher" to toggle the view of the footer.
&ERR_WATCH_!VALID Chess Board=You have already chosen to either play the game or to watch it.
&ERR_PLR_!PLAYING Chess Board=You must be a "player" to use that command.
&ERR_GAME_!BUSY Chess Board=There is no game in progress. Use 'chess start' first.
&ERR_PLR_!TURN Chess Board=It is not your turn.
&ERR_COORD_!VALID Chess Board=The coordinate '%0' is not valid. Coords must be between a1 and h8.
&ERR_PIECE_!VALID Chess Board=You do not have a piece on coordinate %0.
&ERR_MOVE_!VALID Chess Board=That is an invalid move.
&ERR_TAKEBACK_EXISTS Chess Board=A takeback request already exists.
&ERR_TAKEBACK_!EXISTS Chess Board=There is no pending takeback request.
&ERR_TAKEBACK_SAMEPLR Chess Board=You cannot accept or decline your own takeback request.
&ERR_TIME_!EXPIRED Chess Board=Your opponent's time has not expired.
&ERR_!TWO_PLAYERS Chess Board=There must be a player at both sets of pieces before a game can start.
&ERR_MOVE_CHECKS Chess Board=Your King would be in check with that move.
think [ansi(hm,INSTALL:)] Downloading Chess Messages...
&TXT_TITLE Chess Board=[ansi(hb,repeat(-,78))]%r[ansi(hb,<<<<<)][ansi(hc,center(%0,68))][ansi(hb,>>>>>)]%r[ansi(hb,repeat(-,78))]%r
&TXT_STYLE.BOARD Chess Board=You change the view of the board to Style %0.
&TXT_FLIP.BOARD Chess Board=You flip the board around.
&TXT_FOOTER.BOARD Chess Board=You toggle the view of the Chess footer.
think [ansi(hm,INSTALL:)] Downloading Chess Monitors...
&LISTEN_LEAVE Chess Board=^* has left.:[ifelse(match(pmatch(%0),%#),ifelse(or(member(v(DATA_PLAYER.White),%#),member(v(DATA_PLAYER.Black),%#)),ifelse(v(FLAG_BUSY),[u(TRI_GAME.Save,%#)][u(TRI_REMOVE.Player,%#)],u(TRI_REMOVE.Player,%#)),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_REMOVE.Watching,%#),space(0))),space(0))]
&LISTEN_DISCONNECT Chess Board=^* has disconnected.:[ifelse(match(pmatch(%0),%#),ifelse(or(member(v(DATA_PLAYER.White),%#),member(v(DATA_PLAYER.Black),%#)),ifelse(v(FLAG_BUSY),[u(TRI_GAME.Save,%#)][u(TRI_REMOVE.Player,%#)],u(TRI_REMOVE.Player,%#)),ifelse(member(v(DATA_WATCHING.Players),%#),u(TRI_REMOVE.Watching,%#),space(0))),space(0))]
think [ansi(hm,INSTALL:)] Downloading Chess Data...
&DATA_VERSION Chess Board=2.1
&DATA_ENPASSANT Chess Board=
&DATA_WATCHING.STYLE Chess Board=
&DATA_FILL2.BLACK-ANSI Chess Board=[ansi(u(DATA_COLOR.Black-Square),%b%b)]
&DATA_FILL2.WHITE-ANSI Chess Board=[ansi(u(DATA_COLOR.White-Square),%b%b)]
&DATA_COLOR.WHITE-PIECE Chess Board=hy
&DATA_COLOR.BLACK-PIECE Chess Board=hm
&DATA_COLOR.WHITE-SQUARE Chess Board=C
&DATA_COLOR.BLACK-SQUARE Chess Board=X
&DATA_FILL.WHITE-ANSI Chess Board=[ansi(u(DATA_COLOR.White-Square),%b)]
&DATA_FILL.BLACK-ANSI Chess Board=[ansi(u(DATA_COLOR.Black-Square),%b)]
&DATA_DB Chess Board=<DB# OF DATA-OBJECT>
&DATA_MU.TYPE Chess Board=MUSH
&DATA_PLAYER.BLACK Chess Board=
&DATA_CHAR1.BP Chess Board=(
&DATA_CHAR1.WP Chess Board=_
&DATA_CHAR2.WP Chess Board=_
&DATA_CHAR2.BP Chess Board=)
&DATA_FILL.BLACK Chess Board=:
&DATA_FILL.WHITE Chess Board=%b
&DATA_BOARD Chess Board=rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNR
&DATA_BOARD.COORDS Chess Board=a8 b8 c8 d8 e8 f8 g8 h8 a7 b7 c7 d7 e7 f7 g7 h7 a6 b6 c6 d6 e6 f6 g6 h6 a5 b5 c5 d5 e5 f5 g5 h5 a4 b4 c4 d4 e4 f4 g4 h4 a3 b3 c3 d3 e3 f3 g3 h3 a2 b2 c2 d2 e2 f2 g2 h2 a1 b1 c1 d1 e1 f1 g1 h1
&DATA_BOARD.NUMBERS Chess Board=81 82 83 84 85 86 87 88 71 72 73 74 75 76 77 78 61 62 63 64 65 66 67 68 51 52 53 54 55 56 57 58 41 42 43 44 45 46 47 48 31 32 33 34 35 36 37 38 21 22 23 24 25 26 27 28 11 12 13 14 15 16 17 18
&DATA_BANNED Chess Board=<LIST OF BAD PEOPLE!>
&DATA_BOARD.DEFAULT Chess Board=rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNR
&DATA_WATCHING.PLAYERS Chess Board=
&DATA_WATCHING.FLIP Chess Board=
&DATA_WATCHING.FOOTER Chess Board=
&DATA_TAKEBACK Chess Board=
&DATA_SAVE.CURRENT Chess Board=1
&DATA_TIMER.START Chess Board=924018192
&DATA_TIMER.TOTAL Chess Board=18000
&DATA_PLAYER.TURN Chess Board=1
&DATA_PLAYER.WHITE Chess Board=
&LIST_SAVES Chess Board=
think [ansi(hm,INSTALL:)] Downloading Chess Functions...
&FUN_CHECK.NUMS2 Chess Board=[ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),2,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),4,1,|),[mid(%2,dec(member(v(dATA_BOARD.Numbers),##)),1)] ##),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),6,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,match(Black White,%1*),1,|),first(setr(6,edit(iter(extract(v(PATH_%0),8,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))]
&FUN_CHECK4CHECK.NUMS Chess Board=[u(FUN_Check.Nums,extract(v(DATA_BOARD.Numbers),pos(extract(K k,setr(8,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0)),1),%1),1),extract(White Black,%q8,1),%1,match(Black White,[extract(White Black,%q8,1)]*))]
&FUN_CHECK.NUMS Chess Board=[ifelse(member(extract(R Q | r q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),1,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(R Q | r q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),3,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(R Q | r q,%3,1,|),setr(6,first(edit(iter(extract(v(PATH_%0),5,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(R Q | r q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),7,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),2,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),4,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),6,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [ifelse(member(extract(B Q | b q,%3,1,|),first(setr(6,edit(iter(extract(v(PATH_%0),8,1,|),[setr(5,mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1))] [ifelse(member(%q5,-),-,##)]),-,space(0))))),edit(extract(%q6,1,2),space(1),_),space(0))] [iter(extract(v(PATH_%0),9,1,|),ifelse(member(mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1),extract(N n,%3,1)),N_##,space(0)))] [ifelse(setr(5,member(cat(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-9 9,%3,1)))),1),mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-11 11,%3,1)))),1)),extract(P p,%3,1))),P_[add(%0,ifelse(eq(%q5,1),extract(-9 9,%3,1),extract(-11 11,%3,1)))],space(0))]
&FUN_MOVE.VALID-P.BLACK Chess Board=[ifelse(and(eq(sub(%2,%1),-10),member(u(FUN_Num2Piece,%2),-)),1,ifelse(and(and(eq(sub(%2,%1),-20),and(gte(%1,70),lt(%1,80))),and(member(u(FUN_Num2Piece,add(%1,-10)),-),member(u(FUN_Num2Piece,%2),-))),ifelse(member([u(FUN_Num2Piece,add(%1,-9))] [u(FUN_Num2Piece,add(%1,-11))],P),1[u(DO_Pawn.EnPassant)],1),ifelse(or(eq(sub(%2,%1),-9),eq(sub(%2,%1),-11)),not(not(member(Q N P B R,u(FUN_Num2Piece,%2)))),0)))]
&FUN_MOVE.VALID-P.WHITE Chess Board=[ifelse(and(eq(sub(%2,%1),10),member(u(FUN_Num2Piece,%2),-)),1,ifelse(and(and(eq(sub(%2,%1),20),and(gte(%1,20),lt(%1,30))),and(member(u(FUN_Num2Piece,add(%1,10)),-),member(u(FUN_Num2Piece,%2),-))),ifelse(member([u(FUN_Num2Piece,add(%1,9))] [u(FUN_Num2Piece,add(%1,11))],p),1[u(DO_Pawn.EnPassant)],1),ifelse(or(eq(sub(%2,%1),9),eq(sub(%2,%1),11)),not(not(member(q n p b r,u(FUN_Num2Piece,%2)))),0)))]
&FUN_NUM2PIECE Chess Board=[u(FUN_Coord2Piece,extract(v(DATA_BOARD.Coords),match(v(DATA_BOARD.Numbers),%0),1))]
&FUN_COORD2NUM Chess Board=[extract(v(DATA_BOARD.Numbers),match(v(DATA_BOARD.Coords),%0),1)]
&FUN_MOVE.VALID-P Chess Board=[u(FUN_MOVE.Valid-P.[extract(White Black,member(cat(first(v(DATA_PLAYER.White)),first(v(DATA_PLAYER.Black))),%0),1)],%0,u(FUN_Coord2Num,%1),u(FUN_Coord2Num,%2))]
&FUN_MOVE.VALID-B Chess Board=[and(member(setr(1,[extract(setr(3,v(PATH_[u(FUN_Coord2Num,%1)])),2,1,|)] | [extract(%q3,4,1,|)] | [extract(%q3,6,1,|)] | [extract(%q3,8,1,|)]),setr(2,u(FUN_Coord2Num,%2))),not(words(edit(edit(iter(extract(grab(%q1,*%q2*,|),1,dec(member(grab(%q1,*%q2*,|),%q2))),u(FUN_Num2Piece,##)),-,space(0)),space(1),space(0)))))]
&FUN_MOVE.VALID-N Chess Board=[not(not(member(extract(v(PATH_[u(FUN_Coord2Num,%1)]),9,1,|),u(FUN_Coord2Num,%2))))]
&FUN_MOVE.VALID-R Chess Board=[and(member(setr(1,[extract(setr(3,v(PATH_[u(FUN_Coord2Num,%1)])),1,1,|)] | [extract(%q3,3,1,|)] | [extract(%q3,5,1,|)] | [extract(%q3,7,1,|)]),setr(2,u(FUN_Coord2Num,%2))),not(words(edit(edit(iter(extract(grab(%q1,*%q2*,|),1,dec(member(grab(%q1,*%q2*,|),%q2))),u(FUN_Num2Piece,##)),-,space(0)),space(1),space(0)))))]
&FUN_MOVE.VALID-K Chess Board=[not(not(member(extract(v(PATH_[u(FUN_Coord2Num,%1)]),10,1,|),u(FUN_Coord2Num,%2))))]
&FUN_MOVE.VALID-Q Chess Board=[and(member(setr(1,extract(v(PATH_[u(FUN_Coord2Num,%1)]),1,8,|)),setr(2,u(FUN_Coord2Num,%2))),not(words(edit(edit(iter(extract(grab(%q1,*%q2*,|),1,dec(member(grab(%q1,*%q2*,|),%q2))),u(FUN_Num2Piece,##)),-,space(0)),space(1),space(0)))))]
&FUN_STYLE Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),extract(v(DATA_PLAYER.White),6,1),ifelse(member(v(DATA_PLAYER.Black),%0),extract(v(DATA_PLAYER.Black),6,1),ifelse(member(v(DATA_WATCHING.Players),%0),extract(v(DATA_WATCHING.Style),member(v(DATA_WATCHING.Players),%0),1),1)))]
&FUN_CHECK4MATE Chess Board=[setq(9,squish(trim(u(FUN_Check4Check.Nums,%0,v(DATA_BOARD)))))][not(member(u(FUN_KING.Mate,extract(v(DATA_BOARD.Numbers),pos(extract(K k,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),%1),1),extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),%1,last(first(%q9),_),extract(Black White,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),first(first(%q9),_),words(%q9)),0))]
&FUN_PIECE.BLOCK Chess Board=[member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),1,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),3,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),5,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),7,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),2,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),4,1,|),mid(%2,dec(member(v(dATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),6,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,match(Black White,%1*),1,|),first(edit(iter(extract(v(PATH_%0),8,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(iter(extract(v(PATH_%0),9,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),extract(N n,match(Black White,%1*),1))][or(member(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-10 10,match(Black White,%1*),1)))),1),extract(P p,match(Black White,%1*),1)),ifelse(eq(mid(%0,0,1),extract(4 5,match(Black White,%1*),1)),member(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-20 20,match(Black White,%1*),1)))),1),extract(P p,match(Black White,%1*),1)),0))]
&FUN_KING.MATE Chess Board=[setq(8,u(FUN_CREPLACE,%2,-,member(v(DATA_BOARD.Numbers),%0),1))][iter(extract(v(PATH_%0),10,1,|),ifelse(member(extract(N B R Q P | n b r q p,match(White Black,%1),1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),1,not(not(u(FUN_KING.Check,##,%1,%q8,match(Black White,%1*))))))] [ifelse(gt(%6,1),1,not(u(FUN_KING.Check,%3,%4,%2,match(Black White,%4*))))] [ifelse(or(member(p P n N,%5),gt(%6,1)),1,iter(extract(grab(v(PATH_%0),*%3*,|),1,dec(member(grab(v(PATH_%0),*%3*,|),%3))),not(u(FUN_Piece.Block,##,%4,%2))))]
&FUN_CASTLE.SPACES Chess Board=[mid(v(DATA_BOARD),add(ifelse(match(Kingside,%1*),4,0),ifelse(match(Black,%0*),1,57)),ifelse(match(Kingside,%1*),2,3))]
&FUN_PLR.CONNECTED Chess Board=[not(eq(idle(%0),-1))]
&FUN_CSORT.MUSH Chess Board=[edit(sort(edit(%0,space(0),space(1))),space(1),space(0))]
&FUN_CSORT.MUX Chess Board=[edit(sort(foreach(fun_separate.string,%0)),space(1),space(1))]
&FUN_SEPARATE.STRING Chess Board=[cat(%0,space(0))]
&FUN_CASTLE.VALID1 Chess Board=[and(and(extract(setr(2,v(DATA_PLAYER.[ifelse(member(v(DATA_PLAYER.White),%0),White,Black)])),8,1),extract(%q2,ifelse(match(%1,Kingside),9,10),1)),match(R,u(FUN_Coord2Piece,extract(h1 a1 h8 a8,match(WhiteKingside WhiteQueenside BlackKingside BlackQueenside,[ifelse(member(v(DATA_PLAYER.White),%0),White,Black)]%1),1))))]
&FUN_CASTLE.VALID2 Chess Board=[member(u(FUN_castle.spaces,extract(White Black,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1),%1),ifelse(match(%1,King*),--,ifelse(match(%1,Queen*),---,0)))]
&FUN_CASTLE.VALID3 Chess Board=1
&FUN_PLR.AUTH Chess Board=[match(type(%0),PLAYER)]
&FUN_PATH Chess Board=[ifelse(&vert&,do-vert,ifelse(&horiz&,do-horiz,ifelse(&diag&,do-diag,#-1 INVALID PATH)))]
&FUN_FLIP Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),extract(v(DATA_PLAYER.White),3,1),ifelse(member(v(DATA_PLAYER.Black),%0),extract(v(DATA_PLAYER.Black),3,1),ifelse(member(v(DATA_WATCHING.Players),%0),extract(v(DATA_WATCHING.Flip),member(v(DATA_WATCHING.Players),%0),1),0)))]
&FUN_PLR.BANNED Chess Board=[member(v(DATA_BANNED),%0)]
&FUN_FOOTER Chess Board=[ifelse(member(v(DATA_PLAYER.White),%0),extract(v(DATA_PLAYER.White),4,1),ifelse(member(v(DATA_PLAYER.Black),%0),extract(v(DATA_PLAYER.Black),4,1),ifelse(member(v(DATA_WATCHING.Players),%0),extract(v(DATA_WATCHING.Footer),member(v(DATA_WATCHING.Players),%0),1),1)))]
&FUN_CREPLACE2 Chess Board=[ifelse(%2,[mid(%0,0,sub(%2,1))]%1[mid(%0,sub(add(%2,ifelse(words(%3),%3,1)),1),sub(strlen(%0),sub(add(%2,ifelse(words(%3),%3,1)),1)))],%0)]
&FUN_CREPLACE Chess Board=[edit(replace(foreach(FUN_SEPARATE,%0),%2,%1),%b,)]
&FUN_SEPARATE Chess Board=%0%b
&FUN_PLR.VALID Chess Board=[or(member(v(DATA_PLAYER.White),%0),member(v(DATA_PLAYER.Black),%0))]
&FUN_PLR.TURN Chess Board=[eq(v(DATA_PLAYER.Turn),dec(member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0)))]
&FUN_COORDS.VALID Chess Board=[and(and(eq(strlen(%0),2),pos(mid(%0,0,1),abcdefgh)),pos(mid(%0,1,1),12345678))]
&FUN_PIECE.VALID Chess Board=[not(not(pos(%1,extract(KQRNBP kqrnbp,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0),1))))]
&FUN_MOVE.VALID Chess Board=[and(or(member(setr(4,u(FUN_Coord2Piece,lcstr(%2))),-),member(ifelse(member(v(DATA_PLAYER.White),%0),q n b r p,Q N B R P),%q4)),u(FUN_MOVE.Valid-[u(FUN_Coord2Piece,lcstr(%1))],%0,%1,%2))]
&FUN_COORD2PIECE Chess Board=[mid(v(DATA_BOARD),dec(match(v(DATA_BOARD.Coords),%0)),1)]
&FUN_PIECE2NAME Chess Board=[extract(King Queen Knight Bishop Rook Pawn,match(K Q N B R P,%0),1)]
&FUN_CONVSECS Chess Board=[ifelse(lt(setr(6,trunc(div(%0,3600))),10),0%q6,%q6)]:[ifelse(lt(setr(7,trunc(div(sub(%0,mul(%q6,3600)),60))),10),0%q7,%q7)]:[ifelse(lt(setr(8,trunc(sub(%0,add(mul(%q6,3600),mul(%q7,60))))),10),0%q8,%q8)]
&FUN_TIME.EXPIRED Chess Board=[ifelse(lte(ifelse(eq(v(DATA_PLAYER.Turn),dec(member(White Black,%0))),sub(extract(v(DATA_PLAYER.%0),2,1),sub(secs(),v(DATA_TIMER.Start))),extract(v(DATA_PLAYER.%0),2,1)),0),1,0)]
&FUN_NORTH Chess Board=[ifelse(gte(%0,80),-,iter(lnum(sub(8,mid(%0,0,1))),add(%0,mul(#@,10))))]
&FUN_SOUTH Chess Board=[ifelse(lte(%0,19),-,iter(lnum(sub(mid(%0,0,1),1)),sub(%0,mul(#@,10))))]
&FUN_EAST Chess Board=[ifelse(eq(mid(%0,1,1),8),-,iter(lnum(sub(8,mid(%0,1,1))),add(%0,#@)))]
&FUN_WEST Chess Board=[ifelse(eq(mid(%0,1,1),1),-,iter(lnum(sub(mid(%0,1,1),1)),sub(%0,#@)))]
&FUN_NORTHEAST Chess Board=[ifelse(or(gte(%0,80),eq(mid(%0,1,1),8)),-,iter(lnum(first(sort([sub(8,mid(%0,0,1))] [sub(8,mid(%0,1,1))]))),add(%0,mul(#@,11))))]
&FUN_SOUTHEAST Chess Board=[ifelse(or(lte(%0,19),eq(mid(%0,1,1),8)),-,iter(lnum(first(sort([sub(mid(%0,0,1),1)] [sub(8,mid(%0,1,1))]))),sub(%0,mul(#@,9))))]
&FUN_NORTHWEST Chess Board=[ifelse(or(gte(%0,80),eq(mid(%0,1,1),1)),-,iter(lnum(first(sort([sub(8,mid(%0,0,1))] [sub(mid(%0,1,1),1)]))),add(%0,mul(#@,9))))]
&FUN_SOUTHWEST Chess Board=[ifelse(or(lte(%0,19),eq(mid(%0,1,1),1)),-,iter(lnum(first(sort([sub(mid(%0,1,1),1)] [sub(mid(%0,0,1),1)]))),sub(%0,mul(11,#@))))]
&FUN_SCATTER Chess Board=[squish(trim(iter([add(%0,-21)] [add(%0,-12)] [add(%0,8)] [add(%0,19)] [add(%0,21)] [add(%0,12)] [add(%0,-8)] [add(%0,-19)],ifelse(or(or(lt(##,11),gt(##,88)),or(eq(mid(##,1,1),0),eq(mid(##,1,1),9))),space(0),##))))]
&FUN_KING.CHECK Chess Board=[member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),1,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),3,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),5,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(R Q | r q,%3,1,|),first(edit(iter(extract(v(PATH_%0),7,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),2,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),4,1,|),mid(%2,dec(member(v(dATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),6,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(extract(B Q | b q,%3,1,|),first(edit(iter(extract(v(PATH_%0),8,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),-,space(0))))][member(iter(extract(v(PATH_%0),9,1,|),mid(%2,dec(member(v(DATA_BOARD.Numbers),##)),1)),extract(N n,%3,1))][member(cat(mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-9 9,%3,1)))),1),mid(%2,dec(member(v(DATA_BOARD.Numbers),add(%0,extract(-11 11,%3,1)))),1)),extract(P p,%3,1))]
&FUN_CHECK4CHECK Chess Board=[u(FUN_King.Check,extract(v(DATA_BOARD.Numbers),pos(extract(K k,setr(8,member([first(v(DATA_PLAYER.White))] [first(v(DATA_PLAYER.Black))],%0)),1),%1),1),extract(White Black,%q8,1),%1,match(Black White,[extract(White Black,%q8,1)]*))]
think [ansi(hm,INSTALL:)] Downloading Chess Paths...
&PATH_82 Chess Board=- | - | 83 84 85 86 87 88 | 73 64 55 46 37 28 | 72 62 52 42 32 22 12 | 71 | 81 | - | 61 74 63 | 83 73 72 71 81
&PATH_81 Chess Board=- | - | 82 83 84 85 86 87 88 | 72 63 54 45 36 27 18 | 71 61 51 41 31 21 11 | - | - | - | 73 62 | 82 72 71
&PATH_83 Chess Board=- | - | 84 85 86 87 88 | 74 65 56 47 38 | 73 63 53 43 33 23 13 | 72 61 | 82 81 | - | 62 71 75 64 | 84 74 73 72 82
&PATH_84 Chess Board=- | - | 85 86 87 88 | 75 66 57 48 | 74 64 54 44 34 24 14 | 73 62 51 | 83 82 81 | - | 63 72 76 65 | 85 75 74 73 83
&PATH_85 Chess Board=- | - | 86 87 88 | 76 67 58 | 75 65 55 45 35 25 15 | 74 63 52 41 | 84 83 82 81 | - | 64 73 77 66 | 86 76 75 74 84
&PATH_86 Chess Board=- | - | 87 88 | 77 68 | 76 66 56 46 36 26 16 | 75 64 53 42 31 | 85 84 83 82 81 | - | 65 74 78 67 | 87 77 76 75 85
&PATH_87 Chess Board=- | - | 88 | 78 | 77 67 57 47 37 27 17 | 76 65 54 43 32 21 | 86 85 84 83 82 81 | - | 66 75 68 | 88 78 77 76 86
&PATH_88 Chess Board=- | - | - | - | 78 68 58 48 38 28 18 | 77 66 55 44 33 22 11 | 87 86 85 84 83 82 81 | - | 67 76 | 78 77 87
&PATH_71 Chess Board=81 | 82 | 72 73 74 75 76 77 78 | 62 53 44 35 26 17 | 61 51 41 31 21 11 | - | - | - | 83 63 52 | 81 82 72 62 61 41
&PATH_72 Chess Board=82 | 83 | 73 74 75 76 77 78 | 63 54 45 36 27 18 | 62 52 42 32 22 12 | 61 | 71 | 81 | 51 84 64 53 | 82 83 73 63 62 61 71 81
&PATH_73 Chess Board=83 | 84 | 74 75 76 77 78 | 64 55 46 37 28 | 63 53 43 33 23 13 | 62 51 | 72 71 | 82 | 52 61 81 85 65 54 | 83 84 74 64 63 62 72 82
&PATH_74 Chess Board=84 | 85 | 75 76 77 78 | 65 56 47 38 | 64 54 44 34 24 14 | 63 52 41 | 73 72 71 | 83 | 53 62 82 86 66 55 | 84 85 75 65 64 63 73 83
&PATH_75 Chess Board=85 | 86 | 76 77 78 | 66 57 48 | 65 55 45 35 25 15 | 64 53 42 31 | 74 73 72 71 | 84 | 54 63 83 87 67 56 | 85 86 76 66 65 64 74 84
&PATH_76 Chess Board=86 | 87 | 77 78 | 67 58 | 66 56 46 36 26 16 | 65 54 43 32 21 | 75 74 73 72 71 | 85 | 55 64 84 88 68 57 | 86 87 77 67 66 65 75 85
&PATH_77 Chess Board=87 | 88 | 78 | 68 | 67 57 47 37 27 17 | 66 55 44 33 22 11 | 76 75 74 73 72 71 | 86 | 56 65 85 58 | 87 88 78 68 67 66 76 86
&PATH_78 Chess Board=88 | - | - | - | 68 58 48 38 28 18 | 67 56 45 34 23 12 | 77 76 75 74 73 72 71 | 87 | 57 66 86 | 88 68 67 77 87
&PATH_61 Chess Board=71 81 | 72 83 | 62 63 64 65 66 67 68 | 52 43 34 25 16 | 51 41 31 21 11 | - | - | - | 82 73 53 42 | 71 72 62 52 51
&PATH_62 Chess Board=72 82 | 73 84 | 63 64 65 66 67 68 | 53 44 35 26 17 | 52 42 32 22 12 | 51 | 61 | 71 | 41 81 83 74 54 43 | 72 73 63 53 52 51 61 71
&PATH_63 Chess Board=73 83 | 74 85 | 64 65 66 67 68 | 54 45 36 27 18 | 53 43 33 23 13 | 52 41 | 62 61 | 72 81 | 42 51 71 82 84 75 55 44 | 73 74 64 54 53 52 62 72
&PATH_64 Chess Board=74 84 | 75 86 | 65 66 67 68 | 55 46 37 28 | 54 44 34 24 14 | 53 42 31 | 63 62 61 | 73 82 | 43 52 72 83 85 76 56 45 | 74 75 65 55 54 53 63 73
&PATH_65 Chess Board=75 85 | 76 87 | 66 67 68 | 56 47 38 | 55 45 35 25 15 | 54 43 32 21 | 64 63 62 61 | 74 83 | 44 53 73 84 86 77 57 46 | 75 76 66 56 55 54 64 74
&PATH_66 Chess Board=76 86 | 77 88 | 67 68 | 57 48 | 56 46 36 26 16 | 55 44 33 22 11 | 65 64 63 62 61 | 75 84 | 45 54 74 85 87 78 58 47 | 76 67 57 56 55 65 75
&PATH_67 Chess Board=77 87 | 78 | 68 | 58 | 57 47 37 27 17 | 56 45 34 23 12 | 66 65 64 63 62 61 | 76 85 | 46 55 75 86 88 48 | 77 78 68 58 57 56 66 76
&PATH_68 Chess Board=78 88 | - | - | - | 58 48 38 28 18 | 57 46 35 24 13 | 67 66 65 64 63 62 61 | 77 86 | 47 56 76 87 | 78 58 57 67 77
&PATH_51 Chess Board=61 71 81 | 62 73 84 | 52 53 54 55 56 57 58 | 42 33 24 15 | 41 31 21 11 | - | - | - | 72 63 43 32 | 61 62 52 42 41
&PATH_52 Chess Board=62 72 82 | 63 74 85 | 53 54 55 56 57 58 | 43 34 25 16 | 42 32 22 12 | 41 | 51 | 61 | 31 71 73 64 44 33 | 62 63 53 43 42 41 51 61
&PATH_53 Chess Board=63 73 83 | 64 75 86 | 54 55 56 57 58 | 44 35 26 17 | 43 33 23 13 | 42 31 | 52 51 | 62 71 | 32 41 61 72 74 65 45 34 | 63 64 54 44 43 42 52 62
&PATH_54 Chess Board=64 74 84 | 65 76 87 | 55 56 57 58 | 45 36 27 18 | 44 34 24 14 | 43 32 21 | 53 52 51 | 63 72 81 | 33 42 62 73 75 66 46 35 | 64 65 55 45 44 43 53 63
&PATH_55 Chess Board=65 75 85 | 66 77 88 | 56 57 58 | 46 37 28 | 45 35 25 15 | 44 33 22 11 | 54 53 52 51 | 64 73 82 | 34 43 63 74 76 67 47 36 | 65 66 56 46 45 44 54 64
&PATH_56 Chess Board=66 76 86 | 67 78 | 57 58 | 47 38 | 46 36 26 16 | 45 34 23 12 | 55 54 53 52 51 | 65 74 83 | 35 44 64 75 77 68 48 37 | 66 67 57 47 46 45 55 65
&PATH_57 Chess Board=67 77 87 | 68 | 58 | 48 | 47 37 27 17 | 46 35 24 13 | 56 55 54 53 52 51 | 66 75 84 | 36 45 65 76 78 38 | 67 68 58 48 47 46 56 66
&PATH_58 Chess Board=68 78 88 | - | - | - | 48 38 28 18 | 47 36 25 14 | 57 56 55 54 53 52 51 | 67 76 85 | 37 46 66 77 | 68 48 47 57 67
&PATH_41 Chess Board=51 61 71 81 | 52 63 74 85 | 42 43 44 45 46 47 48 | 32 23 14 | 31 21 11 | - | - | - | 62 53 33 22 | 51 52 42 32 31
&PATH_42 Chess Board=52 62 72 82 | 53 64 75 86 | 43 44 45 46 47 48 | 33 24 15 | 32 22 12 | 31 | 41 | 51 | 21 61 63 54 34 23 | 62 53 43 33 32 31 41 51
&PATH_43 Chess Board=53 63 73 83 | 54 65 76 87 | 44 45 46 47 48 | 34 25 16 | 33 23 13 | 32 21 | 42 41 | 52 61 | 22 31 51 62 64 55 35 24 | 53 54 44 34 33 32 42 52
&PATH_44 Chess Board=54 64 74 84 | 55 66 77 88 | 45 46 47 48 | 35 26 17 | 34 24 14 | 33 22 11 | 43 42 41 | 53 62 71 | 23 32 52 63 65 56 36 25 | 54 55 45 35 34 33 43 53
&PATH_45 Chess Board=55 65 75 85 | 56 67 78 | 46 47 48 | 36 27 18 | 35 25 15 | 34 23 12 | 44 43 42 41 | 54 63 72 81 | 24 33 53 64 66 57 37 26 | 55 56 46 35 34 44 54 36
&PATH_46 Chess Board=56 66 76 86 | 57 68 | 47 48 | 37 28 | 36 26 16 | 35 24 13 | 45 44 43 42 41 | 55 64 73 82 | 25 34 54 65 67 58 38 27 | 56 57 47 37 36 35 45 55
&PATH_47 Chess Board=57 67 77 87 | 58 | 48 | 38 | 37 27 17 | 36 25 14 | 46 45 44 43 42 41 | 56 65 74 83 | 26 35 55 66 68 28 | 57 58 48 38 37 36 46 56
&PATH_48 Chess Board=58 68 78 88 | - | - | - | 38 28 18 | 37 26 15 | 47 46 45 44 43 42 41 | 57 66 75 84 | 27 36 56 67 | 58 38 37 47 43 57
&PATH_31 Chess Board=41 51 61 71 81 | 42 53 64 75 86 | 32 33 34 35 36 37 38 | 22 13 | 21 11 | - | - | - | 52 43 23 12 | 41 42 32 22 21
&PATH_32 Chess Board=42 52 62 72 82 | 43 54 65 76 87 | 33 34 35 36 37 38 | 23 14 | 22 12 | 21 | 31 | 41 | 11 51 53 44 24 13 | 42 43 33 23 22 21 31 41
&PATH_33 Chess Board=43 53 63 73 83 | 44 55 66 77 88 | 34 35 36 37 38 | 24 15 | 23 13 | 22 11 | 32 31 | 42 51 | 12 21 41 52 54 45 25 14 | 43 44 34 24 23 22 32 42
&PATH_34 Chess Board=44 54 64 74 84 | 45 56 67 78 | 35 36 37 38 | 25 16 | 24 14 | 23 12 | 33 32 31 | 43 52 61 | 13 22 42 53 55 46 26 15 | 44 45 35 25 24 23 33 43
&PATH_35 Chess Board=45 55 65 75 85 | 46 57 68 | 36 37 38 | 26 17 | 25 15 | 24 13 | 34 33 32 31 | 44 53 62 71 | 14 23 43 54 56 47 27 16 | 45 46 36 26 25 24 34 44
&PATH_36 Chess Board=46 56 66 76 86 | 47 58 | 37 38 | 27 18 | 26 16 | 25 14 | 35 34 33 32 31 | 45 54 63 72 81 | 15 24 44 55 57 48 28 17 | 46 47 37 27 26 25 35 45
&PATH_37 Chess Board=47 57 67 77 87 | 48 | 38 | 28 | 27 17 | 26 15 | 36 35 34 33 32 31 | 46 55 64 73 82 | 16 25 45 56 58 18 | 47 48 38 28 27 26 36 46
&PATH_38 Chess Board=48 58 68 78 88 | - | - | - | 28 18 | 27 16 | 37 36 35 34 33 32 31 | 47 56 65 74 83 | 17 26 46 57 | 48 28 27 37 47
&PATH_21 Chess Board=31 41 51 61 71 81 | 32 43 54 65 76 87 | 22 23 24 25 26 27 28 | 12 | 11 | - | - | - | 42 33 13 | 41 32 22 12 11
&PATH_22 Chess Board=32 42 52 62 72 82 | 33 44 55 66 77 88 | 23 24 25 26 27 28 | 13 | 12 | 11 | 21 | 31 | 41 43 34 14 | 32 33 23 13 12 11 21 31
&PATH_23 Chess Board=33 43 53 63 73 83 | 34 45 56 67 78 | 24 25 26 27 28 | 14 | 13 | 12 | 22 21 | 32 41 | 11 31 42 44 35 15 | 33 34 24 14 13 12 22 32
&PATH_24 Chess Board=34 44 54 64 74 84 | 35 46 57 68 | 25 26 27 28 | 15 | 14 | 13 | 23 22 21 | 33 42 51 | 12 32 43 45 36 16 | 34 35 25 15 14 13 23 33 12
&PATH_25 Chess Board=35 45 55 65 75 85 | 36 47 58 | 26 27 28 | 16 | 15 | 14 | 24 23 22 21 | 34 43 52 61 | 13 33 44 46 37 17 | 35 36 26 16 15 14 24 34
&PATH_26 Chess Board=36 46 56 66 76 86 | 37 48 | 27 28 | 17 | 16 | 15 | 25 24 23 22 21 | 35 44 53 62 71 | 14 34 45 47 38 18 | 36 37 27 17 16 15 25 35
&PATH_27 Chess Board=37 47 57 67 77 87 | 38 | 28 | 18 | 17 | 16 | 26 25 24 23 22 21 | 36 45 54 63 72 81 | 15 35 46 48 | 37 38 28 18 17 16 26 36
&PATH_28 Chess Board=38 48 58 68 78 88 | - | - | - | 18 | 17 | 27 26 25 24 23 22 21 | 37 46 55 64 73 82 | 16 36 47 | 38 18 17 27 37
&PATH_11 Chess Board=21 31 41 51 61 71 81 | 22 33 44 55 66 77 88 | 12 13 14 15 16 17 18 | - | - | - | - | - | 32 23 | 21 22 12
&PATH_12 Chess Board=22 32 42 52 62 72 82 | 23 34 45 56 67 78 | 13 14 15 16 17 18 | - | - | - | 11 | 21 | 31 33 24 | 22 23 13 11 21
&PATH_13 Chess Board=23 33 43 53 63 73 83 | 24 35 46 57 68 | 14 15 16 17 18 | - | - | - | 12 11 | 22 31 | 21 32 34 25 | 23 24 14 12 22
&PATH_14 Chess Board=24 34 44 54 64 74 84 | 25 36 47 58 | 15 16 17 18 | - | - | - | 13 12 11 | 23 32 41 | 22 33 35 26 | 24 25 15 13 23
&PATH_15 Chess Board=25 35 45 55 65 75 85 | 26 37 48 | 16 17 18 | - | - | - | 14 13 12 11 | 24 33 42 51 | 23 34 36 27 | 25 26 16 14 24
&PATH_16 Chess Board=26 36 46 56 66 76 86 | 27 38 | 17 18 | - | - | - | 15 14 13 12 11 | 25 34 43 52 61 | 24 35 37 28 | 26 27 17 15 25
&PATH_17 Chess Board=27 37 47 57 67 77 87 | 28 | 18 | - | - | - | 16 15 14 13 12 11 | 26 35 44 53 62 71 | 25 36 38 | 27 28 18 16 26
&PATH_18 Chess Board=28 38 48 58 68 78 88 | - | - | - | - | - | 17 16 15 14 13 12 11 | 27 36 45 54 63 72 81 | 26 37 | 28 17 27
think [ansi(hm,INSTALL:)] Downloading Chess Help Files...
&HELP_INTRO Chess Board=This chess program is very CPU-intensive, and is not meant to be used for fast-paced speed (or blitz) matches. It is recommended the time-controls be set to at least 10 minutes each and that you setup a board at home to move along with the program.%r%rThe colors of the pieces and squares can be fairly easily changed by editting the DATA_COLOR.* attributes. You may have to contact an Administrator if you do not have permission to change these.%r%rThis code will also determine CHECK and CHECKMATE -- however, it may not properly diagnose ALL instances of checkmate. In such an event, the player who was checkmated should chess/resign.%r%rDistribution of this code is permitted as long as you keep the COPYRIGHT information on it.
&HELP_GAMES Chess Board=Lists all the games currently in the database, as well as its players and which color they were using.
&HELP_LOAD Chess Board=Loads a game from the database. You must use the <#> as indicated in 'chess/games'.
&HELP_SAVE Chess Board=This command saves the current game into a database. Please try to finish your saved games as soon as possible, so as not to bloat the DB.
&HELP_MOVES Chess Board=This will list all the moves of the current game. A '-' indicates a piece was moved from coord1 to coord2. An 'x' means a piece was moved from coord1 to coord2, and captured a piece in the processes. A '+' indicates CHECK was called on the move, and a '++' indicates CHECKMATE. 'O-O' means the player castled Kingside, while 'O-O-O' means the player castled Queenside. Finally, 'en-pas' is short for en-passant.
&HELP_PROMOTION Chess Board=When a pawn reaches the last rank, it is promoted to a piece of your choice. By default it is changed to a Queen \(naturally)\. However, you can change this by using this command. You can specify a Queen, Knight, Rook, or Bishop.
&HELP_RESIGN Chess Board=When you are in a losing position, you should use this command to end the game.
&HELP_FLAG Chess Board=If you use this command when your opponent runs out of time, it will cause him/her to automatically FORFEIT the game.
&HELP_DECLINE Chess Board=Declines a takeback request of your opponent.
&HELP_ACCEPT Chess Board=Accepts a takeback request of your opponent.
&HELP_TAKEBACK Chess Board=Requests a takeback of one move. Your opponent may then 'chess/accept' or 'chess/decline'. If your opponent moves without accepting or declining, it will AUTOMATICALLY decline the request.
&HELP_EN-PASSANT Chess Board=This command performs the 'en-passant' maneuver using the pawn on the specified coordinate.
&HELP_CASTLE Chess Board=This command performs the 'castle' maneuver to whichever side you specify.
&HELP_MOVE Chess Board=To move a piece on the board, use this command in the following format: 'chess/move <coord1>-<coord2>'.%r%r[space(5)]Example: chess/move e2-e4%r%rYou should use this command to capture pieces as well. You do NOT have to use a different command for that. If the move you are trying to make is not valid for some reason, the code should return an error.
&HELP_FOOTER Chess Board=The 'footer' is the bottom part of the chess board which contains Player, Time, and Captured-Pieces information. If you do not want to see this every time you look at the board, you can toggle it off using this command. You can view the footer information alone by using the 'chess/clock' command.
&HELP_FLIP Chess Board=Flips the board around to view it from the opposing piece's point of view.
&HELP_STYLE Chess Board=Changes the style of the board when you look at it. You can choose 0 \(small\), 1 \(Medium\), or 2 \(LARGE\). You may need to increaes your window's height to use the large style.
&HELP_WATCH Chess Board=Allows you to watch all moves of any on-going chess match. This also permits you to use the 'chess/flip', 'chess/style', and 'chess/footer' commands. If you do not use this command, you will not see ANY of the game's chess moves.
&HELP_START Chess Board=Starts a new game from whatever position the board is currently in. To start a game from scratch use the 'chess/reset' command first.
&HELP_TIME Chess Board=Using this command, you can specify how long you want each person to have to complete all of his/her moves. You must indicate the time in the format ?h ?m ?s.%r%r[space(5)]Example: 1h 30m 0s \(would give each person 1 hr, 30 mins, and 0 secs\)
&HELP_RESET Chess Board=Moves all the pieces back onto the board and to their original starting position. The players and watchers are NOT reset with this command.
&HELP_CHOOSE Chess Board=Determines which pieces you will play with. Valid choices are 'White' and 'Black', with white always moving first.
&HELP_COMMANDS Chess Board=Here's a list of commands and a short description for each.%r%r[ansi(hm,ljust(chess/choose <color>,20))] - Sit behind WHITE or BLACK pieces to play a game.%r[ansi(hm,ljust(chess/reset,20))] - Resets the board to normal starting position.%r[ansi(hm,ljust(chess/time <time>,20))] - Sets time controls. Specify in "?h ?m ?s" format.%r[ansi(hm,ljust(chess/start,20))] - Begins a new game.%r[ansi(hm,ljust(chess/watch,20))] - Allows you to see each move on the chess board.%r[ansi(hm,ljust(chess/style <#>,20))] - Changes the style you view the board with.%r[space(23)]\(0 = Small .. 1 = Medium <default> .. 2 = Large\)%r[ansi(hm,ljust(chess/flip,20))] - Flips the view of the board around.%r[ansi(hm,ljust(chess/footer,20))] - Toggles the footer information on and off.%r%r[ansi(hm,ljust(chess/move <coords>,20))] - Moves piece from coord1 to coord2 \(i.e. e2-e4\)%r[ansi(hm,ljust(chess/castle <side>,20))] - Castles kingside or queenside.%r[ansi(hm,ljust(chess/en-pas <coord>,20))] - Performs the en-passant move with the pawn on <coord>.%r[ansi(hm,ljust(chess/takeback,20))] - Request a takeback of one move.%r[ansi(hm,ljust(chess/accept,20))] - Accepts a takeback request.%r[ansi(hm,ljust(chess/decline,20))] - Declines a takeback request.%r[ansi(hm,ljust(chess/flag,20))] - Causes your opponent to forfeit if \(s\)he is out of time.%r[ansi(hm,ljust(chess/resign,20))] - Forfeit the game to your opponent.%r[ansi(hm,ljust(chess/promo <piece>,20))] - Changes the piece your pawns are promoted to.%r[ansi(hm,ljust(chess/moves,20))] - Lists all the current moves of the game.%r%r[ansi(hm,ljust(chess/save,20))] - Saves the current game into the database.%r[ansi(hm,ljust(chess/load <#>,20))] - Loads the specified game as listed in chess/games.%r[ansi(hm,ljust(chess/games,20))] - Lists all stored games.%r%r* Type 'chess/help <command>' for more information.
think [ansi(hm,INSTALL:)] Downloading Chess Descriptions...
@DESCRIBE Chess Board=Type '[ansi(hc,chess/help)]' for more information.
@ADESCRIBE Chess Board=@tr me/DRAW_BOARD.Style[u(FUN_STYLE,%#)]=%#,[v(DATA_Board)]
@IDESCRIBE Chess Board=CMD_* TRI_* FLAG_* DRAW* DO_* ERR_* TXT_* LISTEN_* DATA_* FUN_* PATH_* HELP_* DESC IDESC
think [ansi(hm,INSTALL:)] Attempting to set pointers...
@fo me=&DATA_DB Chess Board=[num(Chess Save Database)]
think [ansi(hm,INSTALL:)] [ansi(hr,Download is complete! Now you must do the following:)]
think [ansi(hm,INSTALL:)] To install the Chess System, make sure the DATA_DB attribute is set to the
think [ansi(hm,INSTALL:)] DB# of the object that will be storing saved games. To get a list of
think [ansi(hm,INSTALL:)] commands, type 'chess/help'.
think [ansi(hm,INSTALL:)]
think [ansi(hm,INSTALL:)] There are TWO more things to note. First, this code has never been
think [ansi(hm,INSTALL:)] tested as a 'parent'. Therefore, it is recommended you do not @parent
think [ansi(hm,INSTALL:)] objects to this, unless you know what you are doing and feel you can
think [ansi(hm,INSTALL:)] debug any problems you may encounter.
think [ansi(hm,INSTALL:)]
think [ansi(hm,INSTALL:)] Secondly, the Copyright code should remain on the object AS IS -- it
think [ansi(hm,INSTALL:)] should not be modified. The only exception to this is IF you improve
think [ansi(hm,INSTALL:)] the code or add to it, you may ADD 'Modified By: <your name>' after
think [ansi(hm,INSTALL:)] the original text.
think [ansi(hm,INSTALL:)]
think [ansi(hm,INSTALL:)] If you have any problems with this code, e-mail:
think [ansi(hm,INSTALL:)] %b%b[ansi(hc,worldwar@bb6.betterbox.net)]
@set me=!quiet