KeeJayBe

SpelBord_v1

May 8th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.*;
  3.  
  4.  
  5. public class SpelBord
  6. {
  7. // instance variables - vervang deze door jouw variabelen
  8. String[][] spelBordArray = new String [12][9];
  9.  
  10. public SpelBord(){
  11. this.initBoard();
  12. }
  13.  
  14. public void initBoard(){
  15. for (int row=0; row<=11; row++){
  16. for (int col=0; col<=3; col++){
  17. spelBordArray[row][col]="*";
  18. }
  19. spelBordArray[row][4]=" ";
  20. for (int col=5; col<=8; col++){
  21. spelBordArray[row][col]="*";
  22. }
  23. }
  24. }
  25.  
  26. public void printBoard(){
  27. for (int row=0; row<=11; row++){
  28. for (int col=0; col<=8; col++){
  29. System.out.print(spelBordArray[row][col] + " ");
  30. }
  31. System.out.println("");
  32. }
  33. }
  34.  
  35. public String[][] getArray(){
  36. return spelBordArray;
  37. }
  38. }
Add Comment
Please, Sign In to add comment