TweetFollow Us on Twitter

Sep 01 Challenge

Volume Number: 17 (2001)
Issue Number: 09
Column Tag: Programmer's Challenge

by Bob Boonstra, Westford, MA


Perhaps you remember Nassi-Schneiderman diagrams as an alternative to traditional flow charts. Or perhaps you remember them as Chapin Charts. Whether you remember them or not, it's time to dig out those old computer science textbooks and bone up, because this month we're going to be drawing some of them.

There is no prototype for this Challenge, because you are going to build a complete Macintosh application. The basic requirement is that you open a text file containing valid C/C++ source code and generate a Nassi-Schneiderman diagram for each routine included in that file. To do that, you will need to provide menu options to open a file, allowing the user to navigate through the file system to select a file. You should parse the source code and open a window for each routine, drawing in the window the diagram that describes the program logic. The user must be allowed to move and resize the windows, and you should draw the diagram at a level of detail that fits into the window as sized by the user. You must provide a means for the user to select a section of the diagram, or click on a section of interest, and zoom in on that section. The zoomed-in display should increase the level of detail displayed, until no further increase in detail is possible. Your code must allow the user to switch to another application, and must properly update the window contents when appropriate.

A Nassi-Schneiderman diagram consists of four simple block types: an instruction block, an alternative (e.g., if-then-else) block, a multiple choice (e.g., switch) block, and an iteration (e.g., do ... while) block.

The instruction block is simply a block with code inside:

The alternative block looks like this:

The multiple choice block looks like this:

And the loop block:

Normally, these diagrams would contain pseudo-code that describes the intent of the actual code. Obviously, we won't have pseudo-code available, so you'll have to display something based on the code itself. Exactly what you display is at your discretion, but it should provide enough information so that you can identify the code associated with a block in the source file, subject to screen real estate limitations.

In creating the diagrams, you are encouraged to provide the user with additional features. For example, you might allow the user to change the text font and text size, and then adjust the text in the diagram if more or less text fits inside the boxes. You might provide a Window menu with the name of each diagrammed routine. You might provide an option to bring up the full text of a block inside a window. You can provide keyboard shortcuts or use modifier keys to implement special options. You might add a magnification capability that adds scroll bars to the window (in addition to the required zoom feature). You can add preference settings that make sense for your application. There might be a useful way to use color.

In the event the code contains a construct that cannot reasonably be diagramed (e.g., a goto statement), you should highlight the associated block in the diagram in some way and treat the offending construct as a no-op.

This will be a native PowerPC Challenge, using the latest version of CodeWarrior, or the development environment of your choice (provided I have a copy - email to check before you use something else). You can develop for Mac OS 9 or Mac OS X. Evaluation of your entry will be subjective, based first on the required features, then on optional features, and finally on general usability and look-and-feel. To ensure that I fairly evaluate your solution, you should include in your submission a list of any optional features you incorporated.

Three Months Ago Winner

After a Challenge absence of more than three years, Jeff Mallett (Boulder Creek, CA) returns to take first place in the June Dots Challenge. The object of this Challenge was to win a round-robin tournament of the game Dots (or Dots and Boxes). Dots is played on an NxN grid where players take turns connecting adjacent dots horizontally and vertically to enclose boxes. The player capturing the most boxes wins the game. The Challenge was actually scored based on minimizing the number of boxes captured by the opposing player, incorporating the usual efficiency requirement by adding a penalty of 1% for each millisecond of execution time. Solutions were also required to display the game state and the current score after each move.

Jeff maintains four doubly-linked lists of boxes in gList, one list for boxes with 0 edges (0-boxes), another for boxes with 1 edge (1-boxes), etc. He also maintains a data structure called a 2-path (TwoPathRecordType), which is a sequence of connected boxes each of which has two or three existing edges (2-boxes or 3-boxes, respectively).

The heavy lifting is done in the ComputerTurn routine, and I'll try to describe the logic. If there are no 3-boxes, the code looks to see if all unfilled boxes are 2-boxes. If so, any move is going to give a box to the opponent, so Jeff picks the move that gives the minimum away to the opponent. Otherwise, he selects a 0-box, or (as a second choice) a 1-box, provided it is "safe", where an "unsafe" box is one for which adding an edge creates a 3-box.

If there are 3-boxes, and there are safe places to move next, Jeff takes the 3-box and plays again. If the open edge of the 3-box is at the board boundary, he takes the box. Otherwise, he takes as many 3-boxes as he can while saving the moves that give the opponent a square ("handouts"). If a move that gives a handout captures half or more of the remaining boxes, Jeff makes that move. And finally, if forced, he makes a move that gives the opponent the smallest sequence of boxes.

As the comments in Jeff's code indicate, his solution is actually based on 15-year-old code, translated from Pascal into C/C++ for the Challenge. Jeff mentions that the time penalty in the problem caused him to significantly "dumb down" the program, removing enough of the look-ahead code to make it a fast, if mediocre, player.

The second-place entry, from Greg Sadetsky, is based (with permission) on a JavaScript program by UCLA Professor Thomas S. Ferguson. In addition to providing some very entertaining commentary that I wish we had the space to publish, Greg included the URL for the JavaScript code (, as well as a page of links to other analyses of the game (

The table below lists, for each of the solutions submitted, the number of cells captured by each solution in the tournament, the number of cells captured by the opposing player, the execution time in milliseconds, and the score earned by each solution (with lower scores being better). The table also includes the code and data size for each solution, and the programming language used. As usual, the number in parentheses after the entrant's name is the total number of Challenge points earned in all Challenges prior to this one.

Name Player Opponent Time
Cells Cells (msec)
Jeff Mallett (94) 3218 1362 833.7
Greg Sadetsky (14) 3128 1452 1566.6
Ernst Munter (751) 2529 2010 721.4
Tom Saxton (185) 1914 2666 3262.5
Randy Boring (142) 668 3422 53118.1
T. R. 1752 2297 367.1
Name Score Code Data Lang
Jeff Mallett 2061.5 11572 908 C++
Greg Sadetsky 2753.8 17192 1936 C
Ernst Munter 3009.9 10684 586 C++
Tom Saxton 8777.5 7220 581 C++
Randy Boring 145423.8 17676 498 C
T. R. 2962.6 5188 307 C++

Top Contestants ...

Listed here are the Top Contestants for the Programmer's Challenge, including everyone who has accumulated 20 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 Wins Total
(24 mo) (24 mo) Points
1. Munter, Ernst 271 10 758
2. Rieken, Willeke 73 3 134
3. Saxton, Tom 71 2 189
4. Taylor, Jonathan 56 2 56
5. Wihlborg, Claes 49 2 49
6. Shearer, Rob 48 1 62
7. Maurer, Sebastian 38 1 108
10. Mallett, Jeff 20 1 114
11. Truskier, Peter 20 1 20

... and the Top Contestants Looking for a Recent Win

In order to give some recognition to other participants in the Challenge, we also list the high scores for contestants who have accumulated points without taking first place in a Challenge during the past two years. Listed here are all of those contestants who have accumulated 6 or more points during the past two years.

Rank Name Points Total
(24 mo) Points
8. Boring, Randy 32 144
9. Sadetsky, Gregory 22 24
12. Schotsman, Jan 14 14
13. Nepsund, Ronald 10 57
14. Day, Mark 10 30
15. Jones, Dennis 10 22
16. Downs, Andrew 10 12
17. Desch, Noah 10 10
18. Duga, Brady 10 10
19. Fazekas, Miklos 10 10
20. Flowers, Sue 10 10
21. Strout, Joe 10 10
22. Nicolle, Ludovic 7 55
23. Hala, Ladislav 7 7
24. Leshner, Will 7 7
25. Miller, Mike 7 7
26. Widyatama, Yudhi 7 7
27. Heithcock, JG 6 43

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 Jeff's winning Boxes solution:

Copyright © 1986-2001
Jeff Mallett

// Dots & Boxes
// Copyright 1986-2001 Jeff Mallett.  All rights reserved.
// For licensing contact
// Written in Lightspeed Pascal for the Mac 
//    Last revision in Pascal: Oct 14, 1986
// Ported from Pascal to C/C++ and adapted for contest: May-June 2001
//    (It uses inline/new/delete/template/etc., but it's really more C
//    than C++ since there are no classes.  If I had more time I would
//    have converted it to be object-oriented as well.)
// Programmer's Challenge Entry
// This version does not play Dots & Boxes completely naively — e.g.
//    it understands the sacrificing boxes to keep the initiative — but
//    neither does it play very skillfully.  This is because the 
//    challenge awards points based on boxes and time taken, not 
//    on who actually wins the games.  As penalties are awarded 
//    for every millisecond of thinking, a quick mediocre player is
//    likely to gain more points than a slow master.  Therefore I 
//    dumbed down the program considerably by ripping out code that 
//    determined how to correctly play networks of 1-boxes 
//    connected with 2-paths of length 1 or 2.  Now the program 
//    doesn't have a clue what to do with unsafe 1-boxes and never 
//    sacrifices boxes early in the game, but it also saves a 
//    lot of processing time.

#define DRAWING

#define TICKSEED LMGetTicks()
#define ASSERT assert


#include "Dots.h"


enum direction {left=0, up, right, down};
enum who {firstplayer=0, secondplayer};
enum pathdirection {behind=0, ahead};
// BORDER_VALUE: box is off the board
// MARK_VALUE: when calculating a path, a box with this value is already on it
enum boxflag {BORDER_VALUE=-2, MARK_VALUE=-1, NO_VALUE=0};
// NOT_LOOP: 2-path has two ends
// ALMOST_LOOP: 2-path's ends terminate at the same 0-box or 1-box
// LOOP: 2-path has no ends
enum loopvalue {NOT_LOOP=0, ALMOST_LOOP, LOOP};

typedef struct BoxRecordType* PtrToBoxRecord;
typedef struct TwoPathRecordType* PtrToTwoPathRecord;

struct TwoPathRecordType {
   int pathsize;
   loopvalue loop;                
   PtrToBoxRecord path;
   PtrToTwoPathRecord previous, next;

struct BoxRecordType {
   short xcoord, ycoord;         // Location of box
   short edgecount;            // Number of edges
   Boolean edges[4];         // Is there an edge in this direction?
   PtrToBoxRecord previous, next;
                                             // previous & next elements in gList[]
   boxflag flag;                  // Used for marking borders and searched boxes
// 2-path info
   PtrToTwoPathRecord twopath;   // the 2-path this is in
   PtrToBoxRecord pnext[2];      // the two connecting boxes in the 2-path

struct MoveRecordType {
   PtrToBoxRecord box;
   direction dir;

PtrToBoxRecord gBoxes;      // Array holding all the boxes
int gArraySizeY;         // Array width of gBoxes
int gBoardSizeX, gBoardSizeY;// Size of the board in boxes across and down
PtrToBoxRecord gList[4];   // Pointers to doubly-linked lists of n-edge boxes
PtrToBoxRecord gListBookmark[2];
          // Next box on gList[n] to look at for a safe move
int gOffset[4];            // Offset in gBoxes for going this direction

PtrToTwoPathRecord gTwoPaths[3];// Pointers to a doubly-linked lists of 2-paths
                        // [0]:length > 2  [1]:length 1  [2]:length 2
Boolean gPathsComputed;      // Have the 2-paths ever been recorded in gTwoPaths?

Boolean gSafe[2];      
               // Is there a move on an n-box that doesn't give the opponent a 3-box?
Boolean gSafetyCheckNeeded;   
               // Need to check whether position has become dangerous?
PtrToBoxRecord gLastSafeBox[2];// The most recent box found safe on list n

int gScore[2];            // gScore[w] is the # of boxes player w has completed
int gTotalScore;         // The sum of the two player's score
int gMaxScore;            // The maximum possible value of gTotalScore
who gCurrentPlayer;         // The current player

#define EVEN(x)               (((x) & 1) == 0)
#define ODD(x)                  (((x) & 1) != 0)

#define EDGE(x,y,d)           gBoxes[x*gArraySizeY + y].edges[d]
#define BOX(x,y)               (&gBoxes[x*gArraySizeY + y])

#define FOR_LIST(pList, whichList)  for (pList = gList[whichList]; pList; pList = pList->next)

#define FOR_LIST2(pList, whichList, start) \
   if (gList[whichList]) { \
      if (!start || NumberOfEdges(start) != whichList) \
         start = gList[whichList]; \
      pList = start; do {

#define END_FOR_LIST2(pList, whichList, start) \
         pList = pList->next; \
         if (!pList) pList = gList[whichList]; \
      } while (pList != start); \

{ direction f_dir = left; const Boolean *pEdges = (box)->edges; \
   do { \
      if ( !*(pEdges + (f_dir)) ) { \
         PtrToBoxRecord f_box = Go(box, f_dir);
      } \
   } while ((f_dir = (direction)(f_dir+1)) <= down); \

#define   FOR_PATHDIRECTION(pdir)      pdir = behind; do
#define   END_FOR_PATHDIRECTION(pdir)   while ((pdir = (pathdirection)(pdir+1)) <= ahead);

#ifdef DRAWING
extern void DrawInitial(int x, int y, who person);
extern void DrawScore(who w);
extern void DrawMove(int x, int y, enum direction d);
extern void InitialDrawing();

void Initialize();

void CheckSafety(int listindex);
void Clear(PtrToBoxRecord box);
void ComputeAPath(PtrToBoxRecord posinedgelist, PtrToTwoPathRecord existingtwopath);
void ComputePaths();
void UpdatePathFrom(PtrToBoxRecord box);
void AddEdge(PtrToBoxRecord box, direction d, who whoseturn);
int ExpectedScore(PtrToTwoPathRecord ignoreThis);
int CountTinyTwoPaths( );
int CountSurroundingPathSizes(PtrToBoxRecord box);
PtrToTwoPathRecord MinimumTwoPath();
void HandOut(int hotype, MoveRecordType &move);
direction HardHeartedHandout(PtrToBoxRecord box);
Boolean FindSafeMoveOnList(int listindex, MoveRecordType &move);
void ComputerTurn(MoveRecordType &move);
Boolean MakeRealMove(MoveRecordType move, who whoseturn);
void ConvertFromDotLine(MoveRecordType &move, const DotLine &dotline);
void ConvertToDotLine(MoveRecordType move, DotLine &dotline);

// Returns X coordinate value for the box
inline int GetX (PtrToBoxRecord box) {
   return box->xcoord;
   return (box - gBoxes) / gArraySizeY;

// Returns Y coordinate value for the box
inline int GetY (PtrToBoxRecord box) {
   return box->ycoord;
   int dindex = box - gBoxes;
   int xcoord = dindex / gArraySizeY;
   return dindex - xcoord * gArraySizeY;

// Returns the box in direction dir
inline PtrToBoxRecord Go (PtrToBoxRecord box, direction dir) {
   return box + gOffset[dir];

// Returns the opposite path direction to the given path direction
inline pathdirection OppositePathDirection (pathdirection pathdir) {
   return (pathdirection) (1 - pathdir);

// Returns the direction opposite to the given direction
inline direction OppositeDirection (direction dir) {
   return (direction) ((dir+2)%4);

// Returns the next direction in a clockwise fashion
inline direction NextDirection (direction dir) {
   return (dir == down) ? left : (direction) (dir + 1);

// Goes to the next player
inline void NextPlayer (who &whoseturn) {
   whoseturn = (who) (1 - whoseturn);

// Produces a random number between 0 and n-1 inclusive
inline int rnd (int n) {
   return ((long)rand() * n) / ((long)RAND_MAX + 1);

// Returns a direction chosen at random (or at least different)
inline direction RandomDirection () {
   return (direction) (rand() & 3);

// Given a 3-box on a 2-path, returns the path direction out of the 3-box
inline pathdirection OutPathDirection (PtrToBoxRecord box) {   
   return box->pnext[ahead] ? ahead : behind;

// Returns true iff the box is within the boundaries.
inline Boolean IsInsideBoard (PtrToBoxRecord box) {
   return box->flag != BORDER_VALUE;

// Returns a direction randomly such that !box->edges[d]
inline direction GetOpenDirection (PtrToBoxRecord box) {
   // cycle through directions starting at random direction dir
   direction d = RandomDirection();
   const Boolean *p = box->edges;
   while (*(p+d)) 
      d = NextDirection(d);
   return d;

// Sets up a move from box in a random direction with no edge
inline void PlayAny (PtrToBoxRecord box, MoveRecordType &move) { = box;
   move.dir = GetOpenDirection(box);

// Plays a move on the path p
inline void PlayMoveOnPath(PtrToTwoPathRecord p, MoveRecordType &move) { = p->path;
   move.dir = (p->pathsize == 2) ?
            HardHeartedHandout( : GetOpenDirection(;

// Returns whether or not boxes a and b are connected
inline Boolean AreConnected(PtrToBoxRecord a, PtrToBoxRecord b) {
      if (f_box == b)
         return true;
   return false;

// Returns the number of edges of the box
inline int NumberOfEdges (PtrToBoxRecord box) {
   return box->edgecount;
   int count = 0;
   Boolean *p = box->edges;
   if (*(p++)) ++count;
   if (*(p++)) ++count;
   if (*(p++)) ++count;
   if (*p)     ++count;
   return count;

// Adds the element to the beginning of the given list
template<class T> void AddToList(T element, T &list) {
   element->previous = NULL;
   element->next = list;
   list = element;
   if (element->next) 
      element->next->previous = element;

// Removes the element from the given list
template<class T> void RemoveFromList(T element, T &list) {
   if (element->previous) 
      element->previous->next = element->next;
      list = element->next;
   if (element->next) 
      element->next->previous = element->previous;

// Inserts toinsert into the list after the onlist box
// Note: toinsert must not be on a list currently
template<class T> void InsertAfter(T toinsert, T onlist) {
   if (onlist->next)
      onlist->next->previous = toinsert;
   toinsert->next = onlist->next;
   onlist->next = toinsert;
   toinsert->previous = onlist;

// Adds path to the front of the appropriate gTwoPaths list
inline void AddToPathsList(PtrToTwoPathRecord path) {
   AddToList(path, gTwoPaths[path->pathsize <= 2 ? path->pathsize : 0]);

// Removes path from the appropriate gTwoPaths list
inline void RemoveFromPathsList(PtrToTwoPathRecord path) {
   RemoveFromList(path, gTwoPaths[path->pathsize <= 2 ? path->pathsize : 0]);

// Sets up variables for a game.
void Initialize()
   int i, j;
   int arraySizeX, arrayElements;

   arraySizeX = gBoardSizeX + 2; // borders on each side
   gArraySizeY = gBoardSizeY + 2;
   arrayElements = arraySizeX * gArraySizeY;
   gBoxes = new BoxRecordType [arrayElements];

   gOffset[left]  = -gArraySizeY;
   gOffset[up]    = -1;
   gOffset[right] = gArraySizeY;
   gOffset[down]  = 1;

   PtrToBoxRecord p = gBoxes;
   for (i = 0; i < arraySizeX; i++)
      for (j = 0; j < gArraySizeY; j++)
         p->edges[left]  = p->edges[up] = p->edges[right] = 
                        p->edges[down] = false;
         p->flag = BORDER_VALUE;
         p->pnext[ahead] = p->pnext[behind] = NULL;
         p->twopath = NULL;
         p->xcoord = i; p->ycoord = j;
         p->edgecount = 0;

   gList[0] = BOX(1,1);
   gList[0]->previous = NULL;

   for (i = 1; i <= 3; i ++)
      gList[i] = NULL;

   PtrToBoxRecord last = NULL;
   for (i = 1; i <= gBoardSizeX; i++)
      p = BOX(i, 1);
      for(j = 1; j <= gBoardSizeY; j++)
         p->flag = NO_VALUE;
         if (last)
            last->next = p;
            p->previous = last;
         last = p;
   last->next = NULL;

   // Mix up list elements randomly
    for (i = gBoardSizeX; i >= 1; i —)
      for (j = 1; j <= gBoardSizeY; j ++)
         int i2 = rnd(gBoardSizeX)+1;
         int j2 = rnd(gBoardSizeY)+1;
         if (i!=i2 || j!=j2)
            RemoveFromList(BOX(i, j), gList[0]);
            InsertAfter(BOX(i, j), BOX(i2, j2));

   gSafe[0] = gSafe[1] = true;
   gPathsComputed = gSafetyCheckNeeded = false;
   gMaxScore = gBoardSizeX * gBoardSizeY;
   gTotalScore = gScore[firstplayer] = gScore[secondplayer] = 0;
   gListBookmark[0] = gListBookmark[1] =
      gLastSafeBox[0] = gLastSafeBox[1] = NULL;
}   // Initialize


// Re-evaluates gSafe
// If we can't add an edge to a 0-box or 1-box without changing
//  a 2-box into a 3-box set gSafe[listindex]=false
void CheckSafety(int listindex) {
   // Optimization: Check the box that was found safe last time
   if (gLastSafeBox[listindex])
      if (NumberOfEdges(gLastSafeBox[listindex]) <= 1)
            if (NumberOfEdges(f_box) != 2)
               return; // safe
      gLastSafeBox[listindex] = NULL;

    // Check 0 and 1 lists
   PtrToBoxRecord box;
   FOR_LIST(box, listindex)
   {     // Check a box on list
         if (NumberOfEdges(f_box) != 2)
            gLastSafeBox[listindex] = box;

   gSafe[listindex] = false; // unsafe
}   // CheckSafety

// Initializes/Reinitializes the path data for a single record
void Clear (PtrToBoxRecord box) {

   PtrToTwoPathRecord p = box->twopath;
   if (p)
      if (!—p->pathsize)
      {  // Box is only thing on twopath
         delete p;
      } else
         if (p->path == box)
            p->path = box->pnext[ahead];
         pathdirection pdir = OutPathDirection(box);
         box->pnext[pdir]->pnext[OppositePathDirection(pdir)] = NULL;
      box->twopath = NULL;
      box->pnext[ahead] = box->pnext[behind] = NULL;
}   // Clear

// Given a 2-box or a 3-box, computes the path from that box
void ComputeAPath (PtrToBoxRecord posinedgelist, PtrToTwoPathRecord existingtwopath) {
   Boolean pathend;
   PtrToBoxRecord temp;
   pathdirection pdir;
   int pathlength = -1;      // set to -1 because posinedge is counted twice
   PtrToBoxRecord end[2], beyondend[2];
   beyondend[ahead] = beyondend[behind] = NULL;
   loopvalue loop = NOT_LOOP;
   PtrToTwoPathRecord twopath;
   if (existingtwopath)
      twopath = existingtwopath;
   } else
      twopath = new TwoPathRecordType;

   {     // each iteration moves to the end of the path in the behind/ahead direction
      temp = posinedgelist;
      do {   // each iteration marks one more square in the path
         temp->flag = MARK_VALUE;
         temp->twopath = twopath;
         pathend = true;
         // check for a continuation of the path in the pdir direction
         {   // each iteration checks one direction for an adjoining 2/3-square
            // don't need to check if f_box inside board because borders have 
            // BORDER_VALUE
            if (!f_box->flag) 
            {     // found square next to current square that hasn't been marked
               int n = NumberOfEdges(f_box);
               if (n >= 2)
                  // include this square in path
                  temp->pnext[pdir] = f_box;
                  f_box->pnext[OppositePathDirection(pdir)] = temp;
                  temp = f_box;
                  if (n == 2)
                     pathend = false;
                  else // n == 3
                  {  // f_box is on path so add it, but don't look further
                     temp->flag = MARK_VALUE;
                     temp->twopath = twopath;
               // n < 2
               if ( pdir == ahead || temp != posinedgelist )
                  beyondend[pdir] = f_box;
         // Either all directions have been looked at or a path continuation has 
         // been found
      } while (!pathend);
      temp->pnext[pdir] = NULL;
      end[pdir] = temp;

   // Clear flags
   for (temp = end[ahead]; temp; temp = temp->pnext[behind])
      temp->flag = NO_VALUE;

   // Is a loop or near loop?
   if (pathlength > 2)
      if (beyondend[ahead] && beyondend[ahead] == beyondend[behind])
         loop = ALMOST_LOOP;
      else if (AreConnected(end[ahead], end[behind]))
         loop = LOOP;

   twopath->pathsize = pathlength;
   twopath->loop = loop;
   twopath->path = end[behind];

}   // ComputeAPath

// Finds all 2-paths and stores them by forming a doubly-linked list for each path
void ComputePaths() {
   PtrToBoxRecord posinedgelist;
   FOR_LIST(posinedgelist, 2)
      if (!posinedgelist->twopath) 
         ComputeAPath(posinedgelist, NULL); 
               // Compute path containing this element
   gPathsComputed = true;
}   // ComputePaths

// Updates the paths that the newly changed box was in if needed
void UpdatePathFrom (PtrToBoxRecord box) {
   int count;
   // Update path lists
   count = NumberOfEdges(box);
   if (count == 4) 
   else if (count == 2)
      // Could be added to a 2-path
      PtrToTwoPathRecord twopath = NULL;
         if (f_box->twopath)
            if (!twopath)
               twopath = f_box->twopath; // Recalculate this 2-path
            else if (f_box->twopath != twopath)
            {  // Combining two 2-paths
      ComputeAPath(box, twopath);
   else if (count == 3 &&
         !(box->twopath && box->twopath->pathsize == 1)) 
            // don't need to update a length 1 path
      ComputeAPath(box, box->twopath);
}         // UpdatePathFrom

// Adds an edge to box at x,y and direction d.  If the edge completes a square 
// update score, etc.
// If safe might need to be changed then checkneeded will be set to true.
void AddEdge (PtrToBoxRecord box, direction d, who whoseturn) {
   box->edges[d] = true;

   if (!IsInsideBoard(box))

   int count = NumberOfEdges(box);
   if (count == 4)
#ifdef DRAWING
      DrawInitial(GetX(box), GetY(box), whoseturn);
      RemoveFromList(box, gList[3]); // Take box off of old edge list
      // Don't bother putting it on gList[4]
      RemoveFromList(box, gList[count-1]); // Take box off of old edge list
      AddToList(box, gList[count]); // Add box to the beginning of a new list
      if (count == 2) 
         gSafetyCheckNeeded = true;
}   // AddEdge

// Return estimate of the number of boxes we'll capture
int ExpectedScore(PtrToTwoPathRecord ignoreThis) {


   int expected, tinycount1, tinycount2, loopcount[3];
   loopcount[NOT_LOOP] = loopcount[ALMOST_LOOP] = 
               loopcount[LOOP] =   tinycount1 = tinycount2 = expected = 0;

   // Count
   PtrToTwoPathRecord p;
   for (p = gTwoPaths[1]; p; p = p->next)
   for (p = gTwoPaths[2]; p; p = p->next)
   for (p = gTwoPaths[0]; p; p = p->next)
      expected += p->pathsize; // Add boxes for 2-paths

   // Subtract out ignoreThis
   if (ignoreThis->pathsize == 1)
   else if (ignoreThis->pathsize == 2)
   else {
      expected -= ignoreThis->pathsize;

   if (loopcount[NOT_LOOP] || loopcount[ALMOST_LOOP] || 
      // Subtract handouts
      expected -= loopcount[NOT_LOOP] * 2;
      expected -= loopcount[ALMOST_LOOP] * 3;
      expected -= loopcount[LOOP] * 4;

      // but disregard final handout
      expected += loopcount[NOT_LOOP] ? 2 : 4;

   // Add boxes for tiny 2-paths
   expected += tinycount1/2 + 2 * (tinycount2/2);
          // Get half of each rounded down
   if (ODD(tinycount1) && ODD(tinycount2))
      expected += 2; // Get last [2], e.g. 1 [1] and 1 [2]

   return expected;
}   // ExpectedScore

// Counts length=1 2-paths and length=2 2-paths (no 3's).
int CountTinyTwoPaths ( ) {
   int count = 0;

   PtrToTwoPathRecord p;
   for (p = gTwoPaths[1]; p; p = p->next)
      if (NumberOfEdges(p->path) == 2)
   for (p = gTwoPaths[2]; p; p = p->next)
      if (NumberOfEdges(p->path) == 2 &&
            NumberOfEdges(p->path->pnext[ahead]) == 2)

   return count;
}   // CountTinyTwoPaths

// Returns the number of boxes on all the surrounding
// 2-paths.  (Some may be counted more than once.)
int CountSurroundingPathSizes(PtrToBoxRecord box) {

   int count = 0;
      if (f_box->twopath)
         count += f_box->twopath->pathsize;
   return count;
}   // CountSurroundingPathSizes

// Returns the smallest 2-path.
PtrToTwoPathRecord MinimumTwoPath () {

   if (! gPathsComputed) 

   int minvalue = INT_MAX;
   PtrToTwoPathRecord min,   p;
   if (gTwoPaths[1])
      return gTwoPaths[1];

   if (gTwoPaths[2])
      return gTwoPaths[2];

   for (p = gTwoPaths[0]; p; p = p->next)
      int size = p->pathsize;
      if (p->loop != LOOP)
         size += 3; // Penalize 2 since only only get a 2-handout instead of a 4-handout
         // Also give 1 penalty since we'd much rather be left with non-loop
         // than a loop at the very end, because we won't get the last handout.

         if (p->loop == ALMOST_LOOP && size < minvalue)
            PtrToBoxRecord box = p->path;
               if (NumberOfEdges(f_box) == 1)
                  // f_box is connected to both edges of this 2-path
                  // plus one other 2-path.  Filling in this 2-path
                  // will cause the two 2-paths to be connected, so
                  // the size should be calculated as the total of
                  // both paths + 1 for the 1-box + 3 for the penalty
                  // (size is subtracted because the almost loop is
                  //  counted twice)
                  size = 4 + CountSurroundingPathSizes(f_box) - size;

      if (size < minvalue)
         minvalue = size;
         min = p;
         if (size == 3)

   return min;
}   // MinimumTwoPath

// Given a HandOut type (either 2 or 4) and that every box on the 3's list is
//    either a 2 or hand out, HandOut finds a hand out of the indicated type in
//    the 3's list and sets move to do this hand out.
void HandOut (int ho_type, MoveRecordType &move) {
   PtrToBoxRecord temp;
   pathdirection pdir;
   FOR_LIST(temp, 3)
      if (temp->twopath->pathsize == ho_type) 
      {    // HandOut
         pdir = OutPathDirection(temp); = temp->pnext[pdir];
            if (!IsInsideBoard(f_box) || temp != f_box)
               move.dir = f_dir;
      }   // if
}   // HandOut

// Given a 2-box on a 2-path of length two, returns the
//    correct direction that a new edge should be placed.
direction HardHeartedHandout (PtrToBoxRecord box) {
      if (NumberOfEdges(f_box) == 2) 
         return f_dir;
   ASSERT(0); // should never get here
   return left;
}   // HardHeartedHandout

// Tries to find a safe move on gList[listindex]
// If so, set move and return true
// If not, these boxes are now unsafe.  Return false
Boolean FindSafeMoveOnList(int listindex, MoveRecordType &move) {

   PtrToBoxRecord box;

   // If any legal adjacent element is !=2 or outside board, take it
   FOR_LIST2(box, listindex, gListBookmark[listindex])
      direction k, d;
      d = k = RandomDirection();
      do {
         if (!box->edges[d]) 
            PtrToBoxRecord box2 = Go(box, d);
            if (!IsInsideBoard(box2) || NumberOfEdges(box2) != 2) 
               gListBookmark[listindex] = box->next;
      = box;
               move.dir = d;
               return true;
         d = NextDirection(d);
      } while (d != k);
   } END_FOR_LIST2(box, listindex, gListBookmark[listindex])

   gSafe[listindex] = false;
   return false;
}   // FindSafeMoveOnList

// Come up with a move for the computer
void ComputerTurn(MoveRecordType &move) {

   PtrToBoxRecord temp;

   // generate computer's move
   if (!gList[3]) 
      if (!gList[0] && !gList[1]) 
      {    // must pick a 2-box from a 2-path
         PlayMoveOnPath(MinimumTwoPath(), move);
      //   (gList[0]!=NULL or gList[1]!=NULL) and !gList[3]  

      // Try safe boxes on lists
      if (gSafe[0] && FindSafeMoveOnList(0, move))
      if (gSafe[1] && FindSafeMoveOnList(1, move))

      // All bad choices: all 0's and 1's are adjacent to 2's
      if (!gPathsComputed) 

      // now count how many 2's in a row— if one, take it
      //  — if two, take it (put | between 2's)
      PlayMoveOnPath(MinimumTwoPath(), move);

   //  gList[3]!=NULL 

   if (gSafetyCheckNeeded)
      if (gSafe[0])
      if (gSafe[1])
      gSafetyCheckNeeded = false;

   if (gSafe[0] || gSafe[1] || !gList[2] || 
                                       gMaxScore - gTotalScore <= 4) 
      // Note: If the number of untaken boxes is <= 4, then always
      // take a box, since hand-outs can't be better
      PlayAny(gList[3], move);

   if (!gPathsComputed) 

   // unsafe && gList[2]!=NULL && gList[3]!=NULL
   // while not at end of 3's list do
   //    if the box connected to the 3-box is not a 2-box (or is outside the board)
   //       then take it 
   FOR_LIST(temp, 3)
      if (!temp->twopath)
         PlayAny(temp, move);

   // unsafe & gList[3]!=NULL & all 3-boxes are part of 2-lists
   // Take all 3's that will not ruin HandOut possibilities
   FOR_LIST(temp, 3)
      // if connecting 2-path is not of length 2 or 4 then take it
      int size = temp->twopath->pathsize;
      if (size != 2 && size != 4)
         PlayAny(temp, move);

      // if 2-path looks like 3-2-2-2 then take it
      if (size == 4) 
         pathdirection pdir = OutPathDirection(temp);
         PtrToBoxRecord box2 = 
         if (NumberOfEdges(box2) == 2) 
            PlayAny(temp, move);

   // Now all 3-paths look like 3-2 or 3-2-2-3.  These both are    
   //    are hand out possibilities...                      
   //                               __ __      __ __           
   //       2-path                 |__   | -> |__ __|            
   //                         __ __ __ __      __ __ __ __       
   //       4-path           |__ __ __ __| -> |__ __|__ __|      

   //  Before we hand out though, let's see if there are any     
   //  tiny 2-paths where 2 or 4 handouts don't exist.          
   //  These change the initiative.
   if (!gList[1])
   {   // special unsafe 1-box configurations are not counted
      int tiny2paths = CountTinyTwoPaths ();
      if (ODD(tiny2paths))
      { // We do not need to retain the initiative because it will 
        // change in our favor anyway
         PlayAny(gList[3], move);

   // It is possible to have more than one HandOut available so  
   //     count the number of each kind of HandOut possibility.   
   int num2ho,   // the number of length 2 hand out possibilities
      num4ho;   // the number of length 4 hand out possibilities
   num2ho = num4ho = 0;
   FOR_LIST(temp, 3)
      if (temp->twopath->pathsize == 2) 
   num4ho /= 2; // were counted twice
   if (num2ho + num4ho > 1)
   {    // More than one hand out available so grab another square first
      if (num4ho) 
      {    // take the box from a length 4 2-path
         temp = gList[3];
         while (temp->twopath->pathsize != 4) 
            temp = temp->next;
         PlayAny(temp, move);
      // more than one length=2 hand outs available so play one
      PlayAny(gList[3], move);
   // only one handout possibility
   // Now see if it's worth it, or we should just be greedy.
   if (ExpectedScore(gList[3]->twopath) * 2 < 
                                    gMaxScore - gTotalScore)
   {   // It's not worth it: just be greedy and don't give handout
      PlayAny(gList[3], move);
   if (num2ho)
   {   // do a TPH
      HandOut(2, move);

   ASSERT(num4ho == 1);
   // do a FPH (ickk) 
   HandOut(4, move);
}  // ComputerTurn

//  Makes a move on the board.  Returns true if a new block was formed.
Boolean MakeRealMove(MoveRecordType move, who whoseturn) {

   // Take care of the player's move
#ifdef DRAWING
   DrawMove(GetX(, GetY(, move.dir);
   int oldscore = gScore[whoseturn]; 
            // score of the current player before his move
   Boolean checkneeded = false;

   AddEdge(, move.dir, whoseturn);

   PtrToBoxRecord box2 = Go(, move.dir);
   AddEdge(box2, OppositeDirection(move.dir), whoseturn);

   if (gPathsComputed) 
      Boolean same2path = box2->twopath &&
            (>twopath == box2->twopath) &&
            NumberOfEdges( == 3;
      if (same2path)
         box2->twopath = NULL; 
               // See if updating's 2-path updates this too

      // No need to update the path again if the boxes are still on the same 2-path      
      if (!same2path || !box2->twopath)
         // Note that we want box2's 2-path to remain NULL if set above,
         // since that will cause a new 2-path to be created

   return oldscore != gScore[whoseturn]; // did score change?
}   // MakeRealMove

//  Converts from input data types to engine data types.  Modifies box,d 
void ConvertFromDotLine(MoveRecordType &move, const DotLine &dotline) {

   int x = dotline.dot1.col + 1;
   int y = dotline.dot1.row + 1;

   if (x > gBoardSizeX)
      move.dir = right;
   else if (y > gBoardSizeX)
      move.dir = down;
   else if (dotline.dot2.col > dotline.dot1.col)
      move.dir = up;
   else // (dotline.dot2.row > dotline.dot1.row)
      move.dir = left; = BOX(x, y);

//  Converts from engine data types to output data types,   Modifies dotline 
void ConvertToDotLine(MoveRecordType move, DotLine &dotline) {

   int x = GetX(;
   int y = GetY(;
   direction d = move.dir;

   if (d == right)
      d = left;
   else if (d == down)
      //d = up; // not strictly necessary :-)
   dotline.dot1.col = x - 1;
   dotline.dot1.row = y - 1;
   dotline.dot2 = dotline.dot1;
   if (d == left)
   else // d == up

/*  Play begins with a call to your InitDots routine, where you are 
given the size of the game board (boardSize), an indicator of who 
plays first (playFirst), and a pointer to a CWindow (passed as a 
WindowPtr because that's what most toolbox routines expect). In 
that window, you will be required to display the progress of the 
game as it proceeds. */
void InitDots(
  short boardSize,    //  number of dots per row/col in board 
  Boolean /* playFirst */,  //  true if you play first, false of opponent plays first 
  WindowPtr dotWindow //  color window where you should draw game results 
) {
#pragma unused(dotWindow)

   gCurrentPlayer = firstplayer;   // whose turn it is to play
   gBoardSizeX = gBoardSizeY = boardSize - 1;

/*  After your opponent has played, your OpponentMove routine 
will be called one or more times, once for each move made by 
your opponent. The move will be provided in the opponentLine 
parameter, for use in display and in updating your data structures. */
/*  After each of your moves, and after notification of each 
opponent move, you should display the move and the updated 
game state in the dotWindow. The window should also display 
the number of squares completed by each player. The details 
of the display are left to you, as long as the display is correct. */
void OpponentMove(
  const DotLine opponentLine
    //  line formed by your opponent on previous move 
) {

   MoveRecordType move;
   ConvertFromDotLine(move, opponentLine);   
   if (!MakeRealMove(move, gCurrentPlayer) && 
                                       gTotalScore != gMaxScore)

/*  When it is your turn to move, your PlayDots routine will be 
called. Your code should select the most advantageous move and 
return it in yourLines[0]. If that move forms a square, you can 
select an additional move, store it in yourLines[1], and continue 
as long as squares are formed. PlayDots should return the number 
of moves you made during your turn. */
short /*  number of lines generated */ PlayDots(
  DotLine yourLines[]  //  return the lines you form here 
) {

   Boolean madeBox;
   MoveRecordType move;
   int moves = 0;
   do {
      madeBox = MakeRealMove(move, gCurrentPlayer);
      ConvertToDotLine(move, yourLines[moves]);   
   } while (madeBox && (gTotalScore != gMaxScore));

   if (gTotalScore != gMaxScore)
   return moves;

/*  When all of the squares have been formed, your TermDots routine 
will be called. You should deallocate any dynamically allocated 
memory and perform any other cleanup required. */
void TermDots() { //  return any storage you allocated 

   delete [] gBoxes;
   for (int i=0; i<3; ++i)
      PtrToTwoPathRecord p = gTwoPaths[i];
      while (p)
         PtrToTwoPathRecord p2 = p->next;
         delete p;
         p = p2;

// Screen.cpp
// Copyright 2001 Jeff Mallett.  All rights reserved.

#include <stdio.h>
#include <string.h>

#include <QuickDraw.h>


// The full board can't actually fit on the window.  I get less than 20x20
// boxes showing in the test code window.  Therefore only draw
// the upper-left portion of grid if it's that big.
// The maximum dimensions to draw can be adjusted here if the window
// size is increased:
const int MAX_X_DRAW = 25;
const int MAX_Y_DRAW = 25;

const int BOX_WIDTH = 15;         /*pixel distance between adjacent dots*/
const int SCORE_TITLE_Y = 20;
const int SCORE_Y = 38;            /*distance of scores from top of screen*/
const int GRID_Y = 50;
const int SCORE_X[2] = {40, 130};
const char PLAYER_INITIAL[2] = { ‘1', ‘2' };
            /*PLAYER_INITIAL[w] is the initial of player w*/

enum direction {left=0, up, right, down};
enum who {firstplayer=0, secondplayer};

extern int gBoardSizeX;
extern int gBoardSizeY;

void ScreenLoc (int x, int y, int& i, int& j);
void DrawEdge (int x1, int y1, int x2, int y2);
void DrawDots();
void DrawScore (who w);
void DrawInitial (int x, int y, who person);
void DrawMove(int x, int y, direction d);
void DrawScoreTitle(who person);
void InitialDrawing();

/*Given box coordinates x,y returns coords of top-left point of box (i,j)*/
void ScreenLoc (int x, int y, int& i, int& j) {
   i = x * BOX_WIDTH;
   j = y * BOX_WIDTH + GRID_Y;
}   /*ScreenLoc*/

/*Given the coordinates of two boxes x1, y1 and x2, y2, this will draw in*/
/*   an edge connecting the dot in the upper left hand corner of the two boxes.*/
void DrawEdge (int x1, int y1, int x2, int y2) {
   int i1, j1, i2, j2;
   ScreenLoc(x1, y1, i1, j1);
   ScreenLoc(x2, y2, i2, j2);
   MoveTo(i1, j1);
   LineTo(i2, j2);
}   /*DrawEdge*/

/*Print the dots on the screen which form the playing board*/
void DrawDots() {
   int hor, ver, i, j;
   Rect rect;
   int maxh = gBoardSizeX;
   int maxv = gBoardSizeY;
   if (maxh > MAX_X_DRAW)
      maxh = MAX_X_DRAW;
   if (maxv > MAX_Y_DRAW)
      maxv = MAX_Y_DRAW;
   for( hor = 1; hor <= maxh; hor++)
      for( ver = 1; ver <= maxv; ver++) {
         ScreenLoc(hor, ver, i, j);
         SetRect(&rect, i, j, i + 1, j + 1);
}   /*DrawDots*/

/*Update a player's score on the drawing window*/
void DrawScore (who w) {
   extern int gScore[];
   int n;
   Rect rect;
   n = SCORE_X[w];
   SetRect(&rect, n, SCORE_Y - 11, n + 40, SCORE_Y + 2);

   char s[256];
   sprintf(s, "%1d", gScore[w]);
   MoveTo(n, SCORE_Y);
   DrawText(s, 0, strlen(s));
}   /*DrawScore*/

void DrawInitial (int x, int y, who person) {

   if (x <= MAX_X_DRAW && y <= MAX_Y_DRAW)
      int hor, ver;
      ScreenLoc(x, y, hor, ver);
      hor += (BOX_WIDTH / 2) - 3;
      ver += (BOX_WIDTH / 2) + 6;
      MoveTo(hor, ver);
      DrawText(&PLAYER_INITIAL[person], 0, 1);
}   /*DrawInitial*/

void DrawMove(int x, int y, direction d) {

   if (x <= MAX_X_DRAW && y <= MAX_Y_DRAW)
      switch (d) {
      case left : 
         DrawEdge(x, y, x, y + 1);
      case up : 
         DrawEdge(x, y, x + 1, y);
      case right : 
         DrawEdge(x + 1, y, x + 1, y + 1);
      case down : 
         DrawEdge(x, y + 1, x + 1, y + 1);

void DrawScoreTitle(who person) {

   Rect rect;
   int n = SCORE_X[person];
   SetRect(&rect, n, SCORE_TITLE_Y - 11, n + 40, 
                                             SCORE_TITLE_Y + 2);

   MoveTo(n, SCORE_TITLE_Y);
   DrawText(&PLAYER_INITIAL[person], 0, 1);

void InitialDrawing() {


   int x = SCORE_X[firstplayer]-10;
   int y = SCORE_TITLE_Y+4;
   int x2 = SCORE_X[secondplayer]+20;
   MoveTo(x, y);
   LineTo(x2, y);
   MoveTo((x+x2)/2, SCORE_TITLE_Y-15);
   LineTo((x+x2)/2, SCORE_Y+15);

Community Search:
MacTech Search:

Software Updates via MacUpdate

Nisus Writer Pro 2.1.2 - Multilingual wo...
Nisus Writer Pro is a powerful multilingual word processor, similar to its entry level products, but brings new features such as table of contents, indexing, bookmarks, widow and orphan control,... Read more
calibre 2.40.0 - Complete e-book library...
Calibre is a complete e-book library manager. Organize your collection, convert your books to multiple formats, and sync with all of your devices. Let Calibre be your multi-tasking digital librarian... Read more
Vivaldi - An advanced browser...
Vivaldi is a browser for our friends. In 1994, two programmers started working on a web browser. Our idea was to make a really fast browser, capable of running on limited hardware, keeping in mind... Read more
OmniPlan 3.0 - Robust project management...
With OmniPlan, you can create logical, manageable project plans with Gantt charts, schedules, summaries, milestones, and critical paths. Break down the tasks needed to make your project a success,... Read more
Yummy FTP 1.11 - FTP/SFTP/FTPS client fo...
Yummy FTP is an FTP + SFTP + FTPS file transfer client which focuses on speed, reliability and productivity. Whether you need to transfer a few files or a few thousand, schedule automatic backups, or... Read more
Tweetbot 2.1 - Popular Twitter client. (...
Tweetbot is a full-featured OS X Twitter client with a lot of personality. Whether it's the meticulously-crafted interface, sounds and animation, or features like multiple timelines and column views... Read more
MacPilot 8.0 - Enable over 1,200 hidden...
MacPilot gives you the power of UNIX and the simplicity of Macintosh, which means a phenomenal amount of untapped power in your hands! Use MacPilot to unlock over 1,200 features, and access them all... Read more
Typinator 6.7 - Speedy and reliable text...
Typinator turbo-charges your typing productivity. Type a little. Typinator does the rest. We've all faced projects that require repetitive typing tasks. With Typinator, you can store commonly used... Read more
Adobe Lightroom 6.2 - Import, develop, a...
Adobe Lightroom is available as part of Adobe Creative Cloud for as little as $9.99/month bundled with Photoshop CC as part of the photography package. Lightroom 6 is also available for purchase as a... Read more
ForeverSave 2.1.4 - Universal auto-save...
ForeverSave auto-saves all documents you're working on while simultaneously doing backup versioning in the background. Lost data can be quickly restored at any time. Losing data, caused by... Read more

Super Sharp (Games)
Super Sharp 1.1 Device: iOS Universal Category: Games Price: $1.99, Version: 1.1 (iTunes) Description: Your finger has never been so sharp! Cut with skill to complete the 120 ingenious physics levels of Super Sharp and become a cut... | Read more »
Assembly - Graphic design for everyone...
Assembly - Graphic design for everyone 1.0 Device: iOS Universal Category: Photography Price: $2.99, Version: 1.0 (iTunes) Description: Assembly is the easiest most powerful design tool on the App Store. Create anything you can... | Read more »
YAMGUN (Games)
YAMGUN 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: The invasion has begun! Protect the walls of the citadel against waves of enemies! But watch out, you will soon run out of ammo...... | Read more »
Royal Bounty HD (Games)
Royal Bounty HD 1.0 Device: iOS Universal Category: Games Price: $4.99, Version: 1.0 (iTunes) Description: New World Computing Approved "Hi Guys! looks good so far! keep up the good work. I worked on HoMM 3 and 4 creating all of the... | Read more »
Swords & Crossbones: An Epic Pirate...
Swords & Crossbones: An Epic Pirate Story 1.0 Device: iOS Universal Category: Games Price: $4.99, Version: 1.0 (iTunes) Description: | Read more »
Camel Up (Games)
Camel Up 1.0.0 Device: iOS Universal Category: Games Price: $4.99, Version: 1.0.0 (iTunes) Description: | Read more »
The Martian: Bring Him Home (Games)
The Martian: Bring Him Home 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: Based on the best selling novel and critically acclaimed film, THE MARTIAN tells the story of Astronaut Mark... | Read more »
This Week at 148Apps: September 21-30, 2...
Leap Into Fall With 148Apps How do you know what apps are worth your time and money? Just look to the review team at 148Apps. We sort through the chaos and find the apps you're looking for. The ones we love become Editor’s Choice, standing out above... | Read more »
Tweetbot 4 for Twitter (Social Networki...
Tweetbot 4 for Twitter 4.0 Device: iOS Universal Category: Social Networking Price: $4.99, Version: 4.0 (iTunes) Description: *** 50% off for a limited time. *** | Read more »
Mori (Games)
Mori 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: Stop, rewind and unwind with Mori. Time is always running, take a moment to take control. Mori is an action puzzle game about infinitely... | Read more »

Price Scanner via

Save up to $350 with Apple refurbished iMacs
Apple has Certified Refurbished iMacs available for up to $350 off the cost of new models. Apple’s one-year warranty is standard, and shipping is free: - 27″ 3.5GHz 5K iMac – $1949 $350 off MSRP - 27... Read more
Mac Pros on sale for up to $300 off MSRP
B&H Photo has Mac Pros on sale for up to $300 off MSRP. Shipping is free, and B&H charges sales tax in NY only: - 3.7GHz 4-core Mac Pro: $2818.99, $181 off MSRP - 3.5GHz 6-core Mac Pro: $3699... Read more
5K iMacs on sale for up to $150 off MSRP, fre...
B&H Photo has the 27″ 3.3GHz 5K iMac on sale for $1899.99 including free shipping plus NY tax only. Their price is $100 off MSRP. They have the 27″ 3.5GHz 5K iMac on sale for $2149, $150 off MSRP... Read more
Twelve South Redesigns BookArc For Today’s Sm...
Twelve South has announced a redesigned version of their very first product, BookArc for MacBook. Tailored specifically for the newest generation of MacBooks, BookArc holds the new, smaller Apple... Read more
Phone 6s Tips & Tricks – Tips Book For iP...
Poole, United Kingdom based Tap Guides Ltd. has announced the release and immediate availability of iPhone 6s Tips & Tricks, an in-depth eBook available in the iBookstore that’s priced just $2.99... Read more
13-inch 2.5GHz MacBook Pro on sale for $994,...
Best Buy has the 13″ 2.5GHz MacBook Pro available for $994.99 on their online store. Choose free shipping or free instant local store pickup (if available). Their price is $105 off MSRP. Price valid... Read more
Is The iPad Pro Really A Serious Laptop Repla...
Probably not, at least for productive professionals and other power users. Steve Jobs declared that we’d entered the “post-PC Era” with the advent of the original iPad in 2010, a phrase we don’t hear... Read more
Wednesday Deal: 13-inch Retina MacBook Pros f...
Adorama has 13″ Retina MacBook Pros on sale for up to $130 off MSRP. Shipping is free, and Adorama charges sales tax for NY & NJ residents only: - 13″ 2.7GHz/128GB Retina MacBook Pro: $1199.99 $... Read more
uBar 3.0 for Mac OS X – Custom Dock Replaceme...
Brawer Software has announced the release of uBar 3.0, an important update to their popular app and window manager for Mac OS X. uBar allows users to position it whichever side of the screen they... Read more
13-inch 2.5GHz MacBook Pro (refurbished) avai...
Apple has Certified Refurbished 13″ 2.5GHz MacBook Pros available for $829, or $270 off the cost of new models. Apple’s one-year warranty is standard, and shipping is free: - 13″ 2.5GHz MacBook Pros... Read more

Jobs Board

*Apple* Retail Online, Customer Experience R...
**Job Summary** Apple Retail's Online Store sells Apple products to customers around the world. In addition to selling Apple products with unique services such Read more
Frameworks Engineer, *Apple* Watch - Apple...
**Job Summary** Join the team that is shaping the future of software development for Apple Watch! As a software engineer on the Apple Watch Frameworks team you will Read more
Senior Manager, Global Direct Marketing *App...
**Job Summary** Apple Retail is looking for an experienced Direct Marketing Leader to join its Marketing team. This position will take a leadership role in creating Read more
*Apple* Online Store Expansion - Apple (Unit...
**Job Summary** The Online Apple Store is seeking a person to lead its expansion into new countries. Based in Cupertino, CA, this person will develop and maintain an Read more
*Apple* Retail - Multiple Customer Support P...
Job Description:Customer SupportSpecialist - Retail Customer Service and SalesTransform Apple Store visitors into loyal Apple customers. When customers enter the Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.