G
gamo
I am not sure about how could I translate this:
if($pos<$SIZE){
if($pos<$SIZE-1){
# memmove($min+$pos+1, $min+$pos, ($SIZE-1-$pos)*sizeof(int));
splice @min, $pos, $SIZE-1-$pos, $min[$pos+1..$SIZE-1];
}
$min[$pos] = $item;
}
or this one:
if($flag){
# my $block = ($TOTAL-1-$try)*sizeof(int);
# memmove($rest+$try, $rest+$try+1, $block);
splice @rest, $try, $TOTAL-1-$try, $rest[$try+1..$TOTAL-1];
$placed++;
search(\@board, \@rest, $placed);
$placed--;
# memmove($rest+$try+1, $rest+$try, $block);
$rest[$try] = $pick;
}
Any help is appreciated.
TIA
if($pos<$SIZE){
if($pos<$SIZE-1){
# memmove($min+$pos+1, $min+$pos, ($SIZE-1-$pos)*sizeof(int));
splice @min, $pos, $SIZE-1-$pos, $min[$pos+1..$SIZE-1];
}
$min[$pos] = $item;
}
or this one:
if($flag){
# my $block = ($TOTAL-1-$try)*sizeof(int);
# memmove($rest+$try, $rest+$try+1, $block);
splice @rest, $try, $TOTAL-1-$try, $rest[$try+1..$TOTAL-1];
$placed++;
search(\@board, \@rest, $placed);
$placed--;
# memmove($rest+$try+1, $rest+$try, $block);
$rest[$try] = $pick;
}
Any help is appreciated.
TIA