Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-02-2003, 12:53 AM   #1 (permalink)
Nitro
Registered User
 
Nitro's Avatar
 
Join Date: Jun 2003
Location: London, England
Posts: 29
Nitro is on a distinguished road
Send a message via AIM to Nitro
Mini Games

I thought it would be a good idea to try and make some php mini-games, however the only mini-game I could think of that could be made is hangman. Does anyone else have any suggestions for php mini-games that would be possible? And, if you know any tutorials, that would make thing easier for me so I could see how these games work. Thanks,
Nitro is offline   Reply With Quote
Old 11-03-2003, 11:41 AM   #2 (permalink)
Hrqls
Regular Contributor
 
Join Date: May 2002
Location: Alkmaar, the Netherlands
Posts: 167
Hrqls is on a distinguished road
tic tac toe
connect 4
go moku (connect 5)
__________________
The specialty of the house? thats me (cheap as always)
Hrqls is offline   Reply With Quote
Old 11-03-2003, 02:02 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
ah yes, how could i forget? http://codenewbie.com/tic_tac_toe.php

__________________
Mike
sde is offline   Reply With Quote
Old 11-04-2003, 09:55 AM   #4 (permalink)
Nitro
Registered User
 
Nitro's Avatar
 
Join Date: Jun 2003
Location: London, England
Posts: 29
Nitro is on a distinguished road
Send a message via AIM to Nitro
Ok Thanks. Hey SDE, I dont suppose your version of tic tac toe is open source? I wouldnt even upload it, i'd just like to see the way it's coded.
Nitro is offline   Reply With Quote
Old 11-04-2003, 10:13 AM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
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
Old 11-04-2003, 10:15 AM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
haha, i was looking through the code just now .. that was coded a long time ago .. there's probably a few good ways to make the code a little more efficient.
__________________
Mike
sde is offline   Reply With Quote
Old 11-04-2003, 06:13 PM   #7 (permalink)
jimmyoctane
Registered User
 
jimmyoctane's Avatar
 
Join Date: Sep 2003
Location: California
Posts: 26
jimmyoctane is on a distinguished road
Send a message via AIM to jimmyoctane
How bout writting it in RPG

Just a thought lets try to write it in RPG.
The graphic part may set us back a bit but I'm
sure we can get the straight lines.



jimmy
jimmyoctane is offline   Reply With Quote
Old 11-04-2003, 06:35 PM   #8 (permalink)
DarkTwilkitri
Registered User
 
Join Date: Feb 2003
Location: Australia
Posts: 21
DarkTwilkitri is on a distinguished road
Who says an RPG has to be graphical?
Mmm... MUDs...


An anagram game would be pretty easy to make in PHP, what with there being a str_shuffle function and all...
DarkTwilkitri is offline   Reply With Quote
Old 11-05-2003, 01:13 PM   #9 (permalink)
Nitro
Registered User
 
Nitro's Avatar
 
Join Date: Jun 2003
Location: London, England
Posts: 29
Nitro is on a distinguished road
Send a message via AIM to Nitro
Actually i'll be honest with you, I do plan to make an RPG once I have my community up and running. I'll fill you guys in on all the details when they come in. Thanks very much sde for the coding, it'll come in very handy. It's ok that things could be more efficient, and that you have the login system on yours and stuff, cause I actually just wanted to see how such a game would work, and also I think I can probably base a few other games off this one, for example that boxes game, you know where you have to join the dots, and whoever gets the most boxes wins.
Nitro is offline   Reply With Quote
Old 11-05-2003, 01:46 PM   #10 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
the RPG that jimmy's talking about is not role playing game, it's a programming language
__________________
Mike
sde is offline   Reply With Quote
Old 11-06-2003, 03:26 AM   #11 (permalink)
Nitro
Registered User
 
Nitro's Avatar
 
Join Date: Jun 2003
Location: London, England
Posts: 29
Nitro is on a distinguished road
Send a message via AIM to Nitro
Lol! Serious? Erm, what kind of programming language? What is it commonly used for?
Nitro is offline   Reply With Quote
Old 11-06-2003, 06:31 AM   #12 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
IBM iSeries AS/400 =)

JimmyO is pretty darn good at it too.
__________________
Mike
sde is offline   Reply With Quote
Old 11-06-2003, 06:37 AM   #13 (permalink)
jimmyoctane
Registered User
 
jimmyoctane's Avatar
 
Join Date: Sep 2003
Location: California
Posts: 26
jimmyoctane is on a distinguished road
Send a message via AIM to jimmyoctane
A dinosaur programmer

Okay....Yes it is a kind of language.

No graphics just those big ugly green screens.

Every time I try to leave and learn a real language they pull me back in .

Jimmy
jimmyoctane is offline   Reply With Quote
Old 11-06-2003, 08:45 AM   #14 (permalink)
Nitro
Registered User
 
Nitro's Avatar
 
Join Date: Jun 2003
Location: London, England
Posts: 29
Nitro is on a distinguished road
Send a message via AIM to Nitro
Lol! Jimmy, can you show me a section of RPG coding please?
Nitro is offline   Reply With Quote
Old 11-11-2003, 06:21 AM   #15 (permalink)
jimmyoctane
Registered User
 
jimmyoctane's Avatar
 
Join Date: Sep 2003
Location: California
Posts: 26
jimmyoctane is on a distinguished road
Send a message via AIM to jimmyoctane
you asked for it

Sorry I just drove From California to Illinois with a five year old.
(yes he is mine ;) )


This hunk reads a table with user info in it.
It then scans for a "," to seperate the first from last.
ex jimmy, octane.


Code:
C*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
/free

// Loop through all records of file 
read file;

dow not %eof(file); // Process until end of file
   if %error;
      dsply 'Read error: process aborting.';
      leave;
   else;
      pos = %scan (',': name);
      if pos > 0;
         firstname = %trimr(%subst(name:1:pos-1));
         update file;
      endif;
   read file;
enddo;

/end-free
C*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
jimmyoctane is offline   Reply With Quote
Reply

Bookmarks

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What programming language were these games made in? Sanehouse All Other Coding Languages 7 08-18-2004 05:02 AM
Creative Player Actions in FPS Online Video Games sde Lounge 2 03-20-2003 07:20 AM


All times are GMT -8. The time now is 10:11 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting