Plisco/Macro/promotionMovesFromMask.pm untested

filter: Statementstmt 0.0% 0 / 5 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 5 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 while ($target_mask) {
17 my $to = cp_bitboard_count_trailing_zbits $t;
18 my $base_move = $b | ($to << 15) | ($board[$to] << 3);
19 # It is important for move ordering to sort from good to bad promotions.
20 push @m,
21 $b | (5 << 6), # Queen
22 $b | (4 << 6), # Rook
23 $b | (3 << 6), # Bishop
24 $b | (2 << 6); # Knight
25 $target_mask = cp_bitboard_clear_least_set $target_mask;
26 }