Project

General

Profile

« Previous | Next » 

Revision 4a5157a1

Added by Leszek Koltunski over 2 years ago

Rotations of a Cuboid - finished.

View differences:

src/main/java/org/distorted/objectlib/helpers/ScrambleState.java
25 25

  
26 26
public class ScrambleState
27 27
{
28
  private final int mTotal, mNumAxis;
28
  private final int mTotal, mNumAxis, mNumNonZero;
29 29
  private final int[] mNum;
30 30
  private final int[] mInfo;
31 31
  private final int[] mTmp;
......
39 39

  
40 40
    mNumAxis = axis.length;
41 41
    mNum = new int[mNumAxis];
42
    int total =0;
42
    int nonzero=0, total =0;
43 43

  
44 44
    for(int i=0; i<mNumAxis; i++)
45 45
      {
......
47 47
      total += mNum[i];
48 48
      }
49 49

  
50
    for(int i=0; i<mNumAxis; i++) if( mNum[i]>0 ) nonzero++;
51

  
52
    mNumNonZero = nonzero;
50 53
    mTotal = total;
51 54

  
52 55
    mInfo = new int[LEN*total];
......
84 87
    {
85 88
    int num=0, total=0, max=0, ax, layer;
86 89

  
90
    if( mNumNonZero<2 ) indexExcluded=-1;
91

  
87 92
    for(int i=0; i<mTotal; i++)
88 93
      {
89 94
      ax = mInfo[LEN*i];

Also available in: Unified diff