Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 10th, 2004, 12:58 PM   #11
Overmind
Professional Programmer
 
Overmind's Avatar
 
Join Date: Jun 2004
Location: South Africa, Johannesburg
Posts: 301
Rep Power: 5 Overmind is on a distinguished road
lol....8,587 lines to be exact.
__________________
[SIGPIC][/SIGPIC]
Overmind is offline   Reply With Quote
Old Oct 10th, 2004, 1:13 PM   #12
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Oct 10th, 2004, 1:48 PM   #13
Overmind
Professional Programmer
 
Overmind's Avatar
 
Join Date: Jun 2004
Location: South Africa, Johannesburg
Posts: 301
Rep Power: 5 Overmind is on a distinguished road
Minix?
__________________
[SIGPIC][/SIGPIC]
Overmind is offline   Reply With Quote
Old Oct 10th, 2004, 1:58 PM   #14
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Oct 11th, 2004, 2:55 AM   #15
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
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
Berto is offline   Reply With Quote
Old Oct 11th, 2004, 9:00 AM   #16
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Oct 11th, 2004, 9:42 AM   #17
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
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
Berto is offline   Reply With Quote
Old Oct 11th, 2004, 10:56 AM   #18
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Oct 11th, 2004, 12:18 PM   #19
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
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
Berto is offline   Reply With Quote
Old Oct 11th, 2004, 1:46 PM   #20
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
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
Berto is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:58 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC