Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void loadPattern(Scanner sc){
- String current = "";
- //loops through the current string and breaks it up / interprets it as 1's and 0's
- for(int i = 0; i < 10; i++){
- current = sc.next();
- //breaks the string up and interprets it
- for(int j = 0; j < 10; j++){
- if(current.charAt(j) == '*'){
- grid[i+1][j+1] = 1;
- }
- else if(current.charAt(j) == ' '){
- grid[i+1][j+1] = 0;
- }
- }//end J loop
- }//end I loop
- }//end loadPattern
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement