public class Situation
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
Situation.SituationIterator
Get all situations that can be attained from this situation
|
| Constructor and Description |
|---|
Situation(int r)
Initialize to a given number of rows, filled with 1,3,5,....
|
Situation(int[] r)
Initialize to a given array
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
gameOver()
Have all matches been taken away?
|
int |
getConfigNumber()
Compute a unique number representing this configuration using
a mixed bases.
|
int |
getNumConfigs()
Number of possible configurations
|
int |
getRow(int r)
Get the number of matches in row
|
int[] |
getRows()
Get an Array representing all rows
|
int |
getSize()
Get the number of rows
|
java.util.Iterator<Situation> |
iterator()
Get an Iterator over all situations than can be attained from this situation
|
void |
remove(int row,
int num)
Remove a number of matches from a row
|
void |
reset()
Revert to the original situation
|
void |
setConfigFromNumber(int n)
Set the configuration from the unique number representing a situation.
|
java.lang.String |
toString() |
public Situation(int[] r)
r - public Situation(int r)
r - public java.lang.String toString()
toString in class java.lang.Objectpublic void reset()
public int getConfigNumber()
public void setConfigFromNumber(int n)
public int getRow(int r)
r - public int[] getRows()
public int getSize()
public int getNumConfigs()
public void remove(int row,
int num)
row - num - public boolean gameOver()
public java.util.Iterator<Situation> iterator()