1. Shlomi Fish
  2. abc-path

Commits

shl...@b384bcd7-cfd4-0310-aca0-d78b80f7b91b  committed 032021b

Got rid of unnecessary variables.

  • Participants
  • Parent commits 72bde97
  • Branches default

Comments (0)

Files changed (1)

File abc-path/generator/generate-abs-path.pl

View file
     my $self = shift;
 
     my $init_xy = $self->{rand}->range_rand($BOARD_SIZE);
-    my @initial_cell = $self->_to_xy($init_xy);
 
     my $init_layout = '';
     vec($init_layout, $init_xy, 8) = 1;
 
-    my $initial_state = $self->_get_next_state($init_layout, $init_xy);
-    
-    my @dfs_stack = ($initial_state);
+    my @dfs_stack = ($self->_get_next_state($init_layout, $init_xy));
 
     DFS:
     while (@dfs_stack)
     {
-        my $last_state = $dfs_stack[-1];
-        my ($l, $last_cells) = @$last_state;
+        my ($l, $last_cells) = @{$dfs_stack[-1]};
 
         if (@dfs_stack == $BOARD_SIZE)
         {