public class BalancedPermutations
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
size |
Constructor and Description |
---|
BalancedPermutations() |
BalancedPermutations(int size,
long stateA,
long stateB) |
Modifier and Type | Method and Description |
---|---|
void |
fill(int[] items)
Fills
items with a balanced permutation from 0 to size - 1 . |
GreasedRegion |
rotatedGrid() |
GreasedRegion |
shuffledGrid() |
GreasedRegion |
shuffledGridMultiple(int repeats) |
public BalancedPermutations()
public BalancedPermutations(int size, long stateA, long stateB)
public void fill(int[] items)
items
with a balanced permutation from 0 to size - 1
. The length of items
must be
at least size
. This may take a while if size is large; half a second is reasonable for when size is 48,
with smaller sizes taking much less time and larger ones taking much more.items
- an int array which will be modified in-placepublic GreasedRegion rotatedGrid()
public GreasedRegion shuffledGrid()
public GreasedRegion shuffledGridMultiple(int repeats)
Copyright © Eben Howard 2012–2022. All rights reserved.