|
@ -13,7 +13,12 @@ import javax.swing.JPanel; |
|
|
|
|
|
|
|
|
public class Logic { |
|
|
public class Logic { |
|
|
|
|
|
|
|
|
|
|
|
int[][] board; |
|
|
|
|
|
int currentPlayer; |
|
|
|
|
|
|
|
|
public int playChip(int[][] playfield, int column, int player) { |
|
|
public int playChip(int[][] playfield, int column, int player) { |
|
|
|
|
|
|
|
|
|
|
|
testForWin(playfield, player); |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -50,23 +55,11 @@ public class Logic { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(e.getSource() == buttons[0]) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if(e.getSource() == buttons[1]) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if(e.getSource() == buttons[2]) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if(e.getSource() == buttons[3]) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if(e.getSource() == buttons[4]) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if(e.getSource() == buttons[5]) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < buttons.length; i++) { |
|
|
|
|
|
if(e.getSource() == buttons[i]) { |
|
|
|
|
|
playChip(board, i, currentPlayer); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|