Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ArrayList<Character> findDoors(char[][] array) {
- String[] possibleDoors = {"A", "B", "C", "D"};
- //ArrayList<String> possibleDoors;
- ArrayList<String> doorsAsList = Arrays.asList(possibleDoors);
- ArrayList<Character> doors = new ArrayList<>();
- for (int row = 0; row < array.length; row++) {
- for (int col = 0; col < array[0].length; col++) {
- if (array[row][col] == Arrays.stream(possibleDoors.).anyMatch(array[row][col]::equals)) {
- location.y = row;
- location.x = col;
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement