Skip to content

Instantly share code, notes, and snippets.

@svenliebig
Created July 5, 2017 09:34
Show Gist options
  • Save svenliebig/8056da5d4dc9408ec30d02aa12455845 to your computer and use it in GitHub Desktop.
Save svenliebig/8056da5d4dc9408ec30d02aa12455845 to your computer and use it in GitHub Desktop.
class Quadrat() {
int x;
int y;
Quardrat() {
x = 2;
y = 5;
}
// pseudocode (das möchte ich machen)
getSumOfY(~list~) {
int sumOfY = 0;
foreach quadrat in list {
sumOfY += quadrat.getY()
}
return sumOfY;
}
// pseudocode ende
}
List<Quadrat> qList = new ArrayList<Quadrat>();
// hinzufügen von 3 Quadrat Objekten zu der Liste
qList.getSumOfY() // 15
qList.getSumOfX() // 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment