chess-demon# Partida: O Demônio x ? (Gambito Dinamarquês)
# x = coluna (a=0 ... h=7), y = 8 - fileira (fileira 8 no topo)
let lances = 35
let p = t % (lances + 1) # p = 1..35: lances; p = 0: casas claras
if p == 1 { # 1.e4
if x == 4 and (y == 6 or y == 4) {
true
}
} else if p == 2 { # 1...e5
if x == 4 and (y == 1 or y == 3) {
true
}
} else if p == 3 { # 2.d4
if x == 3 and (y == 6 or y == 4) {
true
}
} else if p == 4 { # 2...exd4
if (x == 4 and y == 3) or (x == 3 and y == 4) {
true
}
} else if p == 5 { # 3.c3
if x == 2 and (y == 6 or y == 5) {
true
}
} else if p == 6 { # 3...dxc3
if (x == 3 and y == 4) or (x == 2 and y == 5) {
true
}
} else if p == 7 { # 4.Bc4
if (x == 5 and y == 7) or (x == 2 and y == 4) {
true
}
} else if p == 8 { # 4...cxb2
if (x == 2 and y == 5) or (x == 1 and y == 6) {
true
}
} else if p == 9 { # 5.Bxb2
if (x == 2 and y == 7) or (x == 1 and y == 6) {
true
}
} else if p == 10 { # 5...Bb4+
if (x == 5 and y == 0) or (x == 1 and y == 4) {
true
}
} else if p == 11 { # 6.Cc3
if (x == 1 and y == 7) or (x == 2 and y == 5) {
true
}
} else if p == 12 { # 6...Cf6
if (x == 6 and y == 0) or (x == 5 and y == 2) {
true
}
} else if p == 13 { # 7.Cge2
if (x == 6 and y == 7) or (x == 4 and y == 6) {
true
}
} else if p == 14 { # 7...Cxe4
if (x == 5 and y == 2) or (x == 4 and y == 4) {
true
}
} else if p == 15 { # 8.O-O
if y == 7 and x in 4..7 {
true
}
} else if p == 16 { # 8...Cxc3
if (x == 4 and y == 4) or (x == 2 and y == 5) {
true
}
} else if p == 17 { # 9.Cxc3
if (x == 4 and y == 6) or (x == 2 and y == 5) {
true
}
} else if p == 18 { # 9...Bxc3
if (x == 1 and y == 4) or (x == 2 and y == 5) {
true
}
} else if p == 19 { # 10.Bxc3
if (x == 1 and y == 6) or (x == 2 and y == 5) {
true
}
} else if p == 20 { # 10...d6
if x == 3 and (y == 1 or y == 2) {
true
}
} else if p == 21 { # 11.Te1+
if y == 7 and (x == 5 or x == 4) {
true
}
} else if p == 22 { # 11...Rd7
if (x == 4 and y == 0) or (x == 3 and y == 1) {
true
}
} else if p == 23 { # 12.Dg4+
if (x == 3 and y == 7) or (x == 6 and y == 4) {
true
}
} else if p == 24 { # 12...Rc6
if (x == 3 and y == 1) or (x == 2 and y == 2) {
true
}
} else if p == 25 { # 13.Bd5+
if (x == 2 and y == 4) or (x == 3 and y == 3) {
true
}
} else if p == 26 { # 13...Rxd5
if (x == 2 and y == 2) or (x == 3 and y == 3) {
true
}
} else if p == 27 { # 14.Te5+
if x == 4 and (y == 7 or y == 3) {
true
}
} else if p == 28 { # 14...dxe5
if (x == 3 and y == 2) or (x == 4 and y == 3) {
true
}
} else if p == 29 { # 15.Td1+
if y == 7 and (x == 0 or x == 3) {
true
}
} else if p == 30 { # 15...Rc5
if y == 3 and (x == 3 or x == 2) {
true
}
} else if p == 31 { # 16.Db4+
if y == 4 and (x == 6 or x == 1) {
true
}
} else if p == 32 { # 16...Rc6
if x == 2 and (y == 3 or y == 2) {
true
}
} else if p == 33 { # 17.Dc4+
if y == 4 and (x == 1 or x == 2) {
true
}
} else if p == 34 { # 17...Rb6
if y == 2 and (x == 2 or x == 1) {
true
}
} else if p == 35 { # 18.Tb1#
if y == 7 and (x == 3 or x == 1) {
true
}
} else if p == 0 { # fim da partida: casas claras, depois reinicia
if (x + y) % 2 == 0 {
true
}
}