PDA

View Full Version : The Programming Game




slooksterPSV
Jan 10, 2006, 10:22 PM
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:

#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
Jan 10, 2006, 11:33 PM
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.

HiRez
Jan 11, 2006, 12:41 AM
Sounded interesting until you said C++. :rolleyes:

superbovine
Jan 11, 2006, 12:58 AM
#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++...

caveman_uk
Jan 11, 2006, 02:47 AM
Sounded interesting until you said C++. :rolleyes:
Ditto....life's too short to mess with C++;)

SamMiller0
Jan 11, 2006, 12:58 PM
I'll start with a basic C++ program note how i use the code box:

#include <iostream.h>

using namespace std;

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



I'll fix your 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

Catfish_Man
Jan 11, 2006, 05:06 PM
More fixed version:


"You guys decide what to do next." print


Hooray for io (http://www.iolanguage.com)