TweetFollow Us on Twitter

The Road to Code: Pointing the Way

Volume Number: 23 (2007)
Issue Number: 08
Column Tag: The Road to Code

The Road to Code: Pointing the Way

Game on!

by Dave Dribin

Welcome Back

Welcome back to The Road to Code. By now, you should be an expert at using simple variables, functions, and mathematical expressions. Even if you're not, you're probably itching to do something more interesting. Well you're in luck. This month we are going to be building a simple game. First, we'll go over three features of the C language: loops, conditional statements, and pointers. We'll look at them individually, and then we'll combine them to build something more complex.

Can You Repeat that, Please?

Sometimes you want to repeat a section of code multiple times. For example, if we wanted to print the numbers from one to five, we could write a simple C program, like this:

Listing 1: main.c Counting to five

#include <stdio.h>
int main(int argc, const char * argv[])
{
   printf("1\n");
   printf("2\n");
   printf("3\n");
   printf("4\n");
   printf("5\n");
   return 0;
}

As an alternative, instead of hard coding the number inside the string, we could use a variable to hold the current number:

Listing 2: main.c Counting with a variable

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   
   number = 1;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   number++;
   printf("%d\n", number);
   
   return 0;
}

Given the discussion of variables last month, this code should look familiar. However, I did throw one curve ball. I'm using number++, which is just fancy shorthand for number = number + 1. The benefit of using a variable is that if you needed to change your code to count to ten, you could just copy and paste these two lines of code five more times:

   number++;
   printf("%d\n", number);

Although repeating code like this is more flexible than the hard coded strings in Listing 1, it's not without its drawbacks. Copying and pasting is prone to error. You could accidentally paste those two lines six more times, instead of five. You would now have a bug in your program, as it would print until eleven, instead of ten. Luckily, the C language has a solution to help avoid code repetition, called loops.

While Loops

Repeating the same code multiple times is called looping because after executing a block of code, you want it to loop back around to the beginning, as if the computer was running laps around a track. There are a few of different kinds of loops in C, but the first one we'll be looking at is called a while loop. A while loop repeats the same block of code, while a condition remains valid. Here is how we could rewrite our counting program to use a while loop:

Listing 3: main.c Counting with a while loop

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   
   number = 1;
   while (number <= 5)
   {
      printf("%d\n", number);
      number = number + 1;
   }
   return 0;
}

All while loops have this same basic structure:

   while (condition)
   {
      body
   }

First, you have the keyword while. Next is the condition, in parenthesis. And finally, the body of the loop, enclosed in braces. The body of a loop is very similar to a body of a function: it's a collection of statements that get executed in order. The body of a while loop is executed over and over, so long as the condition of the while loop remains true. Each time through the loop is called an iteration, thus the while loop iterates over the body.

Conditions

The condition, also called a conditional expression, is similar to the mathematic expressions described last month, except that instead of having the computer perform arithmetic, they are a way to ask the computer simple questions. In this case, the <= symbol is called a less than or equal to operator. Thus the expression "number <= 5" is asking the computer "is the variable 'number' less than or equal to five?" The computer responds to this question with a "Yes" or "No" answer. Because the answer is a simple Yes/No value, it is called a Boolean value. Sometimes the "Yes" and "No" values are called "True" and "False," respectively, which is why a Boolean value is also known as a truth value.

That's enough of the fancy computer science terminology for now. What's important is that a while loop keeps executing its body so long as the condition returns true. And in this case, it keeps executing the body so long as the number variable is less than or equal to five. It is important that our body keeps adding one to number. If it didn't, our while condition would always be true, and it would keep printing the same number over and over, forever. When a loop condition is always true, this special case is called an infinite loop. Infinite loops are usually bugs and can cause the program to stop responding normally. When writing your own loops, double-check your code to ensure you are avoiding an infinite loop. As a side bit of trivia, the street address for Apple's headquarters in Cupertino, California is "1 Infinite Loop". Ah... humor only a geek could love.

Using the while loop, if we want to change the program to count to ten, we just have to change the condition at the top of our while loop to:

   while (number <= 10)

That is much less repetition. No more copying and pasting, and we can now count to 100 or even 1,000 very easily. Counting that high would require a lot more work using Listing 1 or Listing 2 as a starting point. As you gain more experience, I think you will notice that reducing repetition is a key to designing programs with fewer bugs.

To finish off the topic of conditions, I'll provide you with a list of a few common conditional operations. You may use the conditional operators found in Table 1 in a similar manner to how we used <= above.

Table 1: Simple Conditional Operators

Operation   C Syntax   
Equals   ==   
Not Equals   !=   
Less Than   <   
Greater Than   >   
Less Than or Equals   <=   
Greater Than or Equals   >=   

For Loops

Another kind of loop is a for loop. Using a for loop, we can rewrite our counting while loop as:

Listing 4: main.c Counting with a for loop

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   
   for (number = 1; number <= 5; number++)
   {
      printf("%d\n", number);
   }
   
   return 0;
}

This simplifies our while loop by putting the initial value, the check, and the increment all on one line. All for loops have this same basic structure:

   for (initial expression; condition; loop expression)
   {
      body
   }

The initial expression -- in this case, "number = 1" -- is executed before the loop starts. The body of the loop is executed as long as the condition remains true. Finally, the loop expression is executed at the end of every loop iteration. In fact, any for loop can be rewritten as a while loop:

   initial expression
   while (condition)
   {
      body
      loop expression
   }

Because these are equivalent, you should choose a for loop or a while loop based on what makes your code easiest to read and understand. Oh, one final tidbit: when the body of a loop is only a single statement, you can leave off the braces:

int main(int argc, const char * argv[])
{
   int number;
   
   for (number = 1; number <= 5; number++)
      printf("%d\n", number);
   
   return 0;
}

Be careful, though. If you add a second statement, be sure to add those braces back!

Do While Loops

The final loop construct provided by C is called a do/while loop. This is very similar to a while loop, except the body of the loop is always executed at least once. A do/while loop takes the form of:

   do
   {
      body
   }
   while (condition);

The loop now begins with the do keyword, and the condition is moved to the bottom, after the braces. This ensures that the body is executed at least once, because the condition isn't tested until after one iteration of the body. We will be using this in our game program.

Bugs

I've already used the word "bug" a few times in this article, and I'm sure you've heard it before. But what exactly is a bug? The simplest definition is: an error in the program that causes it to not run as intended. "Run as intended" is a rather vague statement, though. Whose intention are we talking about? Take my first example of a bug where I modified the program that counts to five and changed it to count to ten. If I cut and pasted that code one too many times, and it counted to eleven instead, this could be considered a bug. My intention was to write a program that counts to ten, but it counts to eleven! Of course the intention may depend on your end user. If you were Nigel Tufnel of Spinal Tap, going to eleven would be the correct behavior.

There are many, many reasons why programs have bugs. It all boils down to the fact that software is written by humans, and humans make mistakes. There's no way around it. Programs you write will have bugs too. As your programs get larger, the more bugs you will write. If you're going to keep your sanity while writing programs, you're going to have to come to terms with the existence of bugs.

The process of finding and removing bugs is called debugging. Debugging is a large topic in itself, so I won't be talking about it extensively right now.

Making Decisions

Conditional expressions have another important use. You may want to execute a block of code only if a certain condition is true. For example, let's write a program to print every age from one to thirty and whether or not someone that age may vote in the United States:

Listing 5: main.c Printing voting age

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   
   for (age = 1; age <= 30; age++)
   {
      if (age < 18)
         printf("You may not vote at age %d\n", age);
      else
         printf("You may vote at age %d\n", age);
   }
   
   return 0;
}

Here we are using a for loop to iterate over all ages between one and thirty. Inside the body of the loop, we are using a new construct called an if statement to check the age. Just like a while loop condition, an if statement contains a condition and a body. The body only gets executed when the condition is true. The else statement contains a block that only gets executed when the condition is false. The else statement is optional. If you don't need it, just leave it off. You may also add another if statement onto an else statement:

   if (age < 18)
      printf("You do not have to pay taxes\n");
   else if (age >= 65)
      printf("You may collect social security\n");
   else
      printf("You must pay taxes\n");

And that wraps up loops and conditional statements. Try writing your own program that combines these concepts. For example, try writing a program that prints whether or not someone with a particular age is eligible to drive where you live.

Pointers

Pointers are one of the most important concepts of C, and they are used quite heavily in Objective-C. They are also considered one of the most difficult concepts in C. We'll take it step by step, and in time, I'm sure you'll be able to grasp pointers, as well.

Last month, I used storage boxes as an analogy for variables. For a quick refresher, a variable is like a storage box in that it holds different types of data, such as integer numbers and floating point numbers. However, that analogy goes further. A computer program will have lots of variables, and sometimes a variable with the same name will be used in different functions. How does the computer keep track? Just like the post office uses numbers to keep track of P.O. boxes, the computer uses numbers to keep track of all the variables. It gives each variable a unique number. In fact, this number is also called an address. [Ed. note: for the system administrators in the audience, you can think of this like DNS. People like names, so, we invent a name like www.apple.com. However, computers like numbers, so, we need a way to get the address for www.apple.com, which nslookup and dig will do. You can translate back and forth between name and address.]

The C compiler hides the details of variable addresses because it's easier for people to remember variable names rather than addresses. The compiler provides a way to get the address of a variable, using the address of operator, which is an ampersand character (&). Here is a small program to print out the address of a variable:

Listing 6: main.c Printing an address

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   number = 5;
   printf("The contents of number: %d\n", number);
   printf("The address of number: %u\n", &number);
   
   return 0;

}

You should get output similar to this in the Run Log window:

The contents of number: 5
The address of number: 3221223788

Your address may be different, but what's important is that every variable has a unique address. Remember from last time that %d in printf formats an integer, which may be positive or negative. %u tells printf that the number is an unsigned, positive only, integer. [1]

You can also declare a variable that holds an address. Our code above could be rewritten as:

Listing 7: main.c Using a pointer

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   int * pointer;
   number = 5;
   pointer = &number;
   printf("The contents of number: %d\n", number);
   printf("The address of number: %u\n", pointer);
   printf("The address of pointer: %u\n", &pointer);
   
   return 0;
}

If you run this, again you should get output similar to this:

The contents of number: 5
The address of number: 3221223788
The address of pointer: 3221223784

You'll notice that the pointer variable has an asterisk, or star, in front if it. This changes the type of pointer from an "integer" to a "pointer to an integer", which means it holds an address, instead of an actual integer. There are a couple of interesting points about the output. First, the address of number is still the same. Second, the address of pointer is different. Remember, even though pointer holds an address, it, too, is a variable and gets its own address. Thus our program has two variables, or P.O. boxes, which are summarized in Figure 1. Remember, these addresses may be different on your computer, and are essentially arbitrary.


Figure 1: Variables as boxes

Dereferencing Pointers

That said, you rarely print out an address. Pointers are usually used to modify the contents of another variable. For example:

Listing 8: main.c Dereferencing a pointer

#include <stdio.h> int main(int argc, const char * argv[]) { int number; int * pointer; number = 5; pointer = &number; printf("The contents of number: %d\n", number); *pointer = 10; printf("The contents of number: %d\n", number); return 0; }

This will produce output like:

The contents of number: 5
The contents of number: 10

Whoa! What happened there? The contents of the number variable changed, as if we had written:

   number = 10;

Using the star before pointer tells the compiler that we want to change what is at the address of pointer. Let's examine more closely what happens when we use a line of code like "number = 10". The compiler says, "Hmm... I know the number variable has a box with address 3221223788. Let me change the contents of the box at address 3221223788 to 10."

Putting a star in front of pointer is exactly the same thing. Remember that even though pointer has its own address, the contents of pointer is the same address as number: 3221223788. When the compiler sees "*pointer = 10" it says, "The contents of pointer contains the address 3221223788. Let me change the contents of box at address 3221223788 to 10." Using star before a pointer like this is called dereferencing a pointer. Also the star, when used to dereference a pointer, is called the contents of operator.

You can see, now, how pointers get their name. Pointers point to another variable. In this case, the variable pointer points to the variable number. If you're still confused, think of pointers like file aliases on your desktop. When you create an alias in the Finder, the alias points to the original file. If you open the alias, and make changes to it, the original file gets updated, as well. In the same fashion, pointers allow you to alter the contents of another variable.

Passing Pointers to Functions

Is your head spinning, yet? I hope not. Let's run through another scenario where using pointers are helpful. Let's write a function that triples any number that gets passed into it:

Listing 9: main.c Incorrect triple function

#include <stdio.h>
void triple(int n)
{
   n = n * 3;
}
int main(int argc, const char * argv[])
{
   int number;
   number = 5;
   printf("The contents of number: %d\n", number);
   
   triple(number);
   printf("The contents of number: %d\n", number);
   
   return 0;
}

Even though this code may look correct, it actually has a bug in it. If you run it, you will get this output:

The contents of number: 5
The contents of number: 5

Eh? Why is number still 5, you may be asking? It turns out that arguments of functions are also variables. Thus, the argument n of triple has its own address. Calling the triple function copies the contents of number into the contents of n. When triple changes n, it has no effect on number. We can verify this by printing the variable in triple:

void triple(int n)
{
   n = n * 3;
   printf("n in triple: %d\n", n);
}

This produces the output:

The contents of number: 5
n in triple: 15
The contents of number: 5

Okay, well how do fix this? Pointers to the rescue!

Listing 10: main.c Correct triple function with pointers

#include <stdio.h> void triple(int * pointer) { int n = *pointer; n = n * 3; *pointer = n; } int main(int argc, const char * argv[]) { int number; number = 5; printf("The contents of number: %d\n", number); triple(&number); printf("The contents of number: %d\n", number); return 0; }

This time, you should get the correct output:

The contents of number: 5
The contents of number: 15

So what changed here? First, we are using the address of operator (the ampersand) when calling triple:

   triple(&number);

This passes the address of the number variable to triple, instead of making a copy. Now, we have an argument to triple, named pointer, which is a pointer to an integer. When called, this variable points to the number variable in main allowing triple to change the variable in main. Inside triple, it dereferences the pointer, which sets n to five, initially, by looking inside the box of the number variable. Then it multiplies n by three. Finally, we dereference the pointer, again, to put the result, fifteen, back into the original box. This is really no different than our example in Listing 8, except we've now used a pointer as an argument to a function. It's also worth noting that we can shorten the triple function to:

void triple(int * pointer)
{
   *pointer = (*pointer) * 3;
}

This eliminates the temporary variable n and does the modification on one line. I added extra parenthesis on the right hand side to make sure the star for dereferencing the pointer is not confused with a star used for multiplication.

Communicating with the User

Okay, again that was a bit of a contrived example. So when is this useful in your own program? One case is when you want to get input from the user. Here is a simple program to get the user's age using a standard function called scanf:

Listing 11: main.c Asking the user's age

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   printf("What is your age? ");
   scanf("%d", &age);
   printf("Your age is: %d\n", age);
   
   return 0;
}

This time, when you run the program, it will stop, waiting for you to type your age into the Run Log window. Type it in, and press Return. Here's what I did:

What is your age? 33
Your age is: 33

The first 33 in bold red is what I typed in. On the next line, you can see it printed my age back to me. What happened here? scanf is a function that reads user input, but it needs to store this result somewhere. By using a pointer, we can pass the address of the age variable, and scanf can store the user's response in age. The %d here is similar to a %d used in printf, and tells scanf to read an integer from the user.

Now that we can communicate with the user, it's getting interesting. Just to spice this up, let's add an if statement that tells you if you are allowed to vote in the United States, similar to what we did in Listing 5:

Listing 12: main.c Can the user vote?

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   printf("What is your age? ");
   scanf("%d", &age);
   printf("Your age is: %d\n", age);
   if (age >= 18)
      printf("You are allowed (and should!) vote\n");
   else
      printf("Sorry, you are not allowed to vote, yet\n");
   
   return 0;
}

Try running this a couple times, first using an age greater than or equal to eighteen, and again using an age less than eighteen.

Putting it All Together

Lying about your age isn't all that fun, so let's put it all together by writing a simple number guessing game. Here's the code to the entire game:

Listing 13: main.c    Number guessing game
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// Generate a random number between 1 and 32
int generate_random_number(void)
{
   // "Seed" the random number generator
   srand(time(NULL));
   int random_number = rand();
   return (random_number % 32) + 1;
}
void play_game(void)
{
   int random_number;
   int guess;
   int count;
   
   random_number = generate_random_number();
   count = 0;
   printf("I am thinking of a number between 1 and 32.\n");
   printf("How quickly can you guess it?\n");
   do
   {
      printf("What is your guess? ");
      scanf("%d", &guess);
      if (guess < random_number)
         printf("You guessed too low. Try again.\n");
      else if (guess > random_number)
         printf("You guessed too high. Try again.\n");
      count++;
         
   } while (guess != random_number);
   printf("You guessed it correctly!\n");
   printf("It only took you %d guesses.\n", count);
}
int main(int argc, const char * argv[])
{
   play_game();
   
   return 0;
}

Hopefully there are not too many surprises here. The only part we have not covered is generating a random number. The rand function is supposed to generate a random number between zero and 2147483647. However, there is one gotcha. If you don't seed the random number generator, it will always return the same sequence of numbers. Since this would not make a very fun game, we are using the current time as a seed. If you don't understand this, don't worry. Just trust me that it's necessary to make this game fun.

Okay, so rand gives us a number between zero and 2147483647, but we really want a number between one and thirty-two. The percent sign is a mathematical operator called the modulo operator that returns the remainder of a division. Think back to grade school math and remember that when dividing a number, you get a quotient and a remainder. For example, if you divide 53 by 10, the quotient is 5 and the remainder is 3. A fancy name for doing division and returning the remainder is called taking the modulo of a number, or just mod for short. The nice thing about the modulo is that its value is always between zero and the divisor minus one. Thus the expression (random_number % 32) always returns a number between zero and thirty-one. Since we want a number between one and thirty-two, we need to add one to it.

Phew! Creating a random number was a little complicated, but given your new knowledge of loops, conditional statements, and pointers, you should be able to understand the rest of the program. The play_game function keeps asking the user for a guess and only stops if the user guesses correctly. It also gives a little hint to the user so she or he can refine their guess. We added two more #include statements, because we are now using other functions that are not declared in stdio.h. rand and srand are declared in stdlib.h, and time is declared in time.h.

Here is a sample session of a game.

I am thinking of a number between 1 and 32.
How quickly can you guess it?
What is your guess? 16
You guessed too low. Try again.
What is your guess? 24
You guessed too high. Try again.
What is your guess? 20
You guessed too low. Try again.
What is your guess? 22
You guessed it correctly!
It only took you 4 guesses.

Play the game yourself a few times, and see how well you can do. With the correct strategy, you should always be able to guess correctly in five guesses or less. Read over the code again, and see if you can follow along as you type. Just to make sure you understand, try adding another do/while loop in main that asks the user if they would like to play again. I'll give you a small hint:

   play_game();
   printf("Enter (1) to play again: ");
   scanf("%d", &response);

See if you can figure out the rest!

Conclusion

We covered a lot of ground this month, from loops and conditional statements to pointers. I know pointers can be a bit tricky. If it's still not clear to you, I suggest writing some code, yourself. Pointers can definitely be difficult to understand by reading alone, so dive in and start playing around. Think about it this way: in just two months, you now know how to write a simple game. That's some good stuff. See what you can do on your own with what we've covered. Programming might take some practice, but it can be fun!

Footnotes

[1]: This is technically incorrect. Pointers should use the %p format string, instead of %u. Unfortunately, %p prints the address in hexadecimal, which is an advanced topic we'll cover later.


Dave Dribin has been writing professional software for over eleven years. After five years programming embedded C in the telecom industry and a brief stint riding the Internet bubble, he decided to venture out on his own. Since 2001, he has been providing independent consulting services, and in 2006, he founded Bit Maki, Inc. Find out more at http://www.bitmaki.com/ and http://www.dribin.org/dave/>.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.