forked from IF-LK-2020/arrays2
diceSum
This commit is contained in:
@@ -68,8 +68,13 @@ public class Arrays {
|
||||
* @see Wuerfel#getAugenzahl()
|
||||
*/
|
||||
public int diceSum( Wuerfel[] pArray ) {
|
||||
// TODO: implementieren
|
||||
return 0;
|
||||
int sum = 0;
|
||||
for (Wuerfel w : pArray) {
|
||||
if (w != null) {
|
||||
sum += w.getAugenzahl();
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user