.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
The Star and the Crescent- Save $9.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old August 7th, 2003, 02:49 AM

tesco samoa tesco samoa is offline
General
 
Join Date: Jul 2001
Location: Canada
Posts: 4,603
Thanks: 0
Thanked 0 Times in 0 Posts
tesco samoa is on a distinguished road
Default Re: Math problem

i posted this earlier

i have a question along this line

say you have 24 numbers and you want to sort them in combinations of 4 where each number only appears once with each other how many combinations would that be ???

now if some one wanted to whip up a little program that does that ( but i can select the numbers (say up to 50), combinations ( 2 to 12 ) and uniqueness ( say once to 6 times ) and can produce a text file output i would be forever thankful

And in VB and send me the source
__________________
RRRRRRRRRRAAAAAGGGGGGGGGHHHHH
old avatar = http://www.shrapnelgames.com/cgi-bin...1051567998.jpg

Hey GUTB where did you go...???

He is still driving his mighty armada at 3 miles per month along the interstellar highway bypass and will be arriving shortly
Reply With Quote
  #2  
Old August 7th, 2003, 02:56 AM

Ack Ack is offline
Private
 
Join Date: Mar 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Ack is on a distinguished road
Default Re: Math problem

The only hard part about that would be using VB. I switched to Perl and haven't used anything else in about 2 years.

Oh yeah. I believe the even equation is simply:

Pg = players per game
n = total number of players

# games = [(1/Pg) Summation (A=1 to A=n)] + 1
Reply With Quote
  #3  
Old August 7th, 2003, 03:01 AM

Ack Ack is offline
Private
 
Join Date: Mar 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Ack is on a distinguished road
Default Re: Math problem

Duh! Algorithm.

1. Drop each combination into an array of n elements. Where n is the number of players per game.
2. Sort each array numerically.
3. Compare each array to the next and discard in duplications.
4. Output the remaining arrays into a text file.

Ugly and inefficient, but a P4 should make short work of it.
Reply With Quote
  #4  
Old August 7th, 2003, 04:38 PM
LGM's Avatar

LGM LGM is offline
Sergeant
 
Join Date: Apr 2001
Location: Minneapolis, MN, USA
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
LGM is on a distinguished road
Default Re: Math problem

I guess I missed Erax's solution for 9 players. To appears that how you pick your combinations matters. My alogorythm finds combinations in a certain manner so it only works for certain numbers. A different method might find other solutions.

An exhaustive method would build all combinations and start eliminating redundant combaintions and each iteration it would pick a different combination of redundants to eliminate. This makes the problem even messier.

I tried doing 9 on paper myself and I couldn't do it. Probably because I did it much the same way I programmed it.

Good news for Geosmo is we have known solutions now for 7,9,15, and 31. Maybe someone else can figure out solutions for 11, 13, 17, 19, ...

I know the even numbers will not work because player 1 must play every other player in three player games. Therefore the number of players opposing player one must be a multiple of 2. Adding in player 1 makes the total number of players an Odd number.

[ August 07, 2003, 15:41: Message edited by: LGM ]
Reply With Quote
  #5  
Old August 7th, 2003, 04:57 PM
LGM's Avatar

LGM LGM is offline
Sergeant
 
Join Date: Apr 2001
Location: Minneapolis, MN, USA
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
LGM is on a distinguished road
Default Re: Math problem

I had an SEIV turn to do Last night (my gracious host is running turns manually while PBW is down). Maybe tonight I can tackle writting a program to find combinations for Geo.

It is an interesting problem. This time I will probably write it in Delphi and make it a Windows executible. I'll need to arrange my data a bit better to back track when I get stuck down a blind alley looking for a solution.

I'll publish the code. Delphi code should be fairly easy for C++ or Java programmers to understand as the language is somewhat similiar.
Reply With Quote
  #6  
Old August 7th, 2003, 05:31 PM
Erax's Avatar

Erax Erax is offline
Captain
 
Join Date: Oct 2002
Location: Brazil
Posts: 827
Thanks: 0
Thanked 0 Times in 0 Posts
Erax is on a distinguished road
Default Re: Math problem

Quote:
I tried doing 9 on paper myself and I couldn't do it. Probably because I did it much the same way I programmed it.
I did it graphically. I set the players up like this :

1 2 3
4 5 6
7 8 9

Then connected them first horizontally, then vertically, then along the diagonals (you have to imagine that the numbers 'wrap around' for the diagonals). To my surprise, this solved it for nine players.
__________________
Have you ever had... the sudden feeling... that God is out to GET YOU?
Well, my girl dumped me and I'm stuck with the raftmates from Hell in the middle of the sea and... what was the question again???
Reply With Quote
  #7  
Old August 7th, 2003, 05:43 PM

tesco samoa tesco samoa is offline
General
 
Join Date: Jul 2001
Location: Canada
Posts: 4,603
Thanks: 0
Thanked 0 Times in 0 Posts
tesco samoa is on a distinguished road
Default Re: Math problem

http://www.singlix.com/download/combinator.html

has the source code for the routine that determines pairing of numbers

It is in turkish but stepping though it will be ok
__________________
RRRRRRRRRRAAAAAGGGGGGGGGHHHHH
old avatar = http://www.shrapnelgames.com/cgi-bin...1051567998.jpg

Hey GUTB where did you go...???

He is still driving his mighty armada at 3 miles per month along the interstellar highway bypass and will be arriving shortly
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 On

Forum Jump


All times are GMT -4. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.