license compliance

This commit is contained in:
c0repwn3r 2023-02-15 10:32:43 -05:00
parent aa048dd6a6
commit 0fc6af54b9
Signed by: core
GPG Key ID: FDBF740DADDCEECF
10 changed files with 148 additions and 28 deletions

View File

@ -1,6 +1,18 @@
use std::error::Error; // Bamboo, a NNUE chess engine written in Rust.
use std::fmt::{Display, Formatter}; // Copyright (C) 2023 c0repwn3r
use std::num::ParseIntError; // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::boardfield::{Boardfield, BoardfieldOps}; use crate::boardfield::{Boardfield, BoardfieldOps};
use crate::error::FENParseError; use crate::error::FENParseError;
use crate::piece::{PieceColor, PieceOnBoard, PieceType}; use crate::piece::{PieceColor, PieceOnBoard, PieceType};

View File

@ -1,11 +1,17 @@
// Bitpacked board: // Bamboo, a NNUE chess engine written in Rust.
// One piece can be represented with 4 bits. Therefore, we can fit two pieces in one byte: // Copyright (C) 2023 c0repwn3r
// 0b0110_1110 - // This program is free software: you can redistribute it and/or modify
// | \ // it under the terms of the GNU General Public License as published by
// Black king \- White king // the Free Software Foundation, either version 3 of the License, or
// As there are 64 spaces on the board, we can pack the board into a 256-bit integer, and we use that as the index for transposition tables and such. // (at your option) any later version.
// Boards are stored as a 32-byte bitfield, to make accessing them as efficient as possible. //
// We could theoretically pack it into two u128s, but some basic testing seems like LLVM can optimize array indexing faster than the bucketload of shift ops needed to pack it into u128s. // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::boardloc; use crate::boardloc;
use crate::piece::{PieceColor, PieceType}; use crate::piece::{PieceColor, PieceType};

View File

@ -1,3 +1,18 @@
// Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::error::Error; use std::error::Error;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
use std::num::ParseIntError; use std::num::ParseIntError;

View File

@ -1,3 +1,18 @@
// Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pub mod boardfield; pub mod boardfield;
pub mod piece; pub mod piece;
pub mod board; pub mod board;

View File

@ -1,3 +1,18 @@
// Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::{io}; use std::{io};
use std::sync::{Arc}; use std::sync::{Arc};
use crate::uci::{uci_handle_command, UCIState}; use crate::uci::{uci_handle_command, UCIState};

View File

@ -1,3 +1,18 @@
// Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#[derive(Default, Debug)] #[derive(Default, Debug)]
pub struct BNNModel { pub struct BNNModel {

View File

@ -1,3 +1,18 @@
// Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::piece::PieceType::{Bishop, King, Knight, Pawn, Queen, Rook}; use crate::piece::PieceType::{Bishop, King, Knight, Pawn, Queen, Rook};
#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone)] #[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone)]

View File

@ -1,3 +1,18 @@
// Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::error::Error; use std::error::Error;
use crate::{ENGINE_AUTHOR, ENGINE_NAME, ENGINE_VERSION}; use crate::{ENGINE_AUTHOR, ENGINE_NAME, ENGINE_VERSION};
use std::fmt::Write; use std::fmt::Write;

View File

@ -1,21 +1,18 @@
/* // Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
a b c d e f g h
8 56 57 58 59 60 61 62 63 8 -+
7 48 49 50 51 52 53 54 55 7 |- bf2
6 40 41 42 43 44 45 46 47 6 |
5 32 33 34 35 36 37 38 39 5 -+
4 24 25 26 27 28 29 30 31 4 -+
3 16 17 18 19 20 21 22 23 3 |
2 8 9 10 11 12 13 14 15 2 |- bf1
1 0 1 2 3 4 5 6 7 1 -+
a b c d e f g h
*/
use std::error::Error;
use std::fmt::{Display, Formatter};
use crate::error::AlgebraicNotationError; use crate::error::AlgebraicNotationError;
pub fn algebraic_to_boardloc(algebraic: &str) -> Result<isize, AlgebraicNotationError> { pub fn algebraic_to_boardloc(algebraic: &str) -> Result<isize, AlgebraicNotationError> {

View File

@ -1,3 +1,18 @@
// Bamboo, a NNUE chess engine written in Rust.
// Copyright (C) 2023 c0repwn3r
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::path::PathBuf; use std::path::PathBuf;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};