-
-
Save chopmann/7204928 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dein Code | |
public int getAnzahlTiere(int x, int y) { | |
int count = 0; | |
for (int k = 0; k < ; k++) | |
if (this.map[x][y].tiere.get(k) != null) { | |
count++; | |
} | |
return count; | |
} | |
// Wie ich es meine | |
public int getAnzahlTiere(int x, int y) { | |
return count this.map[x][y].tiere.size(); | |
} | |
// bei "x" und "y" muss du aufpassen das es nicht "über den rand geht". | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment