Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make it run (at least a bit)

  • Loading branch information...
commit 878feade514530ec0bcaa8e28ff175aa65a8a7a5 1 parent eacbfbd
@moritz authored
Showing with 23 additions and 1 deletion.
  1. +1 −1  lib/Sudoku.pm
  2. +22 −0 test.pl
View
2  lib/Sudoku.pm
@@ -26,7 +26,7 @@ class Sudoku {
method init() {
for ^$!size X ^$!size -> $x, $y {
- $constraints[$y][$x] = [ True xx $!size ];
+ @!constraints[$y][$x] = [ True xx $!size ];
}
for ^$!size {
# rows
View
22 test.pl
@@ -0,0 +1,22 @@
+use v6;
+BEGIN { @*INC.push: 'lib' };
+
+use Sudoku;
+
+# from http://sudokugarden.de/de/online/2010-09-09
+# 000000009
+# 800060000
+# 004000051
+# 000005008
+# 000000700
+# 009001003
+# 300000600
+# 000000000
+# 000079040
+# 237514869815963274964827351126735498543298716789641523391452687472186935658379142
+
+my $puzzle = '000000009800060000004000051000005008000000700009001003300000600000000000000079040';
+
+my $s = Sudoku.from-string($puzzle);
+say $s;
+say $s.perl;
Please sign in to comment.
Something went wrong with that request. Please try again.