Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public ArrayList<Character> findDoors(char[][] array) {
  2. String[] possibleDoors = {"A", "B", "C", "D"};
  3. //ArrayList<String> possibleDoors;
  4. ArrayList<String> doorsAsList = Arrays.asList(possibleDoors);
  5. ArrayList<Character> doors = new ArrayList<>();
  6. for (int row = 0; row < array.length; row++) {
  7. for (int col = 0; col < array[0].length; col++) {
  8. if (array[row][col] == Arrays.stream(possibleDoors.).anyMatch(array[row][col]::equals)) {
  9. location.y = row;
  10. location.x = col;
  11. break;
  12. }
  13. }
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement