Fixed directory nesting and will deploy soon

During the pair sessions, git was initialized one folder higher than it was supposed to. I copied the directory containing the rails app and initialized a new repository there, then wiped the origin remote, forked again, and then pushed the proper directory.
So, these checks go from left to right, and start the evaluation on each
position that can begin a winning combination - that is to say, with rows 0
through 5, a piece in row 3 cannot begin a winning diagonal that points
upwards. These bounds are a complicating factor for generalizing these
methods, but having them means that there will not be more than 24 diagonal
checks (12 upward, 12 downward; assuming a 7x6 board) each time the win
check is run. The 'return true' and '... if @board[col][row] && ...' are
just to end the check when a winning combination is found and to make sure
that the starting point actually has a piece (and prevents an instantaneous
win), respectively.

On Mon, Sep 29, 2014 at 10:59 PM, Matt Davis <notifications@github.com>
wrote:

> In app/models/connectfour.rb:
>
> > +    (0..3).each do |col|
> > +      (0..2).each do |row|
> > +        return true if @board[col][row] && (1..3).all? { |diag| @board[col][row] == @board[col+diag][row+diag]}
> > +      end
> > +    end
> > +    false
> > +  end
> > +
> > +  def check_diagonal_down
> > +    (0..3).each do |col|
> > +      (3..5).each do |row|
> > +        return true if @board[col][row] && (1..3).all? { |diag| @board[col][row] == @board[col+diag][row-diag]}
> > +      end
> > +    end
> > +    false
> > +  end
>
> Very nice seeing these diagonal checkers back in action in rails. Very
> clean. Still haven't completely wrapped my head around good diagonal logic
> but I'd imagine that's what it looks like.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/vikingeducation/game_center_on_rails/pull/4/files#r18200168>
> .
>