ftp.nice.ch/pub/next/science/mathematics/AliceCube.999.N.bs.tar.gz#/AliceCube/cubeTypes.h

This is cubeTypes.h in view mode; [Download] [Up]

/* Constants and Types for Rubik's Cube */
extern "Objective-C" {
#import "ViewSelect.h"
}
typedef char CubeInt;

typedef enum {X0,X1, Y0,Y1, Z0,Z1, T0,T1, CCMAX} CubeCoord;
typedef XYType CubeAxis;
typedef ViewPos CubePos;
typedef CubeCoord CubeDir;

inline CubeAxis getAxis(CubeCoord c) {return c >> 1;}
inline CubeCoord otherSide(CubeCoord c) {return c ^ 1;}
inline CubePos getPos(CubeCoord c) {return c & 1;}
inline CubeDir getDir(CubeDir d) {return d & 1;}
inline CubeDir setDir(CubeAxis a, CubeDir d) {return (a << 1) + d;}
inline CubeDir revDir(CubeDir d) {return d ^ 1;}

const CubeInt CubeSide = N_SIDE;
#ifdef THREED
const CubeInt CubeDim = 3;
const CubeInt CubeSize = (CubeSide * CubeSide * CubeSide);
#else
const CubeInt CubeDim = 4;
const CubeInt CubeSize = (CubeSide * CubeSide * CubeSide * CubeSide);
#endif
const CubeInt CubeNCoords = (2*CubeDim);

const CubeInt PlaneSize = (CubeSize / 2);
const CubeInt CubeNSides = (CubeSide * CubeDim);

const CubeInt CAxisFlag[]={0x01, 0x02, 0x04, 0x08};

class Cubicle;
class Plane;
class Cube;

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.