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