From 0fc6af54b9e906870c9c9c5dd5c7db305670e48c Mon Sep 17 00:00:00 2001 From: c0repwn3r Date: Wed, 15 Feb 2023 10:32:43 -0500 Subject: [PATCH] license compliance --- bamboo/src/board.rs | 18 +++++++++++++++--- bamboo/src/boardfield.rs | 22 ++++++++++++++-------- bamboo/src/error.rs | 15 +++++++++++++++ bamboo/src/lib.rs | 15 +++++++++++++++ bamboo/src/main.rs | 15 +++++++++++++++ bamboo/src/nn/mod.rs | 15 +++++++++++++++ bamboo/src/piece.rs | 15 +++++++++++++++ bamboo/src/uci.rs | 15 +++++++++++++++ bamboo/src/utils.rs | 31 ++++++++++++++----------------- poceae/src/main.rs | 15 +++++++++++++++ 10 files changed, 148 insertions(+), 28 deletions(-) diff --git a/bamboo/src/board.rs b/bamboo/src/board.rs index 699688f..0417170 100644 --- a/bamboo/src/board.rs +++ b/bamboo/src/board.rs @@ -1,6 +1,18 @@ -use std::error::Error; -use std::fmt::{Display, Formatter}; -use std::num::ParseIntError; +// 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 . + use crate::boardfield::{Boardfield, BoardfieldOps}; use crate::error::FENParseError; use crate::piece::{PieceColor, PieceOnBoard, PieceType}; diff --git a/bamboo/src/boardfield.rs b/bamboo/src/boardfield.rs index 1dd9853..e222813 100644 --- a/bamboo/src/boardfield.rs +++ b/bamboo/src/boardfield.rs @@ -1,11 +1,17 @@ -// Bitpacked board: -// One piece can be represented with 4 bits. Therefore, we can fit two pieces in one byte: -// 0b0110_1110 - -// | \ -// Black king \- White king -// 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. -// 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. +// 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 . use crate::boardloc; use crate::piece::{PieceColor, PieceType}; diff --git a/bamboo/src/error.rs b/bamboo/src/error.rs index 2e6a097..4e21b3e 100644 --- a/bamboo/src/error.rs +++ b/bamboo/src/error.rs @@ -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 . + use std::error::Error; use std::fmt::{Display, Formatter}; use std::num::ParseIntError; diff --git a/bamboo/src/lib.rs b/bamboo/src/lib.rs index a41fb7c..ded8e48 100644 --- a/bamboo/src/lib.rs +++ b/bamboo/src/lib.rs @@ -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 . + pub mod boardfield; pub mod piece; pub mod board; diff --git a/bamboo/src/main.rs b/bamboo/src/main.rs index e66353e..1a36d43 100644 --- a/bamboo/src/main.rs +++ b/bamboo/src/main.rs @@ -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 . + use std::{io}; use std::sync::{Arc}; use crate::uci::{uci_handle_command, UCIState}; diff --git a/bamboo/src/nn/mod.rs b/bamboo/src/nn/mod.rs index 21d652a..017d3ff 100644 --- a/bamboo/src/nn/mod.rs +++ b/bamboo/src/nn/mod.rs @@ -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 . + #[derive(Default, Debug)] pub struct BNNModel { diff --git a/bamboo/src/piece.rs b/bamboo/src/piece.rs index fa79f7e..1f513de 100644 --- a/bamboo/src/piece.rs +++ b/bamboo/src/piece.rs @@ -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 . + use crate::piece::PieceType::{Bishop, King, Knight, Pawn, Queen, Rook}; #[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone)] diff --git a/bamboo/src/uci.rs b/bamboo/src/uci.rs index 3c6804c..ea46447 100644 --- a/bamboo/src/uci.rs +++ b/bamboo/src/uci.rs @@ -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 . + use std::error::Error; use crate::{ENGINE_AUTHOR, ENGINE_NAME, ENGINE_VERSION}; use std::fmt::Write; diff --git a/bamboo/src/utils.rs b/bamboo/src/utils.rs index d1b9fcf..c96a169 100644 --- a/bamboo/src/utils.rs +++ b/bamboo/src/utils.rs @@ -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 . - 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; pub fn algebraic_to_boardloc(algebraic: &str) -> Result { diff --git a/poceae/src/main.rs b/poceae/src/main.rs index b39485e..be2cbcd 100644 --- a/poceae/src/main.rs +++ b/poceae/src/main.rs @@ -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 . + use std::path::PathBuf; use clap::{Parser, Subcommand};