![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Professional Programmer
Join Date: Jun 2004
Location: South Africa, Johannesburg
Posts: 301
Rep Power: 5
![]() |
lol....8,587 lines to be exact.
__________________
[SIGPIC][/SIGPIC] |
|
|
|
|
|
#12 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Jesus. Minix was only 12,000 lines. That's tic-tac-toe???
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#13 |
|
Professional Programmer
Join Date: Jun 2004
Location: South Africa, Johannesburg
Posts: 301
Rep Power: 5
![]() |
Minix?
__________________
[SIGPIC][/SIGPIC] |
|
|
|
|
|
#14 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
The predecessor to Linux.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#15 |
|
Programming Guru
![]() |
and i thought i wrote a lot of code...
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#16 |
|
Programming Guru
![]() ![]() ![]() |
I'm not sure how I missed this thread... but -damn- thats a lot of code for tic-tac-toe. Good work though.
The paste utility was pretty cool kurifu. Who is going to volunteer to optimize the TTT game above? hee
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#17 |
|
Programming Guru
![]() |
optimize it!!! i would write it a compltly different way, and there either is no indenting or just plain silly :/
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#18 |
|
Programming Guru
![]() ![]() ![]() |
optimization... nah. it'd be a rewrite for me too.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#19 |
|
Programming Guru
![]() |
its my new project just starting to write it now
![]()
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#20 |
|
Programming Guru
![]() |
I will finish it tomorrow just my start of the game
![]()
#include <iostream>
#include <stdlib.h>
using namespace std;
struct pos{
int value;
char position;
};
void drawBoard();
void loadBoard();
pos board[3][3];
int main(int argc, char *argv[])
{
loadBoard();
bool end = false;
int player = 1;
int turn=1;
while (!end){
drawBoard();
turn++;
int pPos;
if (player == 1){
player = 2;
cout << "\n\nEnter the Position to place your X";
cin >> pPos;
}else if(player == 2){
player = 1;
cout << "\n\nEnter the Position to place your O";
cin >> pPos;
}
}
}
void drawBoard(){
cout << "\t\tTic Tac Toe\n";
cout << "\n\n";
cout << "\t\t" << board[0][0].position << " | " << board[0][2].position << " | " << board[0][2].position << endl;
cout << "\t\t---------" << endl;
cout << "\t\t" << board[1][0].position << " | " << board[1][1].position << " | " << board[1][2].position << endl;
cout << "\t\t---------" << endl;
cout << "\t\t" << board[2][0].position << " | " << board[2][1].position << " | " << board[2][2].position << endl;
}
void loadBoard(){
char positn = '1';
for (int i = 0; i < 3; i++){
for (int j = 0; j < 3; j++){
board[i][j].position = positn;
(int) positn++;
}
}
}
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|