You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
549 B

  1. import java.util.Arrays;
  2. public class Gameboard {
  3. int[] board;
  4. public Gameboard() {
  5. board = new int[56];
  6. }
  7. public void initGameboard (){
  8. for(int i = 0; i < 40; i++) {
  9. if ( i % 10 == 0) {
  10. board[i] = 1;
  11. }
  12. if( i % 10 == 9) {
  13. board[i] = 2;
  14. }
  15. }
  16. for (int i = 40; i < board.length; i++) {
  17. board[i] = 3;
  18. }
  19. }
  20. @Override
  21. public String toString() {
  22. return Arrays.toString(board);
  23. }
  24. }