Plisco/Macro/valueFromTT.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 33 SCAR -
1 #! /bin/false
2  
3 # Copyright (C) 2021-2026 Guido Flohr <guido.flohr@cantanea.com>,
4 # all rights reserved.
5  
6 # This program is free software. It comes without any warranty, to
7 # the extent permitted by applicable law. You can redistribute it
8 # and/or modify it under the terms of the Do What the Fuck You Want
9 # to Public License, Version 2, as published by Sam Hocevar. See
10 # http://www.wtfpl.net/ for more details.
11  
12 # This is a macro that is not intended to run standalone.
13  
14 ## no critic (TestingAndDebugging::RequireUseStrict)
15  
16 (do {
17 if ($v >= VALUE_TB_WIN_IN_MAX_PLY) {
18 if ($v >= MATE_IN_MAX_PLY && MATE - $v > 100 - $r50c) {
19 VALUE_TB_WIN_IN_MAX_PLY - 1
20 } elsif (VALUE_TB_WIN_IN_MAX_PLY - $v > 100 - $r50c) {
21 VALUE_TB_WIN_IN_MAX_PLY - 1
22 } else {
23 $v - $p;
24 }
25 } elsif ($v <= VALUE_TB_LOSS_IN_MAX_PLY) {
26 if ($v <= MATED_IN_MAX_PLY && MATE + $v > 100 - $r50c) {
27 VALUE_TB_LOSS_IN_MAX_PLY + 1;
28 } elsif (VALUE_TB_LOSS_IN_MAX_PLY + $v > 100 - $r50c) {
29 VALUE_TB_LOSS_IN_MAX_PLY + 1;
30 } else {
31 $v + $p;
32 }
33 } else {
34 $v;
35 }
36 })