Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

slooksterPSV

macrumors 68040
Original poster
Apr 17, 2004
3,544
306
Nowheresville
I figure we don't have very many users on this forum who post about programming. So I'm going to get you guys more involved. Here are the rules and how you play this game:
Basically you go back and forth adding a new piece of code to the previous persons source code. We may be able to develop something from this. We'll start off with basic C++ then I'll ask you guys if you want to shift to SDL, Allegro, etc. Any one of those. Now here are the rules:
If the previous persons source code contains an error or parse error, politely fix it and state what has been changed.
When you add a new change to the source code, please add at the bottom of the source code (out of the code box) what you added or changed. This helps us to know what to do next.
I'll start with a basic C++ program note how i use the code box:
Code:
#include <iostream.h>

using namespace std;

int main()
{
 cout << "You guys decide what to do next.\n";
 return 0;
}
1 - Created basic source code
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
40,077
8,336
Los Angeles
We generally don't allow game threads of the "do something and pass it on" variety, but if you direct this toward accomplishing something useful, I'm sure that fits a loophole somewhere in the 65,536-page forum regulation manual.

Of course, being a programmer myself, I'm biased in favor of programming themes.
 

superbovine

macrumors 68030
Nov 7, 2003
2,872
0
Code:
#include <iostream>

using namespace std;

int main()
{
 cout << "You guys decide what to do next." << endl;
 return 0;
}

Well, if you really want to strictly C++...
 

SamMiller0

macrumors member
Aug 17, 2004
66
0
San Jose, CA
slooksterPSV said:
I'll start with a basic C++ program note how i use the code box:
Code:
#include <iostream.h>

using namespace std;

int main()
{
 cout << "You guys decide what to do next.\n";
 return 0;
}

I'll fix your code:
Code:
#include <iostream>

int main() {
   using std::cout;
   using std::endl;

   cout << "You guys decide what to do next." << endl;

   return 0;
}

1. The header is just iostream, iostream.h is deprecated
2. "using namespace std" pollutes your namespace, only include what you need
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.