Skip to content

Commit e55179c

Browse files
committed
0.9.2
1 parent c700bf5 commit e55179c

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

Changes

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Revision history for App:SudokuHelper
22

33
{{$NEXT}}
44

5+
0.9.2 2025-02-10T21:51:18-05:00
6+
- Support sandwich with reduced digit set
7+
58
0.9.1 2023-04-07T16:18:35-04:00
69
- Add tests
710
- Extract script functionality to helper lib

META6.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
},
1717
"resources": [
1818
],
19-
"source-url": "git://github.com/coke/sudoku-helper.git",
19+
"source-url": "https://github.com/coke/sudoku-helper.git",
2020
"tags": [
2121
],
2222
"test-depends": [
2323
],
24-
"version": "0.9.1"
24+
"version": "0.9.2"
2525
}

lib/App/SudokuHelper.rakumod

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ unit class App::SudokuHelper;
77
# :x - sequence must contain the number of digits present as a digit.
88

99
our sub MAIN-handler-combo(Int $sum, Int $count?, Str :$n is copy = "", Bool :s(:$sandwich)=False, Bool :$sequence, Bool :$x=False) is export {
10-
$n = $n ~ "19" if $sandwich;
11-
1210
my @counts = $count ?? [$count] !! 1..9;
1311

1412
my @digits = (1..9).grep({ not $n.comb.grep($_)});
13+
if $sandwich {
14+
@digits = @digits[1..*-2];
15+
}
1516

1617
my @retvals;
1718

t/basic.t

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use Test;
22
use App::SudokuHelper;
33

4-
plan 8;
4+
plan 9;
55

66
is MAIN-handler-combo(13), chomp(q:to/EOS/), "combo, any length";
77
4 9
@@ -51,6 +51,11 @@ is MAIN-handler-combo(13, 2, :s), chomp(q:to/EOS/), "combo, sandwich, specific l
5151
6 7
5252
EOS
5353

54+
is MAIN-handler-combo(9, :s, :n<789>), chomp(q:to/EOS/), "combo, sandwich, 1..6";
55+
4 5
56+
2 3 4
57+
EOS
58+
5459
is MAIN-handler-combo(13, :x), chomp(q:to/EOS/), "combo, x-sums, any length";
5560
3 1 9
5661
3 2 8
@@ -63,3 +68,4 @@ is MAIN-handler-combo(13, 4, :x), chomp(q:to/EOS/), "combo, x-sums, specific len
6368
4 1 2 6
6469
4 1 3 5
6570
EOS
71+

0 commit comments

Comments
 (0)