I did some internet searches and got wildly varying answers including knights less than a pawn from a rook value here:
https://royalchessmall.com/blogs/blog/u ... eces-value
So I am wondering, what is a good, logical set of values for chessmen?
I want to do SQL queries based on wood imbalance. I currently have a super primitive SQL call to estimate the values, but I am not at all satisfied that it is correct:
Code: Select all
USE [Chess]
GO
/****** Object: UserDefinedFunction [dbo].[Imbalance] Script Date: 3/27/2024 10:16:07 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[Imbalance](@Epd varchar(1024))
RETURNS float
AS
BEGIN
DECLARE @WhiteQueens float;
DECLARE @BlackQueens float;
DECLARE @WhiteRooks float;
DECLARE @BlackRooks float;
DECLARE @WhiteBishops float;
DECLARE @BlackBishops float;
DECLARE @WhiteKnights float;
DECLARE @BlackKnights float;
DECLARE @WhitePawns float;
DECLARE @BlackPawns float;
DECLARE @imb float;
SET @WhiteQueens = LEN(@Epd) - LEN(REPLACE(@Epd, 'Q', ''));
SET @BlackQueens = LEN(@Epd) - LEN(REPLACE(@Epd, 'q', ''));
SET @WhiteRooks = LEN(@Epd) - LEN(REPLACE(@Epd, 'R', ''));
SET @BlackRooks = LEN(@Epd) - LEN(REPLACE(@Epd, 'r', ''));
SET @WhiteBishops = LEN(@Epd) - LEN(REPLACE(@Epd, 'B', ''));
SET @BlackBishops = LEN(@Epd) - LEN(REPLACE(@Epd, 'b', ''));
SET @WhiteKnights = LEN(@Epd) - LEN(REPLACE(@Epd, 'N', ''));
SET @BlackKnights = LEN(@Epd) - LEN(REPLACE(@Epd, 'n', ''));
SET @WhitePawns = LEN(@Epd) - LEN(REPLACE(@Epd, 'P', ''));
SET @BlackPawns = LEN(@Epd) - LEN(REPLACE(@Epd, 'p', ''));
SET @imb = @WhiteQueens*10.0 - @WhiteQueens*10.0 + @WhiteRooks * 5.25 - @BlackRooks * 5.25 + @WhiteBishops * 3.5 - @BlackBishops * 3.5 + @WhiteKnights * 3.75 - @BlackKnights * 3.75 + @WhitePawns * 1.0 - @BlackPawns * 1.0 ;
RETURN(@imb);
END;