forked from IF-LK-2020/arrays2
diceSum
This commit is contained in:
parent
f66878689e
commit
e96ae83b7e
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue