Thread: Mini Games
View Single Post
Old 11-04-2003, 11:13 AM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
sure why not

i didn't really develop it for other people
to look at, so don't be too critical of my code

it's also specifically made to integrate with the vbulletin cookies and login information... so you might have to change some things around. at least you can see the logic though.

Here's the db schema:
Code:
CREATE TABLE `tictactoe` (
  `game_id` int(10) unsigned NOT NULL auto_increment,
  `p1_id` mediumint(8) unsigned NOT NULL default '0',
  `p2_id` mediumint(8) unsigned NOT NULL default '0',
  `turn` char(1) NOT NULL default 'x',
  `start_time` int(14) NOT NULL default '0',
  `end_time` datetime default NULL,
  `winner` varchar(20) default NULL,
  `a1` char(1) default NULL,
  `a2` char(1) default NULL,
  `a3` char(1) default NULL,
  `b1` char(1) default NULL,
  `b2` char(1) default NULL,
  `b3` char(1) default NULL,
  `c1` char(1) default NULL,
  `c2` char(1) default NULL,
  `c3` char(1) default NULL,
  PRIMARY KEY  (`game_id`)
) TYPE=MyISAM AUTO_INCREMENT=25 ;
Attached Files
File Type: txt tic_tac_toe.php.txt (23.2 KB, 9 views)
__________________
Mike
sde is offline   Reply With Quote