Jump to content

Generate names, random ordered games and cron jobs! (3 questions)


rockinaway

Recommended Posts

Basically I am setting up my own cricket management game, but there are 3 areas that I am slightly stuck on and would appreciate help:

 

1) When a use registers, I need to create 11 players for their team. For this, I am going to have one text files with first names and one text file with surnames. How can I open each file and select a name and then match them together?

 

2) I need to create the list of games to be executed at particular times through a cron job. How can I go through all the teams in a table and match them together in games, ensuring everyone plays everyone? If a new player registers, he will be put into a random league and so the games for that league will have to be redone

 

3) How can I set up a cron job to execute the above games? Each team should play once a day and so if there are 24 teams in a table, there will be 12 games that occur through this cron job. I assume cron jobs are the best thing for this.

 

Any help would be appreciated.

Thanks.

For number 1 I would recommend a database column for each first and surname and then mix in a mysql rand, else have 2 notepad files and select a line at random.

For the rest you are going to have to use your imagination, this isn't programming theory help. :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.