TweetFollow Us on Twitter

Sep 00 Challenge 3D For Free Using the Mac's Standard Apps

Volume Number: 16 (2000)
Issue Number: 9
Column Tag: Programmer's Challenge

Programmer's Challenge

by Bob Boonstra, Westford, MA

Busy Beavers

Before we get to this month's Challenge, I have to confess being a little distracted. No, not because the annual holiday up at the lake is just a few days away, although I'll also confess that the prospect of a couple of weeks away from the Real Job is most appealing. No, the distraction is because UPS just delivered another addition to the family of computers at the Boonstra household. The most recent additions have been iMacs for the Junior members of the family, but this one is for Me. A new G4. No, not one of the new dual-processor models introduced by Apple at JavitsWorld. (Those of us in Boston cannot acknowledge use of the term MacWorld for anything on the Right Coast that doesn't happen in Bean Town.) Dual processors might mean something to those PhotoShop users among you, but they don't do much for the Rest of Us until Mac OS X comes along. No, the new addition is one of those now-obsolete single-processor G4-500 models that have (finally) dropped a little in price. As those of you who participate in the Challenge contests know, I've been limping along with an old 8500, enhanced over the years with a faster 604e, then a dual 604e upgrade (BeOS, oh BeOS, wherefore art thou BeOS?), and finally with a G3 board. Several readers have asked in the past about whether AltiVec technology could be used in the Challenge, but, sadly, I didn't have a G4 to use in the evaluation. A problem now rectified, or at least it will be once I complete the file transfers proceeding even as I write.

Now that you all know about my new toy, we can get on to the business at hand. This month's problem was suggested by F. C Kuechmann, who earns two Challenge points for the suggestion. Your Challenge this month is to create a Busy Beaver Turing Machine and write a program that simulates its execution.

The Busy Beaver problem was invented in the early 1960s by Tibor Rado of Ohio State University. He asked the following question about 2-symbol Turing machines: what is the largest number of 1s that a Turing machine with n states could write to a tape initially filled with 0s. That "busy beaver" number, or BB(n), has some interesting properties. For example, by reasoning about the Halting Problem, one can show that BB(n) grows faster than any computable sequence.

An internet search shows that the Busy Beaver problem continues to attract interest. Until 1985, the largest value for a 5-state busy beaver produced 501 1s. Then George Uhing found a 5-state machine that produced 1915 1s before halting. And in 1987, Heiner Marxen (and Jürgen Buntrock showed that BB(5) is at least 4098.

For reference, you can start with the following URLs: Marxen's page at <http://www.drb.insel.de/~heiner/BB/index.html>, and <http://grail.cba.csuohio.edu/~somos/bb.html>

The prototype for the code you should write is:

typedef unsigned long ulong;

typedef enum {kMoveLeft=-1,kHalt=0, kMoveRight=1} MoveDir;

typedef struct TMRule {   /* Turing Machine rule */
  ulong oldState;         /* this rule applies when the machine state is oldState */
  Boolean inputSymbol;   /*   and the current input symbol is inputSymbol */
  ulong newState;         /* set current state to newState when this rule fires */
  Boolean outputSymbol;   /* write outputSymbol to tape when this rule fires */
  char moveDirection;    /* kMoveLeft, kMoveRight, or kHalt */
} TMRule;

ulong /* return number of rules */ BusyBeaver5(
   TMRule theTMRules[],
      /* preallocated storage, return the rules for your BB machine */
);

Boolean /* return true for success */ RunTuringMachine(
   TMRule theTMRules[],
      /* preallocated storage, return the rules for your BB machine */
   ulong numberOfTMRules,
      /* the number of rules in theTMRules */
   ulong numBytesInHalfTape,
      /* half-size of the "infinite" Turing Machine tape */
   unsigned char *tmTape,
      /* pointer to preallocated Turing Machine tape storage */
      /* Each byte contains 8 tape symbols, each symbol is 0 or 1. */
      /* The tape extends from tmTape[-numBytesInHalfTape] to 
                                       tmTape[numBytesInHalfTape -1] */
      /* Tape position 0 is (tmTape[0] & 0x80), 
         tape position 1 is (tmTape[0] & 0x40) 
         tape position -1 is (tmTape[-1] & 0x01), etc. */
   ulong *numberOf1sGenerated,
      /* return the number of 1s placed on the tape */
   ulong *numberOfRulesExecuted
   /* return the number of rules executed when running BB, including the halt rule */
   
);

The first thing you need to do is to select the 5-state Busy Beaver Turing Machine that you will simulate in your RunTuringMachine routine. Since scoring is based on how busy your beaver is, that is, on how many 1s it produces on the simulated Turing Machine tape, you want to give some careful thought to this selection. This Turing Machine should returned by your BusyBeaver5 using the TMRule data structure. BusyBeaver5 may return a hard-coded Turing Machine; it does not need to identify the busy beaver at run time.

My test code will then provide the output of BusyBeaver5 to your RunTuringMachine routine, which should simulate the execution of the input Turing Machine. RunTuringMachine will be provided with a blank (zero-filled) tape tmTape that is 2*numBytesInHalfTape in size. The "read head" of the Turing Machine is initially positioned over position [0] of the tape. On exit, tmTape should contain the output of the Turing Machine being simulated. In addition, you should return in the appropriate output parameters the number of 1s on the output tape and the number of state transitions that occurred during your execution of the Turing Machine. RunTuringMachine should return TRUE if it was able to successfully execute the Turing Machine, and FALSE if it failed for some reason, such as running out of simulated tape. (It is not my intention to provide a simulated tape that is too short, but your code should fail gracefully if that happens during testing.)

RunTuringMachine must provide a general Turing Machine simulation, not dependent on the Busy Beaver problem or on the content of the initial input tape. I may choose to verify correctness of your RunTuringMachine code against other input besides that produced by BusyBeaver5.

The winner will be the solution that identifies the 5-state Busy Beaver generating the most 1s on the output tape. Among solutions with equal numbers of 1s, the solution that produces the output in the fewest number of Turing Machine steps will be the winner. And, for solutions that produce the same output in the same number of steps, the winner will be the solution that executes the Turing Machine in the least execution time. While my hope is that one of you might break new ground in the field of busy beaver research, my expectation is that the winning solution will be determined by the execution time criterion.

This will be a native PowerPC Challenge, using the CodeWarrior Pro 5 environment. Solutions may be coded in C, C++, or Pascal. As is our tradition for the September Column, we'll also allow solutions that are completely or partially coded in assembly language. And, yes, this time you can take advantage of the AltiVec features of the G4.

Three Months Ago Winner

Congratulations to Willeke Rieken (The Netherlands) for submitting the winning solution to the June Rub*k Rotation Programmer's Challenge. Readers may recall that the Rub*k Rotation Challenge required contestants to display an image of the famous puzzle and respond to commands to rotate the entire cube or individual cube faces. Scoring was based on correctness of the solution, in this case the smoothness of the displayed rotations, and on execution time.

The fact that Willeke was the only person to submit an entry does not detract from his solution in the slightest, although it did significantly increase his chances of winning. (You can't win if you don't play!) Willeke elected to use QuickDraw3D to implement his solution, motivated by a desire to gain some experience with the QD3D API. His code creates 26 individual cubies (the center cubie is never visible) using the AddCubie routine. Although it might look like a lot of work to set up the cube, the effort pays off in the simplicity with which one can rotate the cube (RotateCube), turn a face of the cube (QuarterTurn), and draw the entire cube (DrawCube), regardless of orientation.

With only one entry, I'll omit the usual table describing the parameters of the solution, and simply observe that this victory vaults Willeke into 4th place in the overall Challenge standings. And remember, you can't win if you don't ...., oh, I'm repeating myself.

Top Contestants

Listed here are the Top Contestants for the Programmer's Challenge, including everyone who has accumulated 10 or more points during the past two years. The numbers below include points awarded over the 24 most recent contests, including points earned by this month's entrants.

Rank Name Points
1. Munter, Ernst 245
2. Saxton, Tom 126
3. Maurer, Sebastian 78
4. Rieken, Willeke 65
5. Boring, Randy 50
6. Shearer, Rob 47
7. Taylor, Jonathan 26
8. Brown, Pat 20
9. Heathcock, JG 16
10. Downs, Andrew 12
11. Jones, Dennis 12
12. Day, Mark 10
13. Duga, Brady 10
14. Fazekas, Miklos 10
15. Murphy, ACC 10
16. Selengut, Jared 10
17. Strout, Joe 10

There are three ways to earn points: (1) scoring in the top 5 of any Challenge, (2) being the first person to find a bug in a published winning solution or, (3) being the first person to suggest a Challenge that I use. The points you can win are:

1st place 20 points
2nd place 10 points
3rd place 7 points
4th place 4 points
5th place 2 points
finding bug 2 points
suggesting Challenge 2 points

Here is Willeke's winning Rub*k Rotation solution:

RubikRotation.c
Copyright © 2000
Willeke Rieken

/*
   draws (a simplified version of) Rubik's cube and animates
   rotations of the cube and of the faces of the cube.
   I'm using QD3D because I never used it and it seemed
   more fun than a diy method and drowning in sin and cos
   and I still think it is.
   
   the model object for the cube consists of 26 group objects
   for each cubie and a rotation object. the rotation object
   contains all previous rotations of the whole cube added together.
   each cubie object contains a box object and a rotation object.
   a cubie rotation object contains all previous rotations of the
   cubie that was caused by rotating a face of the cube.
   
   during rotation of the cube an extra rotation object is
   submitted. after the rotation the rotation object of the cube
   is adjusted.
   during rotation of a face an exta rotation object is added to
   every cubie in the face. after the rotation the extra rotation
   object is removed and the rotation object of the cubie is adjusted.
   
   references to the rotation object of the cube and to the cubie objects
   are kept in globals.
*/

#include <QD3D.h>
#include <QD3DDrawContext.h>
#include <QD3DRenderer.h>
#include <QD3DShader.h>
#include <QD3DCamera.h>
#include <QD3DLight.h>
#include <QD3DGeometry.h>
#include <QD3DGroup.h>
#include <QD3DMath.h>
#include <QD3DTransform.h>
#include <QD3DView.h>
#include <QD3DAcceleration.h>
#include <QD3DErrors.h>

#include "RubikRotation.h"

TQ3ViewObject   gView;   // the view for the scene
TQ3StyleObject   gInterpolation;
         // interpolation style used when rendering
TQ3StyleObject   gBackFacing;
         // whether to draw shapes that face away from the camera
TQ3StyleObject   gFillStyle;
         // whether drawn as solid filled object or decomposed to components
TQ3GroupObject   gCubeModel;   // the cube
TQ3GroupObject   gCubies[3][3][3];
         // the cubies
TQ3TransformObject   gCubeRotation;
         // cumulation of every rotation of the whole cube until now
TQ3TransformObject   gTempCubeRotation;
         // used during rotation of the cube
float   gStepSize;

static TQ3DrawContextObject MyNewDrawContext(CWindowPtr theWindow)
// create context
{
   TQ3DrawContextData   myDrawContextData;
   TQ3MacDrawContextData   myMacDrawContextData;
   TQ3ColorARGB   clearColor;
   TQ3DrawContextObject   myDrawContext ;
   
   //   Set the background color
   clearColor.a = 1.0;
   clearColor.r = 1.0;
   clearColor.g = 1.0;
   clearColor.b = 1.0;
   
   //   Fill in draw context data
   myDrawContextData.clearImageMethod = kQ3ClearMethodWithColor;
   myDrawContextData.clearImageColor = clearColor;
   myDrawContextData.paneState = kQ3False;
   myDrawContextData.maskState = kQ3False;
   myDrawContextData.doubleBufferState = kQ3True;
   myMacDrawContextData.drawContextData = myDrawContextData;
   myMacDrawContextData.window = theWindow;
   myMacDrawContextData.library = kQ3Mac2DLibraryNone;
   myMacDrawContextData.viewPort = 0;
   myMacDrawContextData.grafPort = 0;
   
   //   Create draw context
   myDrawContext = Q3MacDrawContext_New(&myMacDrawContextData) ;
   return myDrawContext ;
}

static TQ3CameraObject MyNewOrthographicCamera(CWindowPtr theWindow, short cubeWidth)
// create orthographic camera
{
   TQ3OrthographicCameraData   orthographicData;
   TQ3CameraObject   camera;
   TQ3Point3D   from = {0.0, 1.5, 7.0};
   TQ3Point3D   to = {0.0, 0.0, 0.0};
   TQ3Vector3D   up = {0.0, 1.0, 0.0};

   orthographicData.cameraData.placement.cameraLocation = from;
   orthographicData.cameraData.placement.pointOfInterest = to;
   orthographicData.cameraData.placement.upVector = up;
   orthographicData.cameraData.range.hither = 1.0;
   orthographicData.cameraData.range.yon = 1000.0;
   orthographicData.cameraData.viewPort.origin.x = -1.0;
   orthographicData.cameraData.viewPort.origin.y = 1.0;
   orthographicData.cameraData.viewPort.width = 2.0;
   orthographicData.cameraData.viewPort.height = 2.0;

   // calculate view plane, size of the cube is 3.0 in QD3Points
   orthographicData.left = -1.5 * 
         ((float)(theWindow->portRect.right - 
                     theWindow->portRect.left)) / 
               (float)(cubeWidth + 1);
  orthographicData.top = orthographicData.left;
  orthographicData.right = -orthographicData.left;
  orthographicData.bottom = orthographicData.right;

   camera = Q3OrthographicCamera_New(&orthographicData);
   return camera;
}

static TQ3CameraObject MyNewViewPlaneCamera(CWindowPtr theWindow, short cubeWidth)
{
// create perspective camera
   TQ3ViewPlaneCameraData   viewPlaneData;
   TQ3CameraObject   camera;
   TQ3Point3D   from = {0.0, 0.0, 7.0};
   TQ3Point3D   to = {0.0, 0.0, 1.5};
   TQ3Vector3D   up = {0.0, 1.0, 0.0};

   viewPlaneData.cameraData.placement.cameraLocation = from;
   viewPlaneData.cameraData.placement.pointOfInterest = to;
   viewPlaneData.cameraData.placement.upVector = up;
   viewPlaneData.cameraData.range.hither = 1.0;
   viewPlaneData.cameraData.range.yon = 1000.0;
   viewPlaneData.cameraData.viewPort.origin.x = -1.0;
   viewPlaneData.cameraData.viewPort.origin.y = 1.0;
   viewPlaneData.cameraData.viewPort.width = 2.0;
   viewPlaneData.cameraData.viewPort.height = 2.0;

   // calculate view plane, size of the cube is 3.0 in QD3Points
   viewPlaneData.viewPlane = 5.5;
  viewPlaneData.halfWidthAtViewPlane = 1.5 * 
         ((float)(theWindow->portRect.right - 
                     theWindow->portRect.left)) / 
               (float)(cubeWidth + 1);
  viewPlaneData.halfHeightAtViewPlane = 
         viewPlaneData.halfWidthAtViewPlane;
  viewPlaneData.centerXOnViewPlane = 0.0;
  viewPlaneData.centerYOnViewPlane = 0.0;

   camera = Q3ViewPlaneCamera_New(&viewPlaneData);
   return camera;
}

static TQ3GroupObject MyNewAmbientOnlyLights()
{
   TQ3GroupObject   myLightList;
   TQ3LightData   myLightData;
   TQ3LightObject   myAmbientLight;
   TQ3ColorRGB   whiteLight = {1.0, 1.0, 1.0};
   
   //   Set up light data for ambient light.
   myLightData.isOn = kQ3True;
   myLightData.color = whiteLight;
   
   //   Create ambient light.
   myLightData.brightness = 1.0;
   myAmbientLight = Q3AmbientLight_New(&myLightData);

   //   Create light group and add each of the lights into the group.
   myLightList = Q3LightGroup_New();
   Q3Group_AddObject(myLightList, myAmbientLight);
   Q3Object_Dispose(myAmbientLight) ;
   return myLightList;
}

static TQ3GroupObject MyNewLights()
{
   TQ3GroupObject   myLightList;
   TQ3LightData   myLightData;
   TQ3PointLightData   myPointLightData;
   TQ3DirectionalLightData   myDirectionalLightData;
   TQ3LightObject   myAmbientLight, myPointLight, myFillLight;
   TQ3Point3D   pointLocation = {-10.0, 0.0, 10.0};
   TQ3Vector3D   fillDirection = {10.0, 0.0, 10.0};
   TQ3ColorRGB   whiteLight = {1.0, 1.0, 1.0};
   
   //   Set up light data for ambient light.
   //   This light data will be used for point and fill light also.
   myLightData.isOn = kQ3True;
   myLightData.color = whiteLight;
   
   //   Create ambient light.
   myLightData.brightness = 0.25;
   myAmbientLight = Q3AmbientLight_New(&myLightData);
   
   //   Create point light.
   myLightData.brightness = 1.0;
   myPointLightData.lightData = myLightData;
   myPointLightData.castsShadows = kQ3False;
   myPointLightData.attenuation = kQ3AttenuationTypeNone;
   myPointLightData.location = pointLocation;
   myPointLight = Q3PointLight_New(&myPointLightData);

   //   Create fill light.
   myLightData.brightness = 0.2;
   myDirectionalLightData.lightData = myLightData;
   myDirectionalLightData.castsShadows = kQ3False;
   myDirectionalLightData.direction = fillDirection;
   myFillLight = Q3DirectionalLight_New(&myDirectionalLightData);

   //   Create light group and add each of the lights into the group.
   myLightList = Q3LightGroup_New();
   Q3Group_AddObject(myLightList, myAmbientLight);
   Q3Group_AddObject(myLightList, myPointLight);
   Q3Group_AddObject(myLightList, myFillLight);

   Q3Object_Dispose(myAmbientLight);
   Q3Object_Dispose(myPointLight);
   Q3Object_Dispose(myFillLight);

   return myLightList;
}

static TQ3ViewObject MyNewView(CWindowPtr theWindow, short cubeWidth)
{
   TQ3ViewObject   myView;
   TQ3DrawContextObject   myDrawContext;
   TQ3RendererObject   myRenderer;
   TQ3CameraObject   myCamera;
   TQ3GroupObject   myLights;
   
   myView = Q3View_New();
   
   //   Create and set draw context.
   myDrawContext = MyNewDrawContext(theWindow);
   Q3View_SetDrawContext(myView, myDrawContext);
   Q3Object_Dispose(myDrawContext) ;
   
   //   Create and set renderer.
   // use the interactive software renderer
   myRenderer = 
      Q3Renderer_NewFromType(kQ3RendererTypeInteractive);
   Q3View_SetRenderer(myView, myRenderer);
   // these two lines set us up to use the best possible renderer,
   // including  hardware if it is installed.
   Q3InteractiveRenderer_SetDoubleBufferBypass(myRenderer, 
         kQ3True);                  
   Q3InteractiveRenderer_SetPreferences(myRenderer, 
         kQAVendor_BestChoice, 0);
   /* for software renderer, without hardware accelleration, replace with:
   Q3InteractiveRenderer_SetPreferences(myRenderer, kQAVendor_Apple, 
         kQAEngine_AppleSW);
   */
   Q3Object_Dispose(myRenderer);
   
   //   Create and set camera.
   myCamera = MyNewViewPlaneCamera(theWindow, cubeWidth);
   /* for an orthographic camera, replace with:
   myCamera = MyNewOrthographicCamera(theWindow, cubeWidth);
   */
   Q3View_SetCamera(myView, myCamera);
   Q3Object_Dispose(myCamera) ;
   
   //   Create and set lights.
   myLights = MyNewAmbientOnlyLights();
   /* for better looking lights, replace with:
   myLights = MyNewLights();
   */
   Q3View_SetLightGroup(myView, myLights);
   Q3Object_Dispose(myLights);

   return myView;
}

static void DrawCube()
{   
   TQ3ViewStatus   myStatus;
   Q3View_StartRendering(gView);
   do
   {
      Q3Style_Submit(gInterpolation, gView);
      Q3Style_Submit(gBackFacing, gView);
      Q3Style_Submit(gFillStyle, gView);
      if (gTempCubeRotation)
         Q3Transform_Submit(gTempCubeRotation, gView);
      Q3DisplayGroup_Submit(gCubeModel, gView);
      myStatus = Q3View_EndRendering(gView);
   } while (myStatus == kQ3ViewStatusRetraverse);
}

static void AddCubie(TQ3GroupObject theGroup, long theX, long theY, long theZ,
                  TQ3ColorRGB *theLeftColor, TQ3ColorRGB *theRightColor, TQ3ColorRGB *theFrontColor,
                  TQ3ColorRGB *theBackColor, TQ3ColorRGB *theTopColor, TQ3ColorRGB *theBottomColor)
{
   TQ3GeometryObject   myBox;
   TQ3BoxData   myBoxData;
   TQ3SetObject   faces[6];
   TQ3GroupObject   aCubie;
   TQ3TransformObject   aTransformation;
   TQ3Matrix4x4   aMatrix;
   short   face;

   // create a rotation object, it doesn't rotate yet
   // but it will be adjusted after rotating the face
   aCubie = Q3DisplayGroup_New();
   Q3Matrix4x4_SetIdentity(&aMatrix);
   aTransformation = Q3MatrixTransform_New(&aMatrix);
   Q3Group_AddObject(aCubie, aTransformation);
   Q3Object_Dispose(aTransformation);
   
   // create the box itself
   myBoxData.faceAttributeSet = faces;
   myBoxData.boxAttributeSet = nil;
   myBoxData.faceAttributeSet[0] = Q3AttributeSet_New();
   Q3AttributeSet_Add(myBoxData.faceAttributeSet[0], 
         kQ3AttributeTypeDiffuseColor, theLeftColor);
   myBoxData.faceAttributeSet[1] = Q3AttributeSet_New();
   Q3AttributeSet_Add(myBoxData.faceAttributeSet[1], 
         kQ3AttributeTypeDiffuseColor, theRightColor);
   myBoxData.faceAttributeSet[2] = Q3AttributeSet_New();
   Q3AttributeSet_Add(myBoxData.faceAttributeSet[2], 
         kQ3AttributeTypeDiffuseColor, theFrontColor);
   myBoxData.faceAttributeSet[3] = Q3AttributeSet_New();
   Q3AttributeSet_Add(myBoxData.faceAttributeSet[3], 
         kQ3AttributeTypeDiffuseColor, theBackColor);
   myBoxData.faceAttributeSet[4] = Q3AttributeSet_New();
   Q3AttributeSet_Add(myBoxData.faceAttributeSet[4], 
         kQ3AttributeTypeDiffuseColor, theTopColor);
   myBoxData.faceAttributeSet[5] = Q3AttributeSet_New();
   Q3AttributeSet_Add(myBoxData.faceAttributeSet[5], 
         kQ3AttributeTypeDiffuseColor, theBottomColor);
   Q3Point3D_Set(&myBoxData.origin, -1.5 + theX, 0.5 - theY, 
         0.5 - theZ);
   Q3Vector3D_Set(&myBoxData.orientation, 0, 1, 0);
   Q3Vector3D_Set(&myBoxData.majorAxis, 0, 0, 1);   
   Q3Vector3D_Set(&myBoxData.minorAxis, 1, 0, 0);   
   myBox = Q3Box_New(&myBoxData);
   for (face = 0; face < 6; face++)
      if (myBoxData.faceAttributeSet[face] != 0)
         Q3Object_Dispose(myBoxData.faceAttributeSet[face]);
   Q3Group_AddObject(aCubie, myBox);
   Q3Object_Dispose(myBox);
   Q3Group_AddObject(theGroup, aCubie);
   gCubies[theX][theY][theZ] = aCubie;
}

static TQ3GroupObject MyNewModel(const RGBColor cubeColors[6],   
         const short cubieColors[6][3][3])
{
   TQ3GroupObject   myGroup = 0;
   TQ3ShaderObject   myIlluminationShader ;
   TQ3Matrix4x4   aMatrix;
   TQ3ColorRGB   Q3CubeColors[6];
   TQ3ColorRGB   aGray = {0.25, 0.25, 0.25};
   long   face;
      
   // convert RGBColor to TQ3ColorRGB
   for (face = 0; face < 6; face++)
   {
Q3CubeColors[face].r = (float)cubeColors[face].red / 0xffff;
Q3CubeColors[face].g = (float)cubeColors[face].green / 0xffff;
Q3CubeColors[face].b = (float)cubeColors[face].blue / 0xffff;
   }
   // Create a group for the complete model.
   if ((myGroup = Q3DisplayGroup_New()) != 0)
   {
      // Define a shading type for the group
      // and add the shader to the group
      myIlluminationShader = Q3NULLIllumination_New();
      /* for a better looking cube, replace with
      myIlluminationShader = Q3LambertIllumination_New();
      or
      myIlluminationShader = Q3PhongIllumination_New();
      */
      Q3Group_AddObject(myGroup, myIlluminationShader);
      Q3Object_Dispose(myIlluminationShader);   

   // create a rotation object, it doesn't rotate yet
   // but it will be adjusted after rotating the cube
      Q3Matrix4x4_SetIdentity(&aMatrix);
      gCubeRotation = Q3MatrixTransform_New(&aMatrix);
      Q3Group_AddObject(myGroup, gCubeRotation);
      
      // add boxes for the cubies
         // left top front
      AddCubie(myGroup, 0, 0, 0,
               &Q3CubeColors[cubieColors[kLeft][2][0]], &aGray, 
               &Q3CubeColors[cubieColors[kFront][0][0]],
         &aGray, &Q3CubeColors[cubieColors[kUp][0][2]], &aGray);
         // middle top front
      AddCubie(myGroup, 1, 0, 0,
      &aGray, &aGray, &Q3CubeColors[cubieColors[kFront][1][0]],
         &aGray, &Q3CubeColors[cubieColors[kUp][1][2]], &aGray);
         // right top front
      AddCubie(myGroup, 2, 0, 0,
               &aGray, &Q3CubeColors[cubieColors[kRight][0][0]], 
               &Q3CubeColors[cubieColors[kFront][2][0]],
         &aGray, &Q3CubeColors[cubieColors[kUp][2][2]], &aGray);

         // left top middle
      AddCubie(myGroup, 0, 0, 1,
      &Q3CubeColors[cubieColors[kLeft][1][0]], &aGray, &aGray,
         &aGray, &Q3CubeColors[cubieColors[kUp][0][1]], &aGray);
         // middle top middle
      AddCubie(myGroup, 1, 0, 1,
               &aGray, &aGray, &aGray,
         &aGray, &Q3CubeColors[cubieColors[kUp][1][1]], &aGray);
         // right top middle
      AddCubie(myGroup, 2, 0, 1,
      &aGray, &Q3CubeColors[cubieColors[kRight][1][0]], &aGray,
         &aGray, &Q3CubeColors[cubieColors[kUp][2][1]], &aGray);

         // left top back
      AddCubie(myGroup, 0, 0, 2,
      &Q3CubeColors[cubieColors[kLeft][0][0]], &aGray, &aGray,
               &Q3CubeColors[cubieColors[kBack][2][0]], 
               &Q3CubeColors[cubieColors[kUp][0][0]], &aGray);
         // middle top back
      AddCubie(myGroup, 1, 0, 2,
               &aGray, &aGray, &aGray,
               &Q3CubeColors[cubieColors[kBack][1][0]], 
               &Q3CubeColors[cubieColors[kUp][1][0]], &aGray);
         // right top back
      AddCubie(myGroup, 2, 0, 2,
      &aGray, &Q3CubeColors[cubieColors[kRight][2][0]], &aGray,
               &Q3CubeColors[cubieColors[kBack][0][0]], 
               &Q3CubeColors[cubieColors[kUp][2][0]], &aGray);

         // left middle front
      AddCubie(myGroup, 0, 1, 0,
               &Q3CubeColors[cubieColors[kLeft][2][1]], &aGray, 
               &Q3CubeColors[cubieColors[kFront][0][1]],
               &aGray, &aGray, &aGray);
         // middle middle front
      AddCubie(myGroup, 1, 1, 0,
      &aGray, &aGray, &Q3CubeColors[cubieColors[kFront][1][1]],
               &aGray, &aGray, &aGray);
         // right middle front
      AddCubie(myGroup, 2, 1, 0,
               &aGray, &Q3CubeColors[cubieColors[kRight][0][1]], 
               &Q3CubeColors[cubieColors[kFront][2][1]],
               &aGray, &aGray, &aGray);

         // left middle middle
      AddCubie(myGroup, 0, 1, 1,
      &Q3CubeColors[cubieColors[kLeft][1][1]], &aGray, &aGray,
               &aGray, &aGray, &aGray);
         // middle middle middle
      /* invisible
      AddCubie(myGroup, 1, 1, 1,
               &aGray, &aGray, &aGray,
               &aGray, &aGray, &aGray);
      */
         // right middle middle
      AddCubie(myGroup, 2, 1, 1,
      &aGray, &Q3CubeColors[cubieColors[kRight][1][1]], &aGray,
               &aGray, &aGray, &aGray);

         // left middle back
      AddCubie(myGroup, 0, 1, 2,
      &Q3CubeColors[cubieColors[kLeft][0][1]], &aGray, &aGray,
      &Q3CubeColors[cubieColors[kBack][2][1]], &aGray, &aGray);
         // middle middle back
      AddCubie(myGroup, 1, 1, 2,
               &aGray, &aGray, &aGray,
      &Q3CubeColors[cubieColors[kBack][1][1]], &aGray, &aGray);
         // right middle back
      AddCubie(myGroup, 2, 1, 2,
      &aGray, &Q3CubeColors[cubieColors[kRight][2][1]], &aGray,
      &Q3CubeColors[cubieColors[kBack][0][1]], &aGray, &aGray);

         // left bottom front
      AddCubie(myGroup, 0, 2, 0,
               &Q3CubeColors[cubieColors[kLeft][2][2]], &aGray, 
               &Q3CubeColors[cubieColors[kFront][0][2]],
      &aGray, &aGray, &Q3CubeColors[cubieColors[kDown][0][0]]);
         // middle bottom front
      AddCubie(myGroup, 1, 2, 0,
      &aGray, &aGray, &Q3CubeColors[cubieColors[kFront][1][2]],
      &aGray, &aGray, &Q3CubeColors[cubieColors[kDown][1][0]]);
         // right bottom front
      AddCubie(myGroup, 2, 2, 0,
               &aGray, &Q3CubeColors[cubieColors[kRight][0][2]], 
               &Q3CubeColors[cubieColors[kFront][2][2]],
      &aGray, &aGray, &Q3CubeColors[cubieColors[kDown][2][0]]);

         // left bottom middle
      AddCubie(myGroup, 0, 2, 1,
      &Q3CubeColors[cubieColors[kLeft][1][2]], &aGray, &aGray,
      &aGray, &aGray, &Q3CubeColors[cubieColors[kDown][0][1]]);
         // middle bottom middle
      AddCubie(myGroup, 1, 2, 1,
               &aGray, &aGray, &aGray,
      &aGray, &aGray, &Q3CubeColors[cubieColors[kDown][1][1]]);
         // right bottom middle
      AddCubie(myGroup, 2, 2, 1,
      &aGray, &Q3CubeColors[cubieColors[kRight][1][2]], &aGray,
      &aGray, &aGray, &Q3CubeColors[cubieColors[kDown][2][1]]);

         // left bottom back
      AddCubie(myGroup, 0, 2, 2,
      &Q3CubeColors[cubieColors[kLeft][0][2]], &aGray, &aGray,
               &Q3CubeColors[cubieColors[kBack][2][2]], &aGray, 
               &Q3CubeColors[cubieColors[kDown][0][2]]);
         // middle bottom back
      AddCubie(myGroup, 1, 2, 2,
               &aGray, &aGray, &aGray,
               &Q3CubeColors[cubieColors[kBack][1][2]], &aGray, 
               &Q3CubeColors[cubieColors[kDown][1][2]]);
         // right bottom back
      AddCubie(myGroup, 2, 2, 2,
      &aGray, &Q3CubeColors[cubieColors[kRight][2][2]], &aGray,
               &Q3CubeColors[cubieColors[kBack][0][2]], &aGray, 
               &Q3CubeColors[cubieColors[kDown][2][2]]);

   }
   return myGroup;
}

void InitCube(
  CWindowPtr cubeWindow,         
  const RGBColor cubeColors[6],   
  const short cubieColors[6][3][3], 
  short cubeWidth,  
  short stepSize    
) {
   long   x, y, z;

   for (x = 0; x < 3; x++)
      for (y = 0; y < 3; y++)
         for (z = 0; z < 3; z++)
            gCubies[x][y][z] = 0;

   SetPort((GrafPtr)cubeWindow);

   gStepSize = stepSize;
   gTempCubeRotation = 0;
   gCubeRotation = 0;
   
   Q3Initialize();

   // sets up the 3d data for the scene
   // Create view for QuickDraw 3D.
   gView = MyNewView(cubeWindow, cubeWidth);

   // the main display group:
   gCubeModel = MyNewModel(cubeColors, cubieColors);

   // the drawing styles:
   gInterpolation = 
         Q3InterpolationStyle_New(kQ3InterpolationStyleNone);
   gBackFacing = Q3BackfacingStyle_New(kQ3BackfacingStyleRemove);
   gFillStyle = Q3FillStyle_New(kQ3FillStyleFilled);

   DrawCube();      
}

void QuarterTurn(
  CubeFace face,
  TurnDirection direction
) {
   long   i, x, y, z;
   long   aFirstX, aLastX, aFirstY, aLastY, aFirstZ, aLastZ;
   TQ3Matrix4x4   aCubieMatrix, aRotationMatrix;
   TQ3RotateAboutAxisTransformData   aRotationdata;
   TQ3TransformObject   aFaceRotation;
   TQ3GroupPosition   aPos;
   TQ3GroupObject   aCubie;
   long   stepsToTurn;

   aFirstX = 0;
   aLastX = 3;
   aFirstY = 0;
   aLastY = 3;
   aFirstZ = 0;
   aLastZ = 3;

   // create a rotation object
   switch(face)
   {
      case kFront:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 0.0, -1.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 0.0, 1.0);
         aLastZ = 1;
         break;
      }
      case kBack:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 0.0, 1.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 0.0, -1.0);
         aFirstZ = 2;
         break;
      }
      case kLeft:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 1.0, 0.0, 0.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, -1.0, 0.0, 0.0);
         aLastX = 1;
         break;
      }
      case kRight:
      {
   if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, -1.0, 0.0, 0.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, 1.0, 0.0, 0.0);
         aFirstX = 2;
         break;
      }
      case kUp:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, -1.0, 0.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 1.0, 0.0);
         aLastY = 1;
         break;
      }
      case kDown:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 1.0, 0.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, -1.0, 0.0);
         aFirstY = 2;
         break;
      }
   }
   Q3Point3D_Set(&aRotationdata.origin, 0.0, 0.0, 0.0);
   aRotationdata.radians = 0.0;
   
   aFaceRotation = Q3RotateAboutAxisTransform_New(&aRotationdata);
   // add the rotation object to each cubie in the face
   for (x = aFirstX; x < aLastX; x++)
      for (y = aFirstY; y < aLastY; y++)
         for (z = aFirstZ; z < aLastZ; z++)
         {
            Q3Group_GetFirstPosition(gCubies[x][y][z], &aPos);
            Q3Group_AddObjectBefore(gCubies[x][y][z], aPos, 
                  aFaceRotation);
         }
   // draw and adjust the angle
   stepsToTurn = gStepSize / 4;
   for (i = 1; i < stepsToTurn; i++)
   {
      Q3RotateAboutAxisTransform_SetAngle(aFaceRotation, 
               (2.0 * kQ3Pi * i / gStepSize));
      DrawCube();
   }
   
   // set the angle to 90° and adjust the rotation of each cubie
   Q3RotateAboutAxisTransform_SetAngle(aFaceRotation, 
               (kQ3Pi / 2.0));
   Q3Transform_GetMatrix(aFaceRotation, &aRotationMatrix);
   if (aFaceRotation)
      Q3Object_Dispose(aFaceRotation);
   for (x = aFirstX; x < aLastX; x++)
      for (y = aFirstY; y < aLastY; y++)
         for (z = aFirstZ; z < aLastZ; z++)
         {
            Q3Group_GetFirstPosition(gCubies[x][y][z], &aPos);
         aFaceRotation = Q3Group_RemovePosition(gCubies[x][y][z], 
                  aPos);
            if (aFaceRotation)
               Q3Object_Dispose(aFaceRotation);
            Q3Group_GetFirstPositionOfType(gCubies[x][y][z], 
                  kQ3TransformTypeMatrix, &aPos);
            Q3Group_GetPositionObject(gCubies[x][y][z], aPos, 
                  &aFaceRotation);
            if (aFaceRotation)
            {
            Q3MatrixTransform_Get(aFaceRotation, &aCubieMatrix);
         Q3Matrix4x4_Multiply(&aCubieMatrix, &aRotationMatrix, 
                  &aCubieMatrix);
            Q3MatrixTransform_Set(aFaceRotation, &aCubieMatrix);
               Q3Object_Dispose(aFaceRotation);
            }
         }
   DrawCube();

   // rotate cubies in gCubies
   switch(face)
   {
      case kFront:
      {
         if (direction == kClockwise)
         {
            aCubie                = gCubies[0][0][0];
            gCubies[0][0][0] = gCubies[0][2][0];
            gCubies[0][2][0] = gCubies[2][2][0];
            gCubies[2][2][0] = gCubies[2][0][0];
            gCubies[2][0][0] = aCubie;
            aCubie                = gCubies[1][0][0];
            gCubies[1][0][0] = gCubies[0][1][0];
            gCubies[0][1][0] = gCubies[1][2][0];
            gCubies[1][2][0] = gCubies[2][1][0];
            gCubies[2][1][0] = aCubie;
         }
         else
         {
            aCubie                = gCubies[0][2][0];
            gCubies[0][2][0] = gCubies[0][0][0];
            gCubies[0][0][0] = gCubies[2][0][0];
            gCubies[2][0][0] = gCubies[2][2][0];
            gCubies[2][2][0] = aCubie;
            aCubie                = gCubies[1][2][0];
            gCubies[1][2][0] = gCubies[0][1][0];
            gCubies[0][1][0] = gCubies[1][0][0];
            gCubies[1][0][0] = gCubies[2][1][0];
            gCubies[2][1][0] = aCubie;
         }
         break;
      }
      case kBack:
      {
         if (direction == kClockwise)
         {
            aCubie                = gCubies[0][2][2];
            gCubies[0][2][2] = gCubies[0][0][2];
            gCubies[0][0][2] = gCubies[2][0][2];
            gCubies[2][0][2] = gCubies[2][2][2];
            gCubies[2][2][2] = aCubie;
            aCubie                = gCubies[1][2][2];
            gCubies[1][2][2] = gCubies[0][1][2];
            gCubies[0][1][2] = gCubies[1][0][2];
            gCubies[1][0][2] = gCubies[2][1][2];
            gCubies[2][1][2] = aCubie;
         }
         else
         {
            aCubie                = gCubies[0][0][2];
            gCubies[0][0][2] = gCubies[0][2][2];
            gCubies[0][2][2] = gCubies[2][2][2];
            gCubies[2][2][2] = gCubies[2][0][2];
            gCubies[2][0][2] = aCubie;
            aCubie                = gCubies[1][0][2];
            gCubies[1][0][2] = gCubies[0][1][2];
            gCubies[0][1][2] = gCubies[1][2][2];
            gCubies[1][2][2] = gCubies[2][1][2];
            gCubies[2][1][2] = aCubie;
         }
         break;
      }
      case kLeft:
      {
         if (direction == kClockwise)
         {
            aCubie                = gCubies[0][0][2];
            gCubies[0][0][2] = gCubies[0][2][2];
            gCubies[0][2][2] = gCubies[0][2][0];
            gCubies[0][2][0] = gCubies[0][0][0];
            gCubies[0][0][0] = aCubie;
            aCubie                = gCubies[0][0][1];
            gCubies[0][0][1] = gCubies[0][1][2];
            gCubies[0][1][2] = gCubies[0][2][1];
            gCubies[0][2][1] = gCubies[0][1][0];
            gCubies[0][1][0] = aCubie;
         }
         else
         {
            aCubie                = gCubies[0][2][2];
            gCubies[0][2][2] = gCubies[0][0][2];
            gCubies[0][0][2] = gCubies[0][0][0];
            gCubies[0][0][0] = gCubies[0][2][0];
            gCubies[0][2][0] = aCubie;
            aCubie                = gCubies[0][2][1];
            gCubies[0][2][1] = gCubies[0][1][2];
            gCubies[0][1][2] = gCubies[0][0][1];
            gCubies[0][0][1] = gCubies[0][1][0];
            gCubies[0][1][0] = aCubie;
         }
         break;
      }
      case kRight:
      {
         if (direction == kClockwise)
         {
            aCubie                = gCubies[2][2][2];
            gCubies[2][2][2] = gCubies[2][0][2];
            gCubies[2][0][2] = gCubies[2][0][0];
            gCubies[2][0][0] = gCubies[2][2][0];
            gCubies[2][2][0] = aCubie;
            aCubie                = gCubies[2][2][1];
            gCubies[2][2][1] = gCubies[2][1][2];
            gCubies[2][1][2] = gCubies[2][0][1];
            gCubies[2][0][1] = gCubies[2][1][0];
            gCubies[2][1][0] = aCubie;
         }
         else
         {
            aCubie                = gCubies[2][0][2];
            gCubies[2][0][2] = gCubies[2][2][2];
            gCubies[2][2][2] = gCubies[2][2][0];
            gCubies[2][2][0] = gCubies[2][0][0];
            gCubies[2][0][0] = aCubie;
            aCubie                = gCubies[2][0][1];
            gCubies[2][0][1] = gCubies[2][1][2];
            gCubies[2][1][2] = gCubies[2][2][1];
            gCubies[2][2][1] = gCubies[2][1][0];
            gCubies[2][1][0] = aCubie;
         }
         break;
      }
      case kUp:
      {
         if (direction == kClockwise)
         {
            aCubie                = gCubies[0][0][2];
            gCubies[0][0][2] = gCubies[0][0][0];
            gCubies[0][0][0] = gCubies[2][0][0];
            gCubies[2][0][0] = gCubies[2][0][2];
            gCubies[2][0][2] = aCubie;
            aCubie                = gCubies[1][0][2];
            gCubies[1][0][2] = gCubies[0][0][1];
            gCubies[0][0][1] = gCubies[1][0][0];
            gCubies[1][0][0] = gCubies[2][0][1];
            gCubies[2][0][1] = aCubie;
         }
         else
         {
            aCubie                = gCubies[2][0][2];
            gCubies[2][0][2] = gCubies[2][0][0];
            gCubies[2][0][0] = gCubies[0][0][0];
            gCubies[0][0][0] = gCubies[0][0][2];
            gCubies[0][0][2] = aCubie;
            aCubie                = gCubies[1][0][2];
            gCubies[1][0][2] = gCubies[2][0][1];
            gCubies[2][0][1] = gCubies[1][0][0];
            gCubies[1][0][0] = gCubies[0][0][1];
            gCubies[0][0][1] = aCubie;
         }
         break;
      }
      case kDown:
      {
         if (direction == kClockwise)
         {
            aCubie                = gCubies[2][2][2];
            gCubies[2][2][2] = gCubies[2][2][0];
            gCubies[2][2][0] = gCubies[0][2][0];
            gCubies[0][2][0] = gCubies[0][2][2];
            gCubies[0][2][2] = aCubie;
            aCubie                = gCubies[1][2][2];
            gCubies[1][2][2] = gCubies[2][2][1];
            gCubies[2][2][1] = gCubies[1][2][0];
            gCubies[1][2][0] = gCubies[0][2][1];
            gCubies[0][2][1] = aCubie;
         }
         else
         {
            aCubie                = gCubies[0][2][2];
            gCubies[0][2][2] = gCubies[0][2][0];
            gCubies[0][2][0] = gCubies[2][2][0];
            gCubies[2][2][0] = gCubies[2][2][2];
            gCubies[2][2][2] = aCubie;
            aCubie                = gCubies[1][2][2];
            gCubies[1][2][2] = gCubies[0][2][1];
            gCubies[0][2][1] = gCubies[1][2][0];
            gCubies[1][2][0] = gCubies[2][2][1];
            gCubies[2][2][1] = aCubie;
         }
         break;
      }
   }
}

void RotateCube(
  CubeAxis axis,
  TurnDirection direction,  
  short stepsToTurn
) {
   TQ3RotateAboutAxisTransformData aRotationdata;
   TQ3Matrix4x4   aCubeRotationMatrix, aTempMatrix;
   long i;
   
   // create a rotation object
   switch (axis)
   {
      case kFrontBack:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 0.0, -1.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 0.0, 1.0);
         break;
      }
      case kLeftRight:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 1.0, 0.0, 0.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, -1.0, 0.0, 0.0);
         break;
      }
      case kUpDown:
      {
         if (direction == kClockwise)
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, -1.0, 0.0);
         else
   Q3Vector3D_Set(&aRotationdata.orientation, 0.0, 1.0, 0.0);
         break;
      }
   }
   Q3Point3D_Set(&aRotationdata.origin, 0.0, 0.0, 0.0);
   aRotationdata.radians = 0.0;
   // the cube has been rotated, rotate the orientation of the rotation
   Q3MatrixTransform_Get(gCubeRotation, &aCubeRotationMatrix);
   Q3Vector3D_Transform(&aRotationdata.orientation, 
         &aCubeRotationMatrix, &aRotationdata.orientation);
   gTempCubeRotation = 
         Q3RotateAboutAxisTransform_New(&aRotationdata);
   // draw and adjust the angle
   for (i = 1; i < stepsToTurn; i++)
   {
      Q3RotateAboutAxisTransform_SetAngle(gTempCubeRotation, 
            (2.0 * kQ3Pi * i / gStepSize));
      DrawCube();
   }
   // set the angle to 90° and adjust the rotation object of the cube
   Q3RotateAboutAxisTransform_SetAngle(gTempCubeRotation, 
            (2.0 * kQ3Pi * stepsToTurn / gStepSize));
   Q3Transform_GetMatrix(gTempCubeRotation, &aTempMatrix);
   Q3MatrixTransform_Get(gCubeRotation, &aCubeRotationMatrix);
   Q3Matrix4x4_Multiply(&aCubeRotationMatrix, &aTempMatrix, 
            &aCubeRotationMatrix);
   Q3MatrixTransform_Set(gCubeRotation, &aCubeRotationMatrix);
   // don't need gTempCubeRotation anymore, dispose it
   if (gTempCubeRotation)
      Q3Object_Dispose(gTempCubeRotation);
   gTempCubeRotation = 0;
   DrawCube();
}

void TermCube(void) {
   long   x, y, z;

   Q3Object_Dispose(gView);
   Q3Object_Dispose(gCubeModel);   // object in the scene being modelled
   Q3Object_Dispose(gCubeRotation);
   for (x = 0; x < 3; x++)
      for (y = 0; y < 3; y++)
         for (z = 0; z < 3; z++)
         {
            if (gCubies[x][y][z])
               Q3Object_Dispose(gCubies[x][y][z]);            // object in the scene being modelled
         }
Q3Object_Dispose(gInterpolation);   // interpolation style used when rendering
   Q3Object_Dispose(gBackFacing);
         // whether to draw shapes that face away from the camera
   Q3Object_Dispose(gFillStyle);   
         // whether drawn as solid filled object or decomposed to components
   Q3Exit();
}
 
AAPL
$118.93
Apple Inc.
-0.07
MSFT
$47.81
Microsoft Corpora
+0.06
GOOG
$541.83
Google Inc.
+1.46

MacTech Search:
Community Search:

Software Updates via MacUpdate

Adobe Photoshop Elements 13.0 - Consumer...
Adobe Photoshop Elements 12--the #1 selling consumer photo editing software--helps you edit pictures with powerful, easy-to-use options and share them via print, the web, Facebook, and more.Version... Read more
Skype 7.2.0.412 - Voice-over-internet ph...
Skype allows you to talk to friends, family and co-workers across the Internet without the inconvenience of long distance telephone charges. Using peer-to-peer data transmission technology, Skype... Read more
HoudahSpot 3.9.6 - Advanced file search...
HoudahSpot is a powerful file search tool built upon MacOS X Spotlight. Spotlight unleashed Create detailed queries to locate the exact file you need Narrow down searches. Zero in on files Save... Read more
RapidWeaver 6.0.3 - Create template-base...
RapidWeaver is a next-generation Web design application to help you easily create professional-looking Web sites in minutes. No knowledge of complex code is required, RapidWeaver will take care of... Read more
iPhoto Library Manager 4.1.10 - Manage m...
iPhoto Library Manager lets you organize your photos into multiple iPhoto libraries. Separate your high school and college photos from your latest summer vacation pictures. Or keep some photo... Read more
iExplorer 3.5.1.9 - View and transfer al...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more
MacUpdate Desktop 6.0.3 - Discover and i...
MacUpdate Desktop 6 brings seamless 1-click installs and version updates to your Mac. With a free MacUpdate account and MacUpdate Desktop 6, Mac users can now install almost any Mac app on macupdate.... Read more
SteerMouse 4.2.2 - Powerful third-party...
SteerMouse is an advanced driver for USB and Bluetooth mice. It also supports Apple Mighty Mouse very well. SteerMouse can assign various functions to buttons that Apple's software does not allow,... Read more
iMazing 1.1 - Complete iOS device manage...
iMazing (was DiskAid) is the ultimate iOS device manager with capabilities far beyond what iTunes offers. With iMazing and your iOS device (iPhone, iPad, or iPod), you can: Copy music to and from... Read more
PopChar X 7.0 - Floating window shows av...
PopChar X helps you get the most out of your font collection. With its crystal-clear interface, PopChar X provides a frustration-free way to access any font's special characters. Expanded... Read more

Latest Forum Discussions

See All

Mystery Case Files: Dire Grove, Sacred G...
Mystery Case Files: Dire Grove, Sacred Grove HD Review By Jennifer Allen on November 28th, 2014 Our Rating: iPad Only App - Designed for the iPad A decent new installment for the popular Mystery Case Files series.   | Read more »
Castaway Paradise – Tips, Tricks, and St...
Ahoy there, castaways: Were you curious about our own thoughts regarding this pristine shipwreck? Check out our Castaway Paradise review! Castaway Paradise is out for iOS, finally giving mobile gamers the opportunity to enjoy the idyllic lifestyle... | Read more »
Castaway Paradise VIP Subs are on Sale f...
Castaway Paradise VIP Subs are on Sale for a Limited Time, and a Special Holiday Update is Coming Soon Posted by Rob Rich on November 28th, 2014 [ | Read more »
Primitive Review
Primitive Review By Jordan Minor on November 28th, 2014 Our Rating: :: FOLK ARTUniversal App - Designed for iPhone and iPad True to its name, Primitive is about as straightforward as runners get.   | Read more »
7 tips to get ahead of the competition i...
7 tips to get ahead of the competition in Dynasty of Dungeons Posted by Simon Reed on November 28th, 2014 [ permalink ] Playcrab has launched their action-packed new dungeon crawler, Dynasty of Dungeons, today. | Read more »
Master of Tea Kung Fu Review
Master of Tea Kung Fu Review By Jordan Minor on November 28th, 2014 Our Rating: :: ONE DROP RULESUniversal App - Designed for iPhone and iPad Master of Tea Kung Fu is a creative and complex caffeinated brawler.   | Read more »
Monster Strike Review
Monster Strike Review By Campbell Bird on November 28th, 2014 Our Rating: :: BILLIARD STRATEGYUniversal App - Designed for iPhone and iPad Collect monsters and battle by flinging them across the battlefield in this strangely... | Read more »
Proun+ Review
Proun+ Review By Jennifer Allen on November 28th, 2014 Our Rating: :: TWITCHY RACINGUniversal App - Designed for iPhone and iPad Twitchy racing aplenty in Proun+, an enjoyably tricky title.   | Read more »
Lucha Amigos (Games)
Lucha Amigos 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Forget Ninja Turtles, and meet Wrestlers Turtles! Crazier, Spicier and…Bouncier! Sling carapaces of 7 Luchadores to knock all... | Read more »
Record of Agarest War Zero (Games)
Record of Agarest War Zero 1.0 Device: iOS Universal Category: Games Price: $7.99, Version: 1.0 (iTunes) Description: HyperDevbox Holiday Turkey Black Friday Special Pricing! To celebrate the opening of the holiday season HyperDevbox... | Read more »

Price Scanner via MacPrices.net

Best Black Friday Deal: 15-inch Retina MacBoo...
 B&H Photo has the new 2014 15″ Retina MacBook Pros on sale for $300 off MSRP as part of their Black Friday sale. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.2GHz Retina... Read more
Up To 75% Off Infovole Text Apps Over Black F...
Infovole’s entire range of apps, including the Textkraft family of word processors for iPads and iPhones, is being offered at 50-75% off over the Black Friday and Cyber Monday weekend. The five-day... Read more
Black Friday: Up to $60 off Mac minis, NY tax...
 B&H Photo has new 2014 Mac minis on sale for up to $60 off MSRP as part of their Black Friday sale. Shipping is free, and B&H charges NY sales tax only: - 1.4GHz Mac mini: $449.99 $50 off... Read more
Black Friday: 27-inch 5K iMac for $2299, save...
 B&H Photo continues to offer Black Friday sale prices on the 27″ 3.5GHz 5K iMac, in stock today and on sale for $2299 including free shipping plus NY sales tax only. Their price is $200 off MSRP... Read more
Karalux Announces 24K Gold-Plated iPhone 6
Karalux, a Vietnam-based jewellery firm, has launched a unique 24 karat gold-plated iPhone 6 version with gold-cast monolithic dragon on its back panel. The real 24 karat gold plated enclosure doesn’... Read more
Black Friday: 13-inch 2.6GHz Retina MacBook P...
 B&H Photo has lowered their price for the 13″ 2.6GHz/128GB Retina MacBook Pro to $1159 for Black Friday. That’s $140 off MSRP, and it’s the lowest price for this model (except for Apple’s $1099... Read more
View all the Black Friday sales on our Mac Pr...
We’ve updated our Mac Price Trackers with the latest information on prices, bundles, and availability on systems from Apple’s authorized internet/catalog resellers. View Black Friday sale prices at a... Read more
Black Friday: 11-inch MacBook Air for $779, s...
 Best Buy has lowered their price for the 2014 11″ 1.4GHz/128GB MacBook Air to $779.99 for Black Friday. That’s $120 off MSRP. Choose free shipping or free local store pickup (if available). Sale... Read more
Apple Store Black Friday sale for 2014: $100...
BLACK FRIDAY The Apple Store has posted their Black Friday deals for 2014. Receive a $100 PRODUCT(RED) branded iTunes gift card with the purchase of select Macs, $50 with iPads, and $25 with iPods,... Read more
Black Friday: 15% off iTunes Gift Cards
Staples is offering 15% off $50 and $100 iTunes Gift Cards on their online store as part of their Black Friday sale. Click here for more information. Shipping is free. Best Buy is offering $100... Read more

Jobs Board

*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.