Commits

Anonymous committed c1009b6

Type diag.

  • Participants
  • Parent commits 7a431d6

Comments (0)

Files changed (2)

abc-path/Games-ABC_Path-Generator/lib/Games/ABC_Path/Generator/RiddleObj.pm

     {
         $clue_idx = 2 + $get_index->();
     }
+    elsif ($type eq 'diag')
+    {
+        $clue_idx = 0;
+    }
     else
     {
         Carp::confess ("Unknown type $type.");

abc-path/Games-ABC_Path-Generator/t/riddle-obj.t

 use strict;
 use warnings;
 
-use Test::More tests => 10;
+use Test::More tests => 11;
 use Test::Differences;
 
 use Games::ABC_Path::Generator;
     # TEST
     eq_or_diff($riddle->get_letters_of_clue({ type => 'row', index => 3, }),
         ['O', 'K',],
-        'get_letters_of_clue type col',
+        'get_letters_of_clue type row',
+    );
+
+    # TEST
+    eq_or_diff($riddle->get_letters_of_clue({ type => 'diag', }),
+        ['Y', 'L',],
+        'get_letters_of_clue type diag',
     );
 
     my $layout = $riddle->get_final_layout();