Last change
on this file since 57 was
44,
checked in by mszubert, 15 years ago
|
cecj, framsticks and games packages imported
|
File size:
739 bytes
|
Line | |
---|
1 | package cecj.app.numbers_game; |
---|
2 | |
---|
3 | import java.math.BigInteger; |
---|
4 | import java.util.List; |
---|
5 | |
---|
6 | import cecj.interaction.InteractionResult; |
---|
7 | import cecj.interaction.RealValuedResult; |
---|
8 | import cecj.utils.Pair; |
---|
9 | |
---|
10 | |
---|
11 | public class CompareOnAllGame extends MultiDimensionalNumbersGame { |
---|
12 | |
---|
13 | @Override |
---|
14 | protected Pair<? extends InteractionResult> compareDimensionsVectors( |
---|
15 | List<BigInteger> candidateVector, List<BigInteger> testVector) { |
---|
16 | |
---|
17 | for (int dim = 0; dim < candidateVector.size(); dim++) { |
---|
18 | if (candidateVector.get(dim).compareTo(testVector.get(dim)) < 0) { |
---|
19 | return new Pair<RealValuedResult>(new RealValuedResult(-1), new RealValuedResult(1)); |
---|
20 | } |
---|
21 | } |
---|
22 | |
---|
23 | return new Pair<RealValuedResult>(new RealValuedResult(1), new RealValuedResult(-1)); |
---|
24 | } |
---|
25 | |
---|
26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.