Tin học Bộ quân cờ đẹp để lập trình

dangxuanchuon

Học sinh
Thành viên
31 Tháng bảy 2022
135
89
46
Phú Yên
[TẶNG BẠN] TRỌN BỘ Bí kíp học tốt 08 môn
Chắc suất Đại học top - Giữ chỗ ngay!!

ĐĂNG BÀI NGAY để cùng trao đổi với các thành viên siêu nhiệt tình & dễ thương trên diễn đàn.

Lúc đầu mình có cố gắng code ra game cờ vua bằng FPC nhưng lúc giữa tháng 7 thì lại bận, giờ rảnh nhưng hết hứng làm nên dự án cờ vua mình sẽ dừng vô thời hạn
Mình chia sẻ lại mẫu quân cờ mình đã code sẵn và phần lập trình của mình
Mình đã xong quân cờ và xác định chiếu nhưng lại không làm được phần tính toán các nước đi hợp lệ về sau.
Mình sẽ không code nữa, để lên lớp 10 học python lươn
Chia sẻ ở đây để ai muốn làm thì làm tiếp, mình không đánh bản quyền (Làm tiếp khuyến khích cre mình).
Code:
Mã:
//minh tao them cai thu vien nay de minh khoi phi thoi gian de di qua dong nay, giup nang cao nang suat lap trinh cho minh.
//neu muon, moi nguoi co the viet lai ma lenh cua cac quan co trong day
{yeu cau:
1/ 64 o vuong trong quan co co chieu dai 70 px, o o goc tren ben trai o vi tri (44,44) (o ten cung ben trai cua man hinh la (0,0)
2/ yeu cau thu vien nay phai cho ra 12 lenh cung cu phap sau:
procedure whitepawn (_tdc, _tdh:byte);
procedure blackpawn (_tdc, _tdh:byte);
procedure whiterook (_tdc, _tdh:byte);
procedure blackrook (_tdc, _tdh:byte);
procedure whiteknight (_tdc, _tdh:byte);
procedure blackknight (_tdc, _tdh:byte);
procedure whitebishop (_tdc, _tdh:byte);
procedure blackbishop (_tdc, _tdh:byte);
procedure whitequeen (_tdc, _tdh:byte);
procedure blackqueen (_tdc, _tdh:byte);
procedure whiteking (_tdc, _tdh:byte);
procedure blackking (_tdc, _tdh:byte);
vi tri dat:
trang:









}
unit thuvienquancovua;

interface

uses crt, graph;

//const

//type

//var

procedure pixelpiece (_occ, _och, _pxx, _pxy, _color: byte; lt:boolean);
procedure whitepawn (_tdc, _tdh:byte; wt:boolean);
procedure blackpawn (_tdc, _tdh:byte; wt:boolean);
procedure whiterook (_tdc, _tdh:byte; wt:boolean);
procedure blackrook (_tdc, _tdh:byte; wt:boolean);
procedure whiteknight (_tdc, _tdh:byte; wt:boolean);
procedure blackknight (_tdc, _tdh:byte; wt:boolean);
procedure whitebishop (_tdc, _tdh:byte; wt:boolean);
procedure blackbishop (_tdc, _tdh:byte; wt:boolean);
procedure whitequeen (_tdc, _tdh:byte; wt:boolean);
procedure blackqueen (_tdc, _tdh:byte; wt:boolean);
procedure whiteking (_tdc, _tdh:byte; wt:boolean);
procedure blackking (_tdc, _tdh:byte; wt:boolean);
//=================================
implementation
procedure pixelpiece (_occ, _och, _pxx, _pxy, _color: byte; lt:boolean);
var _tox, _toy: uint16;
        begin
        if lt then
                begin
                for _tox:= -26+70*_occ+5*_pxx to -22+70*_occ+5*_pxx do
                for _toy:= -26+70*(9-_och)+5*_pxy to -22+70*(9-_och)+5*_pxy do
                putpixel(_tox,_toy,_color);
                end
        else
                begin
                for _tox:= -26+70*(9-_occ)+5*_pxx to -22+70*(9-_occ)+5*_pxx do
                for _toy:= -26+70*_och+5*_pxy to -22+70*_och+5*_pxy do
                putpixel(_tox,_toy,_color);
                end
        end;
// tim kiem "hetquanco" roi chon "forward" de qua dong nay.
//=============================
procedure whitepawn (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, white, wt);pixelpiece(_tdc, _tdh, 7, 3, white, wt);pixelpiece(_tdc, _tdh, 8, 3, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, white, wt);pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);pixelpiece(_tdc, _tdh, 9, 9, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);pixelpiece(_tdc, _tdh, 10, 10, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackpawn (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, black, wt);pixelpiece(_tdc, _tdh, 7, 3, black, wt);pixelpiece(_tdc, _tdh, 8, 3, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, black, wt);pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);pixelpiece(_tdc, _tdh, 9, 9, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);pixelpiece(_tdc, _tdh, 10, 10, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whiterook (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 4, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);pixelpiece(_tdc, _tdh, 9, 2, white, wt);
        // . .\ \
        pixelpiece(_tdc, _tdh, 4, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 3, white, wt);pixelpiece(_tdc, _tdh, 8, 3, white, wt);pixelpiece(_tdc, _tdh, 9, 3, white, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);pixelpiece(_tdc, _tdh, 9, 4, white, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, white, wt);
        pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);
        pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);
        pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);
        pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);
        pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);pixelpiece(_tdc, _tdh, 9, 9, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);pixelpiece(_tdc, _tdh, 10, 10, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackrook (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 4, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);pixelpiece(_tdc, _tdh, 9, 2, black, wt);
        // . .\ \
        pixelpiece(_tdc, _tdh, 4, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 3, black, wt);pixelpiece(_tdc, _tdh, 8, 3, black, wt);pixelpiece(_tdc, _tdh, 9, 3, black, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);pixelpiece(_tdc, _tdh, 9, 4, black, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, black, wt);
        pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);
        pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);
        pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);
        pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);
        pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);pixelpiece(_tdc, _tdh, 9, 9, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);pixelpiece(_tdc, _tdh, 10, 10, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whiteknight(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc,_tdh,6,1,white, wt);pixelpiece(_tdc,_tdh,8,1,white, wt);
        //   \ \
        pixelpiece(_tdc,_tdh,6,2,white, wt);pixelpiece(_tdc,_tdh,7,2,7, wt);pixelpiece(_tdc,_tdh,8,2,white, wt);
        //   \.\
        pixelpiece(_tdc,_tdh,5,3,7, wt);pixelpiece(_tdc,_tdh,6,3,white, wt);pixelpiece(_tdc,_tdh,7,3,white, wt);pixelpiece(_tdc,_tdh,8,3,white, wt);pixelpiece(_tdc,_tdh,9,3,white, wt);
        //  .\\\\
        pixelpiece(_tdc,_tdh,4,4,7, wt);pixelpiece(_tdc,_tdh,5,4,white, wt);pixelpiece(_tdc,_tdh,6,4,white, wt);pixelpiece(_tdc,_tdh,7,4,white, wt);pixelpiece(_tdc,_tdh,8,4,white, wt);pixelpiece(_tdc,_tdh,9,4,white, wt);
        // .\\\\\
        pixelpiece(_tdc,_tdh,4,5,7, wt);pixelpiece(_tdc,_tdh,5,5,white, wt);pixelpiece(_tdc,_tdh,6,5,white, wt);pixelpiece(_tdc,_tdh,7,5,white, wt);pixelpiece(_tdc,_tdh,8,5,white, wt);pixelpiece(_tdc,_tdh,9,5,white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 6, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);
        //   .\\\
         pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);
        //  .\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);pixelpiece(_tdc, _tdh, 9, 9, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);pixelpiece(_tdc, _tdh, 10, 10, white, wt);
        //..\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\
        end;
procedure blackknight(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc,_tdh,6,1,black, wt);pixelpiece(_tdc,_tdh,8,1,black, wt);
        //   \ \
        pixelpiece(_tdc,_tdh,6,2,black, wt);pixelpiece(_tdc,_tdh,7,2,7, wt);pixelpiece(_tdc,_tdh,8,2,black, wt);
        //   \.\
        pixelpiece(_tdc,_tdh,5,3,7, wt);pixelpiece(_tdc,_tdh,6,3,black, wt);pixelpiece(_tdc,_tdh,7,3,black, wt);pixelpiece(_tdc,_tdh,8,3,black, wt);pixelpiece(_tdc,_tdh,9,3,black, wt);
        //  .\\\\
        pixelpiece(_tdc,_tdh,4,4,7, wt);pixelpiece(_tdc,_tdh,5,4,black, wt);pixelpiece(_tdc,_tdh,6,4,black, wt);pixelpiece(_tdc,_tdh,7,4,black, wt);pixelpiece(_tdc,_tdh,8,4,black, wt);pixelpiece(_tdc,_tdh,9,4,black, wt);
        // .\\\\\
        pixelpiece(_tdc,_tdh,4,5,7, wt);pixelpiece(_tdc,_tdh,5,5,black, wt);pixelpiece(_tdc,_tdh,6,5,black, wt);pixelpiece(_tdc,_tdh,7,5,black, wt);pixelpiece(_tdc,_tdh,8,5,black, wt);pixelpiece(_tdc,_tdh,9,5,black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 6, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);
        //   .\\\
         pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);
        //  .\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);pixelpiece(_tdc, _tdh, 9, 9, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);pixelpiece(_tdc, _tdh, 10, 10, black, wt);
        //..\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\
        end;
procedure whitebishop(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, white, wt);pixelpiece(_tdc, _tdh, 7, 3, white, wt);pixelpiece(_tdc, _tdh, 8, 3, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 4, white, wt);pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);
        //   \\\
        pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);pixelpiece(_tdc, _tdh, 9, 5, white, wt);
        // .  \\\
        pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);
        // .. \\\
        pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);
        pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackbishop(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, black, wt);pixelpiece(_tdc, _tdh, 7, 3, black, wt);pixelpiece(_tdc, _tdh, 8, 3, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 4, black, wt);pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);
        //   \\\
        pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);pixelpiece(_tdc, _tdh, 9, 5, black, wt);
        // .  \\\
        pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);
        // .. \\\
        pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);
        pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whitequeen(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 8, 2, white, wt);
        // .
        pixelpiece(_tdc, _tdh, 3, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 8, 3, white, wt);pixelpiece(_tdc, _tdh, 10, 3, white, wt);
        //. .  \ \
        pixelpiece(_tdc, _tdh, 3, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);pixelpiece(_tdc, _tdh, 10, 4, white, wt);
        //. ..\\ \
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, white, wt);
        pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);pixelpiece(_tdc, _tdh, 9, 5, white, wt);pixelpiece(_tdc, _tdh, 10, 5, white, wt);
        //...\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, white, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);
        pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);pixelpiece(_tdc, _tdh, 10, 6, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, white, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);
        pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);pixelpiece(_tdc, _tdh, 10, 7, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, white, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);
        pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);
        pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackqueen(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 8, 2, black, wt);
        // .
        pixelpiece(_tdc, _tdh, 3, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 8, 3, black, wt);pixelpiece(_tdc, _tdh, 10, 3, black, wt);
        //. .  \ \
        pixelpiece(_tdc, _tdh, 3, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);pixelpiece(_tdc, _tdh, 10, 4, black, wt);
        //. ..\\ \
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, black, wt);
        pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);pixelpiece(_tdc, _tdh, 9, 5, black, wt);pixelpiece(_tdc, _tdh, 10, 5, black, wt);
        //...\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, black, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);
        pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);pixelpiece(_tdc, _tdh, 10, 6, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, black, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);
        pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);pixelpiece(_tdc, _tdh, 10, 7, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, black, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);
        pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);
        pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whiteking(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 1, 7, wt);pixelpiece(_tdc, _tdh, 7, 1, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, white, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);pixelpiece(_tdc, _tdh, 8, 2, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 3, 7, wt);pixelpiece(_tdc, _tdh, 7, 3, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, white, wt);pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);pixelpiece(_tdc, _tdh, 9, 4, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, white, wt);pixelpiece(_tdc, _tdh, 6, 5, white, wt);
        pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);pixelpiece(_tdc, _tdh, 9, 5, white, wt);pixelpiece(_tdc, _tdh, 10, 5, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, white, wt);pixelpiece(_tdc, _tdh, 5, 6, white, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);
        pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);pixelpiece(_tdc, _tdh, 10, 6, white, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, white, wt);pixelpiece(_tdc, _tdh, 5, 7, white, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);
        pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);pixelpiece(_tdc, _tdh, 10, 7, white, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, white, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);
        pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackking(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 1, 7, wt);pixelpiece(_tdc, _tdh, 7, 1, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, black, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);pixelpiece(_tdc, _tdh, 8, 2, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 3, 7, wt);pixelpiece(_tdc, _tdh, 7, 3, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, black, wt);pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);pixelpiece(_tdc, _tdh, 9, 4, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, black, wt);pixelpiece(_tdc, _tdh, 6, 5, black, wt);
        pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);pixelpiece(_tdc, _tdh, 9, 5, black, wt);pixelpiece(_tdc, _tdh, 10, 5, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, black, wt);pixelpiece(_tdc, _tdh, 5, 6, black, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);
        pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);pixelpiece(_tdc, _tdh, 10, 6, black, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, black, wt);pixelpiece(_tdc, _tdh, 5, 7, black, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);
        pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);pixelpiece(_tdc, _tdh, 10, 7, black, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, black, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);
        pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
// tim kiem "hetquanco" roi chon "backward" de qua dong nay
// yeah lmao no rat dai
//==============================================

end.

Mã:
//10-6-2024
program covua;
uses crt, graph, winmouse, thuvienquancovua;
type oc = array [1..8] of array [1..8] of char;
//yeu cau ban phai tu them cai "thuvienquancovua" vao
var ott, otest: array [1..8] of array [1..8] of char;
ohople: array [1..8] of array [1..8] of array [1..8] of array [1..8] of boolean;
_d1,_d2: {smallint} {int16} smallint;
mx, my, state: longint;
a, b, cv, hv:byte;
c, ch:char;
luottrang: boolean;
procedure reset_banco;
        begin
        ott[1][8]:='r';ott[2][8]:='n';ott[3][8]:='b';ott[4][8]:='q';ott[5][8]:=' ';ott[6][8]:='b';ott[7][8]:='b';ott[8][8]:='r';
        ott[1][7]:='p';ott[2][7]:='p';ott[3][7]:='p';ott[4][7]:='p';ott[5][7]:='p';ott[6][7]:='p';ott[7][7]:='p';ott[8][7]:='p';
        ott[1][6]:=' ';ott[2][6]:=' ';ott[3][6]:=' ';ott[4][6]:=' ';ott[5][6]:='K';ott[6][6]:=' ';ott[7][6]:=' ';ott[8][6]:=' ';
        ott[1][5]:=' ';ott[2][5]:=' ';ott[3][5]:=' ';ott[4][5]:=' ';ott[5][5]:='k';ott[6][5]:=' ';ott[7][5]:=' ';ott[8][5]:=' ';
        ott[1][4]:=' ';ott[2][4]:=' ';ott[3][4]:=' ';ott[4][4]:=' ';ott[5][4]:=' ';ott[6][4]:=' ';ott[7][4]:=' ';ott[8][4]:=' ';
        ott[1][3]:=' ';ott[2][3]:=' ';ott[3][3]:=' ';ott[4][3]:=' ';ott[5][3]:=' ';ott[6][3]:=' ';ott[7][3]:=' ';ott[8][3]:=' ';
        ott[1][2]:='P';ott[2][2]:='P';ott[3][2]:='P';ott[4][2]:='P';ott[5][2]:='P';ott[6][2]:='P';ott[7][2]:='P';ott[8][2]:='P';
        ott[1][1]:='R';ott[2][1]:='N';ott[3][1]:='B';ott[4][1]:='Q';ott[5][1]:=' ';ott[6][1]:='B';ott[7][1]:='N';ott[8][1]:='R';
        luottrang:=true;
        end;
procedure hienbancogh;
var _opx,_opy: uint16;
        begin
        for _opx:=0 to 559 do
        for _opy:=0 to 559 do
                begin;
                if ((_opx div 70 + _opy div 70) mod 2 = 0) or ((_opx + _opy) mod 2 = 0) then
                putpixel(_opx+44, _opy+44, 24)
                else putpixel(_opx+44, _opy+44, 17)
                end;
        end;
procedure hienquancogh;
var _hbcc, _hbch: uint16;
        begin
        for _hbcc:= 1 to 8 do
        for _hbch:= 1 to 8 do
                begin
                if(ott[_hbcc][_hbch]='P') then whitepawn(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='p') then blackpawn(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='R') then whiterook(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='r') then blackrook(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='N') then whiteknight(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='n') then blackknight(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='B') then whitebishop(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='b') then blackbishop(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='Q') then whitequeen(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='q') then blackqueen(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='K') then whiteking(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='k') then blackking(_hbcc,_hbch, luottrang);
                end;
        end;
procedure hienquancobt;
var _hbcc, _hbch: uint16;
        begin
        for _hbcc:= 1 to 8 do
        for _hbch:= 1 to 8 do
                begin
                gotoxy(5+_hbcc,14-_hbch);
                if (_hbcc+_hbch) mod 2 = 0 then textbackground(black) else textbackground(white);
                if (ott[_hbcc][_hbch] = 'p') or (ott[_hbcc][_hbch] = 'r') or (ott[_hbcc][_hbch] = 'n') or (ott[_hbcc][_hbch] = 'b') or (ott[_hbcc][_hbch] = 'q') or (ott[_hbcc][_hbch] = 'k') then textcolor(red)
                else textcolor(blue);
                write(upcase(ott[_hbcc][_hbch]))
                end;
        end;
//=======================================
function _min(_a, _b: byte): byte;
        begin
        if _a<_b then _min:=_a
        else _min:=_b
        end;
function _max(_a, _b: byte): byte;
        begin
        if _a>_b then _max:=_a
        else _max:=_b
        end;
function kiemtrachieubt(_okt:oc; _lt: boolean) : boolean;
var _ktc, _kth, _cv, _hv, _co: byte;
_kttemp: boolean;
//_cv va _hv ho tro tim kiem vua
//neu luottrang thi kt quan trang co dang bi chieu hay ko
//else thi ktr den
//kttemp la kiem tra tung quan co 1, phong viec khi vua bi chieu nhung luc kiem tra quan khac lam vua khong bi chieu, lam sai lech ketqua
        begin
        kiemtrachieubt:=false;
        if _lt then
                begin
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if _okt[_ktc][_kth]='K' then begin _cv:=_ktc; _hv:=_kth; end;
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if ((97<=ord(_okt[_ktc][_kth])) and (122>=ord(_okt[_ktc][_kth]))) and not kiemtrachieubt then //co chieu roi thi khong kt nua
                //kiem tra xem quan trong o do co phai la quan den khong (quan den la chu viet thuong, do do gia tri ASCII cua no nam tu 97 toi 122), tu do kiem tra quan do co chieu vua cua trang khong
                        begin
                        _kttemp:=false;
                        // Bang chan ly ma ta muon:
                        // ktcb ktt mong muon
                        //  0    0      0
                        //  0    1      1
                        //  1    0      1 (DAC BIET CAI NAY)
                        //  1    1      1
                        //
                        if (_okt[_ktc][_kth]='r') or (_okt[_ktc][_kth]='q') then //xe hoc hau
                        if (_ktc = _cv) xor (_kth = _hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc - _cv)>1 then //neu khong thi xe ngay sat vua
                                for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                if _okt[_co][_kth]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                if abs(_kth - _hv)>1 then
                                for _co:= _min(_kth, _hv)+1 to _max(_kth, _hv)-1 do
                                if _okt[_ktc][_co]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                kiemtrachieubt:=_kttemp or kiemtrachieubt;
                                end;
                        //
                        if _okt[_ktc][_kth]='n' then //ma
                        kiemtrachieubt:= kiemtrachieubt or (((abs(_ktc-_cv)=1) and (abs(_kth-_hv)=2)) or ((abs(_ktc-_cv)=2) and (abs(_kth-_hv)=1)));
                        //chi can vua o tam ngam cua ma la ok, khong can phai lo co quan can
                        //len xuong theo tam nhin nguoi choi              len xuong 2 o, qua 1 o                        len xuong 1 o, qua 2 o
                        //
                        if (_okt[_ktc][_kth]='b') or (_okt[_ktc][_kth]='q') then //tuong hoc hau
                        if abs(_ktc-_cv) = abs(_kth-_hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc-_cv)<>1 then //neu khong thi tuong ngay sat vua va _kttemp van la true
                                        begin
                                        if _cv+_hv=_ktc+_kth then //kiem tra theo huong \
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][_cv+_hv-_co]<> ' ' then _kttemp:=false;
                                        if _cv-_hv=_ktc-_kth then // kiem tra theo huong /
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][-_cv+_hv+_co]<> ' ' then _kttemp:=false;
                                        end;
                                kiemtrachieubt:=_kttemp or kiemtrachieubt
                                end;
                        //
                        if _okt[_ktc][_kth]='p' then //tot
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)=1) and (_kth-_hv=1)); //xuong ve phia ben trang (len phia ben den) 1 o, qua 2 ben 2 o la kiem an cua tot
                        //
                        if _okt[_ktc][_kth]='k' then //vua
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)<=1) and (abs(_kth-_hv)<=1));
                        //
                        end;
                end
        else
                begin
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if _okt[_ktc][_kth]='k' then begin _cv:=_ktc; _hv:=_kth; end;
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if ((65<=ord(_okt[_ktc][_kth])) and (90>=ord(_okt[_ktc][_kth]))) and not kiemtrachieubt then //co chieu roi thi khong kt nua
                //kiem tra xem quan trong o do co phai la quan trang khong (quan den la chu viet hoa, do do gia tri ASCII cua no nam tu 65 toi 90), tu do kiem tra quan do co chieu vua cua trang khong
                        begin
                        _kttemp:=false;
                        // Bang chan ly ma ta muon:
                        // ktcb ktt mong muon
                        //  0    0      0
                        //  0    1      1
                        //  1    0      1 (DAC BIET CAI NAY)
                        //  1    1      1
                        //
                        if (_okt[_ktc][_kth]='R') or (_okt[_ktc][_kth]='Q') then //xe hoc hau
                        if (_ktc = _cv) xor (_kth = _hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc - _cv)>1 then //neu khong thi xe ngay sat vua
                                for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                if _okt[_co][_kth]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                if abs(_kth - _hv)>1 then
                                for _co:= _min(_kth, _hv)+1 to _max(_kth, _hv)-1 do
                                if _okt[_ktc][_co]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                kiemtrachieubt:=_kttemp or kiemtrachieubt;
                                end;
                        //
                        if _okt[_ktc][_kth]='N' then //ma
                        kiemtrachieubt:= kiemtrachieubt or (((abs(_ktc-_cv)=1) and (abs(_kth-_hv)=2)) or ((abs(_ktc-_cv)=2) and (abs(_kth-_hv)=1)));
                        //chi can vua o tam ngam cua ma la ok, khong can phai lo co quan can
                        //len xuong theo tam nhin nguoi choi              len xuong 2 o, qua 1 o                        len xuong 1 o, qua 2 o
                        //
                        if (_okt[_ktc][_kth]='B') or (_okt[_ktc][_kth]='Q') then //tuong hoc hau
                        if abs(_ktc-_cv) = abs(_kth-_hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc-_cv)<>1 then //neu khong thi tuong ngay sat vua va _kttemp van la true
                                        begin
                                        if _cv+_hv=_ktc+_kth then //kiem tra theo huong \
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][_cv+_hv-_co]<> ' ' then _kttemp:=false;
                                        if _cv-_hv=_ktc-_kth then // kiem tra theo huong /
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][-_cv+_hv+_co]<> ' ' then _kttemp:=false;
                                        end;
                                kiemtrachieubt:=_kttemp or kiemtrachieubt
                                end;
                        //
                        if _okt[_ktc][_kth]='P' then //tot
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)=1) and (_kth-_hv=-1)); //xuong ve phia ben den (len phia ben trang) 1 o, qua 2 ben 2 o la kiem an cua tot
                        //
                        if _okt[_ktc][_kth]='K' then //vua
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)<=1) and (abs(_kth-_hv)<=1));
                        //
                        end;
                end
        end;
{function _dulieuo: array [1..8] of array [1..8] of record
        q: char;
        phe: boolean;
        end;
var __c, __h: byte;
        begin
        for __c:=1 to 8 do
        for __h:=1 to 8 do

                begin;

                end;
        end;}
procedure danhsachnuocdi;
var _c, _h: byte;
        begin
        for _c:=1 to 8 do
        for _h:=1 to 8 do
                begin

                end;
        end;
begin
clrscr;
initmouse;
_d1:=detect; _d2:=0;
initgraph(_d1,_d2,'');
reset_banco;
hienbancogh;
hienquancogh;
hienquancobt;
write(getmaxx, ', ', getmaxy);
textcolor(white);
{repeat
        if keypressed then ch:=readkey;
        if lpressed then
                begin
                //repeat until not lpressed;
                getmousestate(mx,my,state);
                putpixel(mx,my,red);
                if luottrang then
                        begin
                        mx:= (mx+26) div 70;
                        my:= 9- ((my+26) div 70);
                        end
                else
                        begin
                        mx:= 9- ((mx+26) div 70);
                        my:= (my+26) div 70;
                        end;
                if (mx<1) or (mx>8) or (my<1) or (my>8) then begin mx:=0; my:=0; end;
                gotoxy(1,1);
                writeln(mx:4,', ',my:4);
                end;
until (ch = ' ') ;
//readln;
closegraph;}
writeln(kiemtrachieubt(ott, luottrang), kiemtrachieubt(ott, not luottrang));
readln;
end.
Ảnh
1723270062211.png
Mình lấy từ Chess-com (bộ quân cờ 8 bit) nên đẹp hơn 90% trở lên mấy bộ của người khác.
AD_4nXcnEXsEIBfFp_M47unacJOVtj-GqMTUz-wGqBjJxXUPicPpiDPRnJUSkkbPi-s16jVAxFOiiN0bcfETjStJeNCGs-It6flyrS48-H2IVnt7_gFH2g-irngsTYzEtvn9M95wqi37Jy7KzK0gCO1EMNH9Y7Yv

AD_4nXewkpYonaPR5c-VD6ristoOgyoFi0NFAqG_f71eJ0K78hRx_KQbNZ37KmDkJNM4pfgkUiOofamPHF4SMkG1VqhFbeL8qpeVPFJNLOGvziJe_G_C3sbW2LweX7OYKtspANXo-SaN3Ns7c3oSTZaL8lzyDTsJ
 
Last edited:
  • Like
Reactions: iceghost

iceghost

Cựu Mod Toán
Thành viên
TV BQT xuất sắc nhất 2016
20 Tháng chín 2013
5,018
7,484
941
TP Hồ Chí Minh
Đại học Bách Khoa TPHCM
Lúc đầu mình có cố gắng code ra game cờ vua bằng FPC nhưng lúc giữa tháng 7 thì lại bận, giờ rảnh nhưng hết hứng làm nên dự án cờ vua mình sẽ dừng vô thời hạn
Mình chia sẻ lại mẫu quân cờ mình đã code sẵn và phần lập trình của mình
Mình đã xong quân cờ và xác định chiếu nhưng lại không làm được phần tính toán các nước đi hợp lệ về sau.
Mình sẽ không code nữa, để lên lớp 10 học python lươn
Chia sẻ ở đây để ai muốn làm thì làm tiếp, mình không đánh bản quyền (Làm tiếp khuyến khích cre mình).
Code:
Mã:
//minh tao them cai thu vien nay de minh khoi phi thoi gian de di qua dong nay, giup nang cao nang suat lap trinh cho minh.
//neu muon, moi nguoi co the viet lai ma lenh cua cac quan co trong day
{yeu cau:
1/ 64 o vuong trong quan co co chieu dai 70 px, o o goc tren ben trai o vi tri (44,44) (o ten cung ben trai cua man hinh la (0,0)
2/ yeu cau thu vien nay phai cho ra 12 lenh cung cu phap sau:
procedure whitepawn (_tdc, _tdh:byte);
procedure blackpawn (_tdc, _tdh:byte);
procedure whiterook (_tdc, _tdh:byte);
procedure blackrook (_tdc, _tdh:byte);
procedure whiteknight (_tdc, _tdh:byte);
procedure blackknight (_tdc, _tdh:byte);
procedure whitebishop (_tdc, _tdh:byte);
procedure blackbishop (_tdc, _tdh:byte);
procedure whitequeen (_tdc, _tdh:byte);
procedure blackqueen (_tdc, _tdh:byte);
procedure whiteking (_tdc, _tdh:byte);
procedure blackking (_tdc, _tdh:byte);
vi tri dat:
trang:









}
unit thuvienquancovua;

interface

uses crt, graph;

//const

//type

//var

procedure pixelpiece (_occ, _och, _pxx, _pxy, _color: byte; lt:boolean);
procedure whitepawn (_tdc, _tdh:byte; wt:boolean);
procedure blackpawn (_tdc, _tdh:byte; wt:boolean);
procedure whiterook (_tdc, _tdh:byte; wt:boolean);
procedure blackrook (_tdc, _tdh:byte; wt:boolean);
procedure whiteknight (_tdc, _tdh:byte; wt:boolean);
procedure blackknight (_tdc, _tdh:byte; wt:boolean);
procedure whitebishop (_tdc, _tdh:byte; wt:boolean);
procedure blackbishop (_tdc, _tdh:byte; wt:boolean);
procedure whitequeen (_tdc, _tdh:byte; wt:boolean);
procedure blackqueen (_tdc, _tdh:byte; wt:boolean);
procedure whiteking (_tdc, _tdh:byte; wt:boolean);
procedure blackking (_tdc, _tdh:byte; wt:boolean);
//=================================
implementation
procedure pixelpiece (_occ, _och, _pxx, _pxy, _color: byte; lt:boolean);
var _tox, _toy: uint16;
        begin
        if lt then
                begin
                for _tox:= -26+70*_occ+5*_pxx to -22+70*_occ+5*_pxx do
                for _toy:= -26+70*(9-_och)+5*_pxy to -22+70*(9-_och)+5*_pxy do
                putpixel(_tox,_toy,_color);
                end
        else
                begin
                for _tox:= -26+70*(9-_occ)+5*_pxx to -22+70*(9-_occ)+5*_pxx do
                for _toy:= -26+70*_och+5*_pxy to -22+70*_och+5*_pxy do
                putpixel(_tox,_toy,_color);
                end
        end;
// tim kiem "hetquanco" roi chon "forward" de qua dong nay.
//=============================
procedure whitepawn (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, white, wt);pixelpiece(_tdc, _tdh, 7, 3, white, wt);pixelpiece(_tdc, _tdh, 8, 3, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, white, wt);pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);pixelpiece(_tdc, _tdh, 9, 9, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);pixelpiece(_tdc, _tdh, 10, 10, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackpawn (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, black, wt);pixelpiece(_tdc, _tdh, 7, 3, black, wt);pixelpiece(_tdc, _tdh, 8, 3, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, black, wt);pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);pixelpiece(_tdc, _tdh, 9, 9, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);pixelpiece(_tdc, _tdh, 10, 10, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whiterook (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 4, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);pixelpiece(_tdc, _tdh, 9, 2, white, wt);
        // . .\ \
        pixelpiece(_tdc, _tdh, 4, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 3, white, wt);pixelpiece(_tdc, _tdh, 8, 3, white, wt);pixelpiece(_tdc, _tdh, 9, 3, white, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);pixelpiece(_tdc, _tdh, 9, 4, white, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, white, wt);
        pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);
        pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);
        pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);
        pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);
        pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);pixelpiece(_tdc, _tdh, 9, 9, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);pixelpiece(_tdc, _tdh, 10, 10, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackrook (_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 4, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);pixelpiece(_tdc, _tdh, 9, 2, black, wt);
        // . .\ \
        pixelpiece(_tdc, _tdh, 4, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 3, black, wt);pixelpiece(_tdc, _tdh, 8, 3, black, wt);pixelpiece(_tdc, _tdh, 9, 3, black, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);pixelpiece(_tdc, _tdh, 9, 4, black, wt);
        // ...\\\
        pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, black, wt);
        pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);
        pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);
        pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);
        pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);
        pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);pixelpiece(_tdc, _tdh, 9, 9, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);pixelpiece(_tdc, _tdh, 10, 10, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whiteknight(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc,_tdh,6,1,white, wt);pixelpiece(_tdc,_tdh,8,1,white, wt);
        //   \ \
        pixelpiece(_tdc,_tdh,6,2,white, wt);pixelpiece(_tdc,_tdh,7,2,7, wt);pixelpiece(_tdc,_tdh,8,2,white, wt);
        //   \.\
        pixelpiece(_tdc,_tdh,5,3,7, wt);pixelpiece(_tdc,_tdh,6,3,white, wt);pixelpiece(_tdc,_tdh,7,3,white, wt);pixelpiece(_tdc,_tdh,8,3,white, wt);pixelpiece(_tdc,_tdh,9,3,white, wt);
        //  .\\\\
        pixelpiece(_tdc,_tdh,4,4,7, wt);pixelpiece(_tdc,_tdh,5,4,white, wt);pixelpiece(_tdc,_tdh,6,4,white, wt);pixelpiece(_tdc,_tdh,7,4,white, wt);pixelpiece(_tdc,_tdh,8,4,white, wt);pixelpiece(_tdc,_tdh,9,4,white, wt);
        // .\\\\\
        pixelpiece(_tdc,_tdh,4,5,7, wt);pixelpiece(_tdc,_tdh,5,5,white, wt);pixelpiece(_tdc,_tdh,6,5,white, wt);pixelpiece(_tdc,_tdh,7,5,white, wt);pixelpiece(_tdc,_tdh,8,5,white, wt);pixelpiece(_tdc,_tdh,9,5,white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 6, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);
        //   .\\\
         pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);
        //  .\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);pixelpiece(_tdc, _tdh, 9, 9, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);pixelpiece(_tdc, _tdh, 10, 10, white, wt);
        //..\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\
        end;
procedure blackknight(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc,_tdh,6,1,black, wt);pixelpiece(_tdc,_tdh,8,1,black, wt);
        //   \ \
        pixelpiece(_tdc,_tdh,6,2,black, wt);pixelpiece(_tdc,_tdh,7,2,7, wt);pixelpiece(_tdc,_tdh,8,2,black, wt);
        //   \.\
        pixelpiece(_tdc,_tdh,5,3,7, wt);pixelpiece(_tdc,_tdh,6,3,black, wt);pixelpiece(_tdc,_tdh,7,3,black, wt);pixelpiece(_tdc,_tdh,8,3,black, wt);pixelpiece(_tdc,_tdh,9,3,black, wt);
        //  .\\\\
        pixelpiece(_tdc,_tdh,4,4,7, wt);pixelpiece(_tdc,_tdh,5,4,black, wt);pixelpiece(_tdc,_tdh,6,4,black, wt);pixelpiece(_tdc,_tdh,7,4,black, wt);pixelpiece(_tdc,_tdh,8,4,black, wt);pixelpiece(_tdc,_tdh,9,4,black, wt);
        // .\\\\\
        pixelpiece(_tdc,_tdh,4,5,7, wt);pixelpiece(_tdc,_tdh,5,5,black, wt);pixelpiece(_tdc,_tdh,6,5,black, wt);pixelpiece(_tdc,_tdh,7,5,black, wt);pixelpiece(_tdc,_tdh,8,5,black, wt);pixelpiece(_tdc,_tdh,9,5,black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 6, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);
        //   .\\\
         pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);
        //  .\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 9, 7, wt);pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);pixelpiece(_tdc, _tdh, 9, 9, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 10, 7, wt);pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);pixelpiece(_tdc, _tdh, 10, 10, black, wt);
        //..\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\
        end;
procedure whitebishop(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, white, wt);pixelpiece(_tdc, _tdh, 7, 3, white, wt);pixelpiece(_tdc, _tdh, 8, 3, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 4, white, wt);pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);
        //   \\\
        pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);pixelpiece(_tdc, _tdh, 9, 5, white, wt);
        // .  \\\
        pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);
        // .. \\\
        pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);
        pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackbishop(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 2, 7, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 3, 7, wt);pixelpiece(_tdc, _tdh, 6, 3, black, wt);pixelpiece(_tdc, _tdh, 7, 3, black, wt);pixelpiece(_tdc, _tdh, 8, 3, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 4, black, wt);pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);
        //   \\\
        pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);pixelpiece(_tdc, _tdh, 9, 5, black, wt);
        // .  \\\
        pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, 7, wt);pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);
        // .. \\\
        pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, 7, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, 7, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);
        pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whitequeen(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 8, 2, white, wt);
        // .
        pixelpiece(_tdc, _tdh, 3, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 8, 3, white, wt);pixelpiece(_tdc, _tdh, 10, 3, white, wt);
        //. .  \ \
        pixelpiece(_tdc, _tdh, 3, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);pixelpiece(_tdc, _tdh, 10, 4, white, wt);
        //. ..\\ \
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, white, wt);
        pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);pixelpiece(_tdc, _tdh, 9, 5, white, wt);pixelpiece(_tdc, _tdh, 10, 5, white, wt);
        //...\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, white, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);
        pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);pixelpiece(_tdc, _tdh, 10, 6, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, white, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);
        pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);pixelpiece(_tdc, _tdh, 10, 7, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, white, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);
        pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);
        pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackqueen(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 8, 2, black, wt);
        // .
        pixelpiece(_tdc, _tdh, 3, 3, 7, wt);pixelpiece(_tdc, _tdh, 5, 3, 7, wt);
        pixelpiece(_tdc, _tdh, 8, 3, black, wt);pixelpiece(_tdc, _tdh, 10, 3, black, wt);
        //. .  \ \
        pixelpiece(_tdc, _tdh, 3, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, 7, wt);
        pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);pixelpiece(_tdc, _tdh, 10, 4, black, wt);
        //. ..\\ \
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, 7, wt);pixelpiece(_tdc, _tdh, 6, 5, black, wt);
        pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);pixelpiece(_tdc, _tdh, 9, 5, black, wt);pixelpiece(_tdc, _tdh, 10, 5, black, wt);
        //...\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, 7, wt);pixelpiece(_tdc, _tdh, 5, 6, black, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);
        pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);pixelpiece(_tdc, _tdh, 10, 6, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, 7, wt);pixelpiece(_tdc, _tdh, 5, 7, black, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);
        pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);pixelpiece(_tdc, _tdh, 10, 7, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, black, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);
        pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);
        pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
procedure whiteking(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 1, 7, wt);pixelpiece(_tdc, _tdh, 7, 1, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, white, wt);pixelpiece(_tdc, _tdh, 7, 2, white, wt);pixelpiece(_tdc, _tdh, 8, 2, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 3, 7, wt);pixelpiece(_tdc, _tdh, 7, 3, white, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, white, wt);pixelpiece(_tdc, _tdh, 7, 4, white, wt);pixelpiece(_tdc, _tdh, 8, 4, white, wt);pixelpiece(_tdc, _tdh, 9, 4, white, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, white, wt);pixelpiece(_tdc, _tdh, 6, 5, white, wt);
        pixelpiece(_tdc, _tdh, 7, 5, white, wt);pixelpiece(_tdc, _tdh, 8, 5, white, wt);pixelpiece(_tdc, _tdh, 9, 5, white, wt);pixelpiece(_tdc, _tdh, 10, 5, white, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, white, wt);pixelpiece(_tdc, _tdh, 5, 6, white, wt);pixelpiece(_tdc, _tdh, 6, 6, white, wt);
        pixelpiece(_tdc, _tdh, 7, 6, white, wt);pixelpiece(_tdc, _tdh, 8, 6, white, wt);pixelpiece(_tdc, _tdh, 9, 6, white, wt);pixelpiece(_tdc, _tdh, 10, 6, white, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, white, wt);pixelpiece(_tdc, _tdh, 5, 7, white, wt);pixelpiece(_tdc, _tdh, 6, 7, white, wt);
        pixelpiece(_tdc, _tdh, 7, 7, white, wt);pixelpiece(_tdc, _tdh, 8, 7, white, wt);pixelpiece(_tdc, _tdh, 9, 7, white, wt);pixelpiece(_tdc, _tdh, 10, 7, white, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, white, wt);pixelpiece(_tdc, _tdh, 6, 8, white, wt);
        pixelpiece(_tdc, _tdh, 7, 8, white, wt);pixelpiece(_tdc, _tdh, 8, 8, white, wt);pixelpiece(_tdc, _tdh, 9, 8, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, white, wt);pixelpiece(_tdc, _tdh, 7, 9, white, wt);pixelpiece(_tdc, _tdh, 8, 9, white, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, white, wt);pixelpiece(_tdc, _tdh, 6, 10, white, wt);
        pixelpiece(_tdc, _tdh, 7, 10, white, wt);pixelpiece(_tdc, _tdh, 8, 10, white, wt);pixelpiece(_tdc, _tdh, 9, 10, white, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, white, wt);pixelpiece(_tdc, _tdh, 6, 11, white, wt);
        pixelpiece(_tdc, _tdh, 7, 11, white, wt);pixelpiece(_tdc, _tdh, 8, 11, white, wt);pixelpiece(_tdc, _tdh, 9, 11, white, wt);pixelpiece(_tdc, _tdh, 10, 11, white, wt);
        //..\\\\\\
        end;
procedure blackking(_tdc, _tdh:byte; wt:boolean);
        begin
        pixelpiece(_tdc, _tdh, 6, 1, 7, wt);pixelpiece(_tdc, _tdh, 7, 1, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 5, 2, 7, wt);pixelpiece(_tdc, _tdh, 6, 2, black, wt);pixelpiece(_tdc, _tdh, 7, 2, black, wt);pixelpiece(_tdc, _tdh, 8, 2, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 6, 3, 7, wt);pixelpiece(_tdc, _tdh, 7, 3, black, wt);
        //   .\
        pixelpiece(_tdc, _tdh, 4, 4, 7, wt);pixelpiece(_tdc, _tdh, 5, 4, 7, wt);pixelpiece(_tdc, _tdh, 6, 4, black, wt);pixelpiece(_tdc, _tdh, 7, 4, black, wt);pixelpiece(_tdc, _tdh, 8, 4, black, wt);pixelpiece(_tdc, _tdh, 9, 4, black, wt);
        // ..\\\\
        pixelpiece(_tdc, _tdh, 3, 5, 7, wt);pixelpiece(_tdc, _tdh, 4, 5, 7, wt);pixelpiece(_tdc, _tdh, 5, 5, black, wt);pixelpiece(_tdc, _tdh, 6, 5, black, wt);
        pixelpiece(_tdc, _tdh, 7, 5, black, wt);pixelpiece(_tdc, _tdh, 8, 5, black, wt);pixelpiece(_tdc, _tdh, 9, 5, black, wt);pixelpiece(_tdc, _tdh, 10, 5, black, wt);
        //..\\\\\\
        pixelpiece(_tdc, _tdh, 3, 6, 7, wt);pixelpiece(_tdc, _tdh, 4, 6, black, wt);pixelpiece(_tdc, _tdh, 5, 6, black, wt);pixelpiece(_tdc, _tdh, 6, 6, black, wt);
        pixelpiece(_tdc, _tdh, 7, 6, black, wt);pixelpiece(_tdc, _tdh, 8, 6, black, wt);pixelpiece(_tdc, _tdh, 9, 6, black, wt);pixelpiece(_tdc, _tdh, 10, 6, black, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 3, 7, 7, wt);pixelpiece(_tdc, _tdh, 4, 7, black, wt);pixelpiece(_tdc, _tdh, 5, 7, black, wt);pixelpiece(_tdc, _tdh, 6, 7, black, wt);
        pixelpiece(_tdc, _tdh, 7, 7, black, wt);pixelpiece(_tdc, _tdh, 8, 7, black, wt);pixelpiece(_tdc, _tdh, 9, 7, black, wt);pixelpiece(_tdc, _tdh, 10, 7, black, wt);
        //.\\\\\\\
        pixelpiece(_tdc, _tdh, 4, 8, 7, wt);pixelpiece(_tdc, _tdh, 5, 8, black, wt);pixelpiece(_tdc, _tdh, 6, 8, black, wt);
        pixelpiece(_tdc, _tdh, 7, 8, black, wt);pixelpiece(_tdc, _tdh, 8, 8, black, wt);pixelpiece(_tdc, _tdh, 9, 8, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 5, 9, 7, wt);pixelpiece(_tdc, _tdh, 6, 9, black, wt);pixelpiece(_tdc, _tdh, 7, 9, black, wt);pixelpiece(_tdc, _tdh, 8, 9, black, wt);
        //  .\\\
        pixelpiece(_tdc, _tdh, 4, 10, 7, wt);pixelpiece(_tdc, _tdh, 5, 10, black, wt);pixelpiece(_tdc, _tdh, 6, 10, black, wt);
        pixelpiece(_tdc, _tdh, 7, 10, black, wt);pixelpiece(_tdc, _tdh, 8, 10, black, wt);pixelpiece(_tdc, _tdh, 9, 10, black, wt);
        // .\\\\\
        pixelpiece(_tdc, _tdh, 3, 11, 7, wt);pixelpiece(_tdc, _tdh, 4, 11, 7, wt);pixelpiece(_tdc, _tdh, 5, 11, black, wt);pixelpiece(_tdc, _tdh, 6, 11, black, wt);
        pixelpiece(_tdc, _tdh, 7, 11, black, wt);pixelpiece(_tdc, _tdh, 8, 11, black, wt);pixelpiece(_tdc, _tdh, 9, 11, black, wt);pixelpiece(_tdc, _tdh, 10, 11, black, wt);
        //..\\\\\\
        end;
// tim kiem "hetquanco" roi chon "backward" de qua dong nay
// yeah lmao no rat dai
//==============================================

end.

Mã:
//10-6-2024
program covua;
uses crt, graph, winmouse, thuvienquancovua;
type oc = array [1..8] of array [1..8] of char;
//yeu cau ban phai tu them cai "thuvienquancovua" vao
var ott, otest: array [1..8] of array [1..8] of char;
ohople: array [1..8] of array [1..8] of array [1..8] of array [1..8] of boolean;
_d1,_d2: {smallint} {int16} smallint;
mx, my, state: longint;
a, b, cv, hv:byte;
c, ch:char;
luottrang: boolean;
procedure reset_banco;
        begin
        ott[1][8]:='r';ott[2][8]:='n';ott[3][8]:='b';ott[4][8]:='q';ott[5][8]:=' ';ott[6][8]:='b';ott[7][8]:='b';ott[8][8]:='r';
        ott[1][7]:='p';ott[2][7]:='p';ott[3][7]:='p';ott[4][7]:='p';ott[5][7]:='p';ott[6][7]:='p';ott[7][7]:='p';ott[8][7]:='p';
        ott[1][6]:=' ';ott[2][6]:=' ';ott[3][6]:=' ';ott[4][6]:=' ';ott[5][6]:='K';ott[6][6]:=' ';ott[7][6]:=' ';ott[8][6]:=' ';
        ott[1][5]:=' ';ott[2][5]:=' ';ott[3][5]:=' ';ott[4][5]:=' ';ott[5][5]:='k';ott[6][5]:=' ';ott[7][5]:=' ';ott[8][5]:=' ';
        ott[1][4]:=' ';ott[2][4]:=' ';ott[3][4]:=' ';ott[4][4]:=' ';ott[5][4]:=' ';ott[6][4]:=' ';ott[7][4]:=' ';ott[8][4]:=' ';
        ott[1][3]:=' ';ott[2][3]:=' ';ott[3][3]:=' ';ott[4][3]:=' ';ott[5][3]:=' ';ott[6][3]:=' ';ott[7][3]:=' ';ott[8][3]:=' ';
        ott[1][2]:='P';ott[2][2]:='P';ott[3][2]:='P';ott[4][2]:='P';ott[5][2]:='P';ott[6][2]:='P';ott[7][2]:='P';ott[8][2]:='P';
        ott[1][1]:='R';ott[2][1]:='N';ott[3][1]:='B';ott[4][1]:='Q';ott[5][1]:=' ';ott[6][1]:='B';ott[7][1]:='N';ott[8][1]:='R';
        luottrang:=true;
        end;
procedure hienbancogh;
var _opx,_opy: uint16;
        begin
        for _opx:=0 to 559 do
        for _opy:=0 to 559 do
                begin;
                if ((_opx div 70 + _opy div 70) mod 2 = 0) or ((_opx + _opy) mod 2 = 0) then
                putpixel(_opx+44, _opy+44, 24)
                else putpixel(_opx+44, _opy+44, 17)
                end;
        end;
procedure hienquancogh;
var _hbcc, _hbch: uint16;
        begin
        for _hbcc:= 1 to 8 do
        for _hbch:= 1 to 8 do
                begin
                if(ott[_hbcc][_hbch]='P') then whitepawn(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='p') then blackpawn(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='R') then whiterook(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='r') then blackrook(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='N') then whiteknight(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='n') then blackknight(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='B') then whitebishop(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='b') then blackbishop(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='Q') then whitequeen(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='q') then blackqueen(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='K') then whiteking(_hbcc,_hbch, luottrang);
                if(ott[_hbcc][_hbch]='k') then blackking(_hbcc,_hbch, luottrang);
                end;
        end;
procedure hienquancobt;
var _hbcc, _hbch: uint16;
        begin
        for _hbcc:= 1 to 8 do
        for _hbch:= 1 to 8 do
                begin
                gotoxy(5+_hbcc,14-_hbch);
                if (_hbcc+_hbch) mod 2 = 0 then textbackground(black) else textbackground(white);
                if (ott[_hbcc][_hbch] = 'p') or (ott[_hbcc][_hbch] = 'r') or (ott[_hbcc][_hbch] = 'n') or (ott[_hbcc][_hbch] = 'b') or (ott[_hbcc][_hbch] = 'q') or (ott[_hbcc][_hbch] = 'k') then textcolor(red)
                else textcolor(blue);
                write(upcase(ott[_hbcc][_hbch]))
                end;
        end;
//=======================================
function _min(_a, _b: byte): byte;
        begin
        if _a<_b then _min:=_a
        else _min:=_b
        end;
function _max(_a, _b: byte): byte;
        begin
        if _a>_b then _max:=_a
        else _max:=_b
        end;
function kiemtrachieubt(_okt:oc; _lt: boolean) : boolean;
var _ktc, _kth, _cv, _hv, _co: byte;
_kttemp: boolean;
//_cv va _hv ho tro tim kiem vua
//neu luottrang thi kt quan trang co dang bi chieu hay ko
//else thi ktr den
//kttemp la kiem tra tung quan co 1, phong viec khi vua bi chieu nhung luc kiem tra quan khac lam vua khong bi chieu, lam sai lech ketqua
        begin
        kiemtrachieubt:=false;
        if _lt then
                begin
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if _okt[_ktc][_kth]='K' then begin _cv:=_ktc; _hv:=_kth; end;
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if ((97<=ord(_okt[_ktc][_kth])) and (122>=ord(_okt[_ktc][_kth]))) and not kiemtrachieubt then //co chieu roi thi khong kt nua
                //kiem tra xem quan trong o do co phai la quan den khong (quan den la chu viet thuong, do do gia tri ASCII cua no nam tu 97 toi 122), tu do kiem tra quan do co chieu vua cua trang khong
                        begin
                        _kttemp:=false;
                        // Bang chan ly ma ta muon:
                        // ktcb ktt mong muon
                        //  0    0      0
                        //  0    1      1
                        //  1    0      1 (DAC BIET CAI NAY)
                        //  1    1      1
                        //
                        if (_okt[_ktc][_kth]='r') or (_okt[_ktc][_kth]='q') then //xe hoc hau
                        if (_ktc = _cv) xor (_kth = _hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc - _cv)>1 then //neu khong thi xe ngay sat vua
                                for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                if _okt[_co][_kth]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                if abs(_kth - _hv)>1 then
                                for _co:= _min(_kth, _hv)+1 to _max(_kth, _hv)-1 do
                                if _okt[_ktc][_co]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                kiemtrachieubt:=_kttemp or kiemtrachieubt;
                                end;
                        //
                        if _okt[_ktc][_kth]='n' then //ma
                        kiemtrachieubt:= kiemtrachieubt or (((abs(_ktc-_cv)=1) and (abs(_kth-_hv)=2)) or ((abs(_ktc-_cv)=2) and (abs(_kth-_hv)=1)));
                        //chi can vua o tam ngam cua ma la ok, khong can phai lo co quan can
                        //len xuong theo tam nhin nguoi choi              len xuong 2 o, qua 1 o                        len xuong 1 o, qua 2 o
                        //
                        if (_okt[_ktc][_kth]='b') or (_okt[_ktc][_kth]='q') then //tuong hoc hau
                        if abs(_ktc-_cv) = abs(_kth-_hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc-_cv)<>1 then //neu khong thi tuong ngay sat vua va _kttemp van la true
                                        begin
                                        if _cv+_hv=_ktc+_kth then //kiem tra theo huong \
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][_cv+_hv-_co]<> ' ' then _kttemp:=false;
                                        if _cv-_hv=_ktc-_kth then // kiem tra theo huong /
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][-_cv+_hv+_co]<> ' ' then _kttemp:=false;
                                        end;
                                kiemtrachieubt:=_kttemp or kiemtrachieubt
                                end;
                        //
                        if _okt[_ktc][_kth]='p' then //tot
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)=1) and (_kth-_hv=1)); //xuong ve phia ben trang (len phia ben den) 1 o, qua 2 ben 2 o la kiem an cua tot
                        //
                        if _okt[_ktc][_kth]='k' then //vua
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)<=1) and (abs(_kth-_hv)<=1));
                        //
                        end;
                end
        else
                begin
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if _okt[_ktc][_kth]='k' then begin _cv:=_ktc; _hv:=_kth; end;
                for _ktc := 1 to 8 do
                for _kth := 1 to 8 do
                if ((65<=ord(_okt[_ktc][_kth])) and (90>=ord(_okt[_ktc][_kth]))) and not kiemtrachieubt then //co chieu roi thi khong kt nua
                //kiem tra xem quan trong o do co phai la quan trang khong (quan den la chu viet hoa, do do gia tri ASCII cua no nam tu 65 toi 90), tu do kiem tra quan do co chieu vua cua trang khong
                        begin
                        _kttemp:=false;
                        // Bang chan ly ma ta muon:
                        // ktcb ktt mong muon
                        //  0    0      0
                        //  0    1      1
                        //  1    0      1 (DAC BIET CAI NAY)
                        //  1    1      1
                        //
                        if (_okt[_ktc][_kth]='R') or (_okt[_ktc][_kth]='Q') then //xe hoc hau
                        if (_ktc = _cv) xor (_kth = _hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc - _cv)>1 then //neu khong thi xe ngay sat vua
                                for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                if _okt[_co][_kth]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                if abs(_kth - _hv)>1 then
                                for _co:= _min(_kth, _hv)+1 to _max(_kth, _hv)-1 do
                                if _okt[_ktc][_co]<>' ' then _kttemp:=false; //<> ' ' la co quan can
                                //
                                kiemtrachieubt:=_kttemp or kiemtrachieubt;
                                end;
                        //
                        if _okt[_ktc][_kth]='N' then //ma
                        kiemtrachieubt:= kiemtrachieubt or (((abs(_ktc-_cv)=1) and (abs(_kth-_hv)=2)) or ((abs(_ktc-_cv)=2) and (abs(_kth-_hv)=1)));
                        //chi can vua o tam ngam cua ma la ok, khong can phai lo co quan can
                        //len xuong theo tam nhin nguoi choi              len xuong 2 o, qua 1 o                        len xuong 1 o, qua 2 o
                        //
                        if (_okt[_ktc][_kth]='B') or (_okt[_ktc][_kth]='Q') then //tuong hoc hau
                        if abs(_ktc-_cv) = abs(_kth-_hv) then
                                begin
                                _kttemp:= true;
                                if abs(_ktc-_cv)<>1 then //neu khong thi tuong ngay sat vua va _kttemp van la true
                                        begin
                                        if _cv+_hv=_ktc+_kth then //kiem tra theo huong \
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][_cv+_hv-_co]<> ' ' then _kttemp:=false;
                                        if _cv-_hv=_ktc-_kth then // kiem tra theo huong /
                                        for _co:= _min(_ktc, _cv)+1 to _max(_ktc, _cv)-1 do
                                        if _okt[_co][-_cv+_hv+_co]<> ' ' then _kttemp:=false;
                                        end;
                                kiemtrachieubt:=_kttemp or kiemtrachieubt
                                end;
                        //
                        if _okt[_ktc][_kth]='P' then //tot
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)=1) and (_kth-_hv=-1)); //xuong ve phia ben den (len phia ben trang) 1 o, qua 2 ben 2 o la kiem an cua tot
                        //
                        if _okt[_ktc][_kth]='K' then //vua
                        kiemtrachieubt:= kiemtrachieubt or ((abs(_ktc-_cv)<=1) and (abs(_kth-_hv)<=1));
                        //
                        end;
                end
        end;
{function _dulieuo: array [1..8] of array [1..8] of record
        q: char;
        phe: boolean;
        end;
var __c, __h: byte;
        begin
        for __c:=1 to 8 do
        for __h:=1 to 8 do

                begin;

                end;
        end;}
procedure danhsachnuocdi;
var _c, _h: byte;
        begin
        for _c:=1 to 8 do
        for _h:=1 to 8 do
                begin

                end;
        end;
begin
clrscr;
initmouse;
_d1:=detect; _d2:=0;
initgraph(_d1,_d2,'');
reset_banco;
hienbancogh;
hienquancogh;
hienquancobt;
write(getmaxx, ', ', getmaxy);
textcolor(white);
{repeat
        if keypressed then ch:=readkey;
        if lpressed then
                begin
                //repeat until not lpressed;
                getmousestate(mx,my,state);
                putpixel(mx,my,red);
                if luottrang then
                        begin
                        mx:= (mx+26) div 70;
                        my:= 9- ((my+26) div 70);
                        end
                else
                        begin
                        mx:= 9- ((mx+26) div 70);
                        my:= (my+26) div 70;
                        end;
                if (mx<1) or (mx>8) or (my<1) or (my>8) then begin mx:=0; my:=0; end;
                gotoxy(1,1);
                writeln(mx:4,', ',my:4);
                end;
until (ch = ' ') ;
//readln;
closegraph;}
writeln(kiemtrachieubt(ott, luottrang), kiemtrachieubt(ott, not luottrang));
readln;
end.
Ảnh
View attachment 280976
Mình lấy từ Chess-com (bộ quân cờ 8 bit) nên đẹp hơn 90% trở lên mấy bộ của người khác.
AD_4nXcnEXsEIBfFp_M47unacJOVtj-GqMTUz-wGqBjJxXUPicPpiDPRnJUSkkbPi-s16jVAxFOiiN0bcfETjStJeNCGs-It6flyrS48-H2IVnt7_gFH2g-irngsTYzEtvn9M95wqi37Jy7KzK0gCO1EMNH9Y7Yv

AD_4nXewkpYonaPR5c-VD6ristoOgyoFi0NFAqG_f71eJ0K78hRx_KQbNZ37KmDkJNM4pfgkUiOofamPHF4SMkG1VqhFbeL8qpeVPFJNLOGvziJe_G_C3sbW2LweX7OYKtspANXo-SaN3Ns7c3oSTZaL8lzyDTsJ
dangxuanchuonNhìn đẹp đó, bravo :D

Một bài tập nhỏ là lưu bộ hình này vào một file, gồm các số [imath]0[/imath] [imath]1[/imath] [imath]2[/imath] để đánh dấu các pixel màu nào chẳng hạn. Mục đích là khi bạn chuyển qua ngôn ngữ khác thì có thể xài lại bằng cách viết code đọc file, đỡ phải port đống này sang các hàm / syntax khác
 
  • Like
Reactions: dangxuanchuon

dangxuanchuon

Học sinh
Thành viên
31 Tháng bảy 2022
135
89
46
Phú Yên
Ok, rất hữu ích (muốn cứ làm, giờ có thể mình sẽ làm sẵn mấy file cho mấy quân cờ)
(Muốn thì làm tiếp phần mình ko làm)
 
Top Bottom