Combination calculator for Continents...

Topics that are not maps. Discuss general map making concepts, techniques, contests, etc, here.

Moderator: Cartographers

Forum rules
Please read the Community Guidelines before posting.
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Combination calculator for Continents...

Post by yeti_c »

Good Morning Map fans...

I've decided to write a small Java app that creates XML for combinations automatically...

So I've devised the logic for the system - and was wondering if anyone can take a sneaky look and let me know if I've made a mistake...

C.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

X = Size of Set
Y = Size of Combination
Z = Number of counters
etc

For Y we need an array of Z counters

counter Z[1] = 1..X-(Y-1)
counter Z[2] = Z[1]+1..X-(Y-2)
counter Z[3] = Z[2]+1..X-(Y-3)

So

Z[i] = Z[i-1]+1..X-(Y-i)

C.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

For a set of 4 elements X [A,B,C,D] choosing combinations of 3...

We get 4 combinations...

Code: Select all

Z[1]  Z[2]  Z[3]    a       b       c
  1     2     3     X[1]=A  X[2]=B  X[3]=C
  1     2     4     X[1]=A  X[2]=B  X[4]=D
  1     3     4     X[1]=A  X[3]=C  X[4]=D
  2     3     4     X[2]=B  X[3]=C  X[4]=D

So from the top to the bottom we loop the three counters...

So my pseudocode is this...

Code: Select all

loop Z[1]
{
  loop Z[2]
  {
    loop Z[3]
    {
       a = X[Z[1]]
       b = X[Z[2]]
       c = X[Z[3]]
       output combination to XML
    }
  }
}


C.
Last edited by yeti_c on Fri Sep 28, 2007 8:49 am, edited 1 time in total.
Image
Highest score : 2297
User avatar
DiM
Posts: 10415
Joined: Wed Feb 14, 2007 6:20 pm
Gender: Male
Location: making maps for scooby snacks

Post by DiM »

great idea unfortunately after the first post you completely lost me :lol:
“In the beginning God said, the four-dimensional divergence of an antisymmetric, second rank tensor equals zero, and there was light, and it was good. And on the seventh day he rested.”- Michio Kaku
User avatar
Wisse
Posts: 4448
Joined: Fri Oct 13, 2006 2:59 pm
Location: The netherlands, gelderland, epe

Post by Wisse »

DiM wrote:great idea unfortunately after the first post you completely lost me :lol:
x
me 2 :P
Image Image
User avatar
Coleman
Posts: 5402
Joined: Tue Jan 02, 2007 10:36 pm
Gender: Male
Location: Midwest

Post by Coleman »

Looks like the right way to me. I'd be doing it in C, but whatever suits your fancy. Thanks for trying to put something like this together.
Warning: You may be reading a really old topic.
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

C - pah - C doesn't know about XML properly!!!!

C.
Image
Highest score : 2297
User avatar
Coleman
Posts: 5402
Joined: Tue Jan 02, 2007 10:36 pm
Gender: Male
Location: Midwest

Post by Coleman »

It's all just strings anyway. :roll:
Warning: You may be reading a really old topic.
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Fair point...

After 2 pints at lunch time - my head is struggling to get round recursion... no doubt I'll have solved this quandry by monday morning (no net connection on weekends at the mo - hence no games on CC either BOO!!)

C.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Sweet - My test output for my program is this...

Code: Select all

Outtputing Elements : AA, BB, CC,  - 
Outtputing Elements : AA, BB, DD,  -
Outtputing Elements : AA, BB, EE,  -
Outtputing Elements : AA, BB, FF,  -
Outtputing Elements : AA, BB, GG,  -
Outtputing Elements : AA, BB, HH,  -
Outtputing Elements : AA, BB, II,  -
Outtputing Elements : AA, BB, JJ,  -
Outtputing Elements : AA, CC, CC,  -
Outtputing Elements : AA, CC, DD,  -
Outtputing Elements : AA, CC, EE,  -
Outtputing Elements : AA, CC, FF,  -
Outtputing Elements : AA, CC, GG,  -
Outtputing Elements : AA, CC, HH,  -
Outtputing Elements : AA, CC, II,  -
Outtputing Elements : AA, CC, JJ,  -
Outtputing Elements : AA, DD, CC,  -
Outtputing Elements : AA, DD, DD,  -
Outtputing Elements : AA, DD, EE,  -
Outtputing Elements : AA, DD, FF,  -
Outtputing Elements : AA, DD, GG,  -
Outtputing Elements : AA, DD, HH,  -
Outtputing Elements : AA, DD, II,  -
Outtputing Elements : AA, DD, JJ,  -
Outtputing Elements : AA, EE, CC,  -
Outtputing Elements : AA, EE, DD,  -
Outtputing Elements : AA, EE, EE,  -
Outtputing Elements : AA, EE, FF,  -
Outtputing Elements : AA, EE, GG,  -
Outtputing Elements : AA, EE, HH,  -
Outtputing Elements : AA, EE, II,  -
Outtputing Elements : AA, EE, JJ,  -
Outtputing Elements : AA, FF, CC,  -
Outtputing Elements : AA, FF, DD,  -
Outtputing Elements : AA, FF, EE,  -
Outtputing Elements : AA, FF, FF,  -
Outtputing Elements : AA, FF, GG,  -
Outtputing Elements : AA, FF, HH,  -
Outtputing Elements : AA, FF, II,  -
Outtputing Elements : AA, FF, JJ,  -
Outtputing Elements : AA, GG, CC,  -
Outtputing Elements : AA, GG, DD,  -
Outtputing Elements : AA, GG, EE,  -
Outtputing Elements : AA, GG, FF,  -
Outtputing Elements : AA, GG, GG,  -
Outtputing Elements : AA, GG, HH,  -
Outtputing Elements : AA, GG, II,  -
Outtputing Elements : AA, GG, JJ,  -
Outtputing Elements : AA, HH, CC,  -
Outtputing Elements : AA, HH, DD,  -
Outtputing Elements : AA, HH, EE,  -
Outtputing Elements : AA, HH, FF,  -
Outtputing Elements : AA, HH, GG,  -
Outtputing Elements : AA, HH, HH,  -
Outtputing Elements : AA, HH, II,  -
Outtputing Elements : AA, HH, JJ,  -
Outtputing Elements : AA, II, CC,  -
Outtputing Elements : AA, II, DD,  -
Outtputing Elements : AA, II, EE,  -
Outtputing Elements : AA, II, FF,  -
Outtputing Elements : AA, II, GG,  -
Outtputing Elements : AA, II, HH,  -
Outtputing Elements : AA, II, II,  -
Outtputing Elements : AA, II, JJ,  -
Outtputing Elements : BB, BB, CC,  -
Outtputing Elements : BB, BB, DD,  -
Outtputing Elements : BB, BB, EE,  -
Outtputing Elements : BB, BB, FF,  -
Outtputing Elements : BB, BB, GG,  -
Outtputing Elements : BB, BB, HH,  -
Outtputing Elements : BB, BB, II,  -
Outtputing Elements : BB, BB, JJ,  -
Outtputing Elements : BB, CC, CC,  -
Outtputing Elements : BB, CC, DD,  -
Outtputing Elements : BB, CC, EE,  -
Outtputing Elements : BB, CC, FF,  -
Outtputing Elements : BB, CC, GG,  -
Outtputing Elements : BB, CC, HH,  -
Outtputing Elements : BB, CC, II,  -
Outtputing Elements : BB, CC, JJ,  -
Outtputing Elements : BB, DD, CC,  -
Outtputing Elements : BB, DD, DD,  -
Outtputing Elements : BB, DD, EE,  -
Outtputing Elements : BB, DD, FF,  -
Outtputing Elements : BB, DD, GG,  -
Outtputing Elements : BB, DD, HH,  -
Outtputing Elements : BB, DD, II,  -
Outtputing Elements : BB, DD, JJ,  -
Outtputing Elements : BB, EE, CC,  -
Outtputing Elements : BB, EE, DD,  -
Outtputing Elements : BB, EE, EE,  -
Outtputing Elements : BB, EE, FF,  -
Outtputing Elements : BB, EE, GG,  -
Outtputing Elements : BB, EE, HH,  -
Outtputing Elements : BB, EE, II,  -
Outtputing Elements : BB, EE, JJ,  -
Outtputing Elements : BB, FF, CC,  -
Outtputing Elements : BB, FF, DD,  -
Outtputing Elements : BB, FF, EE,  -
Outtputing Elements : BB, FF, FF,  -
Outtputing Elements : BB, FF, GG,  -
Outtputing Elements : BB, FF, HH,  -
Outtputing Elements : BB, FF, II,  -
Outtputing Elements : BB, FF, JJ,  -
Outtputing Elements : BB, GG, CC,  -
Outtputing Elements : BB, GG, DD,  -
Outtputing Elements : BB, GG, EE,  -
Outtputing Elements : BB, GG, FF,  -
Outtputing Elements : BB, GG, GG,  -
Outtputing Elements : BB, GG, HH,  -
Outtputing Elements : BB, GG, II,  -
Outtputing Elements : BB, GG, JJ,  -
Outtputing Elements : BB, HH, CC,  -
Outtputing Elements : BB, HH, DD,  -
Outtputing Elements : BB, HH, EE,  -
Outtputing Elements : BB, HH, FF,  -
Outtputing Elements : BB, HH, GG,  -
Outtputing Elements : BB, HH, HH,  -
Outtputing Elements : BB, HH, II,  -
Outtputing Elements : BB, HH, JJ,  -
Outtputing Elements : BB, II, CC,  -
Outtputing Elements : BB, II, DD,  -
Outtputing Elements : BB, II, EE,  -
Outtputing Elements : BB, II, FF,  -
Outtputing Elements : BB, II, GG,  -
Outtputing Elements : BB, II, HH,  -
Outtputing Elements : BB, II, II,  -
Outtputing Elements : BB, II, JJ,  -
Outtputing Elements : CC, BB, CC,  -
Outtputing Elements : CC, BB, DD,  -
Outtputing Elements : CC, BB, EE,  -
Outtputing Elements : CC, BB, FF,  -
Outtputing Elements : CC, BB, GG,  -
Outtputing Elements : CC, BB, HH,  -
Outtputing Elements : CC, BB, II,  -
Outtputing Elements : CC, BB, JJ,  -
Outtputing Elements : CC, CC, CC,  -
Outtputing Elements : CC, CC, DD,  -
Outtputing Elements : CC, CC, EE,  -
Outtputing Elements : CC, CC, FF,  -
Outtputing Elements : CC, CC, GG,  -
Outtputing Elements : CC, CC, HH,  -
Outtputing Elements : CC, CC, II,  -
Outtputing Elements : CC, CC, JJ,  -
Outtputing Elements : CC, DD, CC,  -
Outtputing Elements : CC, DD, DD,  -
Outtputing Elements : CC, DD, EE,  -
Outtputing Elements : CC, DD, FF,  -
Outtputing Elements : CC, DD, GG,  -
Outtputing Elements : CC, DD, HH,  -
Outtputing Elements : CC, DD, II,  -
Outtputing Elements : CC, DD, JJ,  -
Outtputing Elements : CC, EE, CC,  -
Outtputing Elements : CC, EE, DD,  -
Outtputing Elements : CC, EE, EE,  -
Outtputing Elements : CC, EE, FF,  -
Outtputing Elements : CC, EE, GG,  -
Outtputing Elements : CC, EE, HH,  -
Outtputing Elements : CC, EE, II,  -
Outtputing Elements : CC, EE, JJ,  -
Outtputing Elements : CC, FF, CC,  -
Outtputing Elements : CC, FF, DD,  -
Outtputing Elements : CC, FF, EE,  -
Outtputing Elements : CC, FF, FF,  -
Outtputing Elements : CC, FF, GG,  -
Outtputing Elements : CC, FF, HH,  -
Outtputing Elements : CC, FF, II,  -
Outtputing Elements : CC, FF, JJ,  -
Outtputing Elements : CC, GG, CC,  -
Outtputing Elements : CC, GG, DD,  -
Outtputing Elements : CC, GG, EE,  -
Outtputing Elements : CC, GG, FF,  -
Outtputing Elements : CC, GG, GG,  -
Outtputing Elements : CC, GG, HH,  -
Outtputing Elements : CC, GG, II,  -
Outtputing Elements : CC, GG, JJ,  -
Outtputing Elements : CC, HH, CC,  -
Outtputing Elements : CC, HH, DD,  -
Outtputing Elements : CC, HH, EE,  -
Outtputing Elements : CC, HH, FF,  -
Outtputing Elements : CC, HH, GG,  -
Outtputing Elements : CC, HH, HH,  -
Outtputing Elements : CC, HH, II,  -
Outtputing Elements : CC, HH, JJ,  -
Outtputing Elements : CC, II, CC,  -
Outtputing Elements : CC, II, DD,  -
Outtputing Elements : CC, II, EE,  -
Outtputing Elements : CC, II, FF,  -
Outtputing Elements : CC, II, GG,  -
Outtputing Elements : CC, II, HH,  -
Outtputing Elements : CC, II, II,  -
Outtputing Elements : CC, II, JJ,  -
Outtputing Elements : DD, BB, CC,  -
Outtputing Elements : DD, BB, DD,  -
Outtputing Elements : DD, BB, EE,  -
Outtputing Elements : DD, BB, FF,  -
Outtputing Elements : DD, BB, GG,  -
Outtputing Elements : DD, BB, HH,  -
Outtputing Elements : DD, BB, II,  -
Outtputing Elements : DD, BB, JJ,  -
Outtputing Elements : DD, CC, CC,  -
Outtputing Elements : DD, CC, DD,  -
Outtputing Elements : DD, CC, EE,  -
Outtputing Elements : DD, CC, FF,  -
Outtputing Elements : DD, CC, GG,  -
Outtputing Elements : DD, CC, HH,  -
Outtputing Elements : DD, CC, II,  -
Outtputing Elements : DD, CC, JJ,  -
Outtputing Elements : DD, DD, CC,  -
Outtputing Elements : DD, DD, DD,  -
Outtputing Elements : DD, DD, EE,  -
Outtputing Elements : DD, DD, FF,  -
Outtputing Elements : DD, DD, GG,  -
Outtputing Elements : DD, DD, HH,  -
Outtputing Elements : DD, DD, II,  -
Outtputing Elements : DD, DD, JJ,  -
Outtputing Elements : DD, EE, CC,  -
Outtputing Elements : DD, EE, DD,  -
Outtputing Elements : DD, EE, EE,  -
Outtputing Elements : DD, EE, FF,  -
Outtputing Elements : DD, EE, GG,  -
Outtputing Elements : DD, EE, HH,  -
Outtputing Elements : DD, EE, II,  -
Outtputing Elements : DD, EE, JJ,  -
Outtputing Elements : DD, FF, CC,  -
Outtputing Elements : DD, FF, DD,  -
Outtputing Elements : DD, FF, EE,  -
Outtputing Elements : DD, FF, FF,  -
Outtputing Elements : DD, FF, GG,  -
Outtputing Elements : DD, FF, HH,  -
Outtputing Elements : DD, FF, II,  -
Outtputing Elements : DD, FF, JJ,  -
Outtputing Elements : DD, GG, CC,  -
Outtputing Elements : DD, GG, DD,  -
Outtputing Elements : DD, GG, EE,  -
Outtputing Elements : DD, GG, FF,  -
Outtputing Elements : DD, GG, GG,  -
Outtputing Elements : DD, GG, HH,  -
Outtputing Elements : DD, GG, II,  -
Outtputing Elements : DD, GG, JJ,  -
Outtputing Elements : DD, HH, CC,  -
Outtputing Elements : DD, HH, DD,  -
Outtputing Elements : DD, HH, EE,  -
Outtputing Elements : DD, HH, FF,  -
Outtputing Elements : DD, HH, GG,  -
Outtputing Elements : DD, HH, HH,  -
Outtputing Elements : DD, HH, II,  -
Outtputing Elements : DD, HH, JJ,  -
Outtputing Elements : DD, II, CC,  -
Outtputing Elements : DD, II, DD,  -
Outtputing Elements : DD, II, EE,  -
Outtputing Elements : DD, II, FF,  -
Outtputing Elements : DD, II, GG,  -
Outtputing Elements : DD, II, HH,  -
Outtputing Elements : DD, II, II,  -
Outtputing Elements : DD, II, JJ,  -
Outtputing Elements : EE, BB, CC,  -
Outtputing Elements : EE, BB, DD,  -
Outtputing Elements : EE, BB, EE,  -
Outtputing Elements : EE, BB, FF,  -
Outtputing Elements : EE, BB, GG,  -
Outtputing Elements : EE, BB, HH,  -
Outtputing Elements : EE, BB, II,  -
Outtputing Elements : EE, BB, JJ,  -
Outtputing Elements : EE, CC, CC,  -
Outtputing Elements : EE, CC, DD,  -
Outtputing Elements : EE, CC, EE,  -
Outtputing Elements : EE, CC, FF,  -
Outtputing Elements : EE, CC, GG,  -
Outtputing Elements : EE, CC, HH,  -
Outtputing Elements : EE, CC, II,  -
Outtputing Elements : EE, CC, JJ,  -
Outtputing Elements : EE, DD, CC,  -
Outtputing Elements : EE, DD, DD,  -
Outtputing Elements : EE, DD, EE,  -
Outtputing Elements : EE, DD, FF,  -
Outtputing Elements : EE, DD, GG,  -
Outtputing Elements : EE, DD, HH,  -
Outtputing Elements : EE, DD, II,  -
Outtputing Elements : EE, DD, JJ,  -
Outtputing Elements : EE, EE, CC,  -
Outtputing Elements : EE, EE, DD,  -
Outtputing Elements : EE, EE, EE,  -
Outtputing Elements : EE, EE, FF,  -
Outtputing Elements : EE, EE, GG,  -
Outtputing Elements : EE, EE, HH,  -
Outtputing Elements : EE, EE, II,  -
Outtputing Elements : EE, EE, JJ,  -
Outtputing Elements : EE, FF, CC,  -
Outtputing Elements : EE, FF, DD,  -
Outtputing Elements : EE, FF, EE,  -
Outtputing Elements : EE, FF, FF,  -
Outtputing Elements : EE, FF, GG,  -
Outtputing Elements : EE, FF, HH,  -
Outtputing Elements : EE, FF, II,  -
Outtputing Elements : EE, FF, JJ,  -
Outtputing Elements : EE, GG, CC,  -
Outtputing Elements : EE, GG, DD,  -
Outtputing Elements : EE, GG, EE,  -
Outtputing Elements : EE, GG, FF,  -
Outtputing Elements : EE, GG, GG,  -
Outtputing Elements : EE, GG, HH,  -
Outtputing Elements : EE, GG, II,  -
Outtputing Elements : EE, GG, JJ,  -
Outtputing Elements : EE, HH, CC,  -
Outtputing Elements : EE, HH, DD,  -
Outtputing Elements : EE, HH, EE,  -
Outtputing Elements : EE, HH, FF,  -
Outtputing Elements : EE, HH, GG,  -
Outtputing Elements : EE, HH, HH,  -
Outtputing Elements : EE, HH, II,  -
Outtputing Elements : EE, HH, JJ,  -
Outtputing Elements : EE, II, CC,  -
Outtputing Elements : EE, II, DD,  -
Outtputing Elements : EE, II, EE,  -
Outtputing Elements : EE, II, FF,  -
Outtputing Elements : EE, II, GG,  -
Outtputing Elements : EE, II, HH,  -
Outtputing Elements : EE, II, II,  -
Outtputing Elements : EE, II, JJ,  -
Outtputing Elements : FF, BB, CC,  -
Outtputing Elements : FF, BB, DD,  -
Outtputing Elements : FF, BB, EE,  -
Outtputing Elements : FF, BB, FF,  -
Outtputing Elements : FF, BB, GG,  -
Outtputing Elements : FF, BB, HH,  -
Outtputing Elements : FF, BB, II,  -
Outtputing Elements : FF, BB, JJ,  -
Outtputing Elements : FF, CC, CC,  -
Outtputing Elements : FF, CC, DD,  -
Outtputing Elements : FF, CC, EE,  -
Outtputing Elements : FF, CC, FF,  -
Outtputing Elements : FF, CC, GG,  -
Outtputing Elements : FF, CC, HH,  -
Outtputing Elements : FF, CC, II,  -
Outtputing Elements : FF, CC, JJ,  -
Outtputing Elements : FF, DD, CC,  -
Outtputing Elements : FF, DD, DD,  -
Outtputing Elements : FF, DD, EE,  -
Outtputing Elements : FF, DD, FF,  -
Outtputing Elements : FF, DD, GG,  -
Outtputing Elements : FF, DD, HH,  -
Outtputing Elements : FF, DD, II,  -
Outtputing Elements : FF, DD, JJ,  -
Outtputing Elements : FF, EE, CC,  -
Outtputing Elements : FF, EE, DD,  -
Outtputing Elements : FF, EE, EE,  -
Outtputing Elements : FF, EE, FF,  -
Outtputing Elements : FF, EE, GG,  -
Outtputing Elements : FF, EE, HH,  -
Outtputing Elements : FF, EE, II,  -
Outtputing Elements : FF, EE, JJ,  -
Outtputing Elements : FF, FF, CC,  -
Outtputing Elements : FF, FF, DD,  -
Outtputing Elements : FF, FF, EE,  -
Outtputing Elements : FF, FF, FF,  -
Outtputing Elements : FF, FF, GG,  -
Outtputing Elements : FF, FF, HH,  -
Outtputing Elements : FF, FF, II,  -
Outtputing Elements : FF, FF, JJ,  -
Outtputing Elements : FF, GG, CC,  -
Outtputing Elements : FF, GG, DD,  -
Outtputing Elements : FF, GG, EE,  -
Outtputing Elements : FF, GG, FF,  -
Outtputing Elements : FF, GG, GG,  -
Outtputing Elements : FF, GG, HH,  -
Outtputing Elements : FF, GG, II,  -
Outtputing Elements : FF, GG, JJ,  -
Outtputing Elements : FF, HH, CC,  -
Outtputing Elements : FF, HH, DD,  -
Outtputing Elements : FF, HH, EE,  -
Outtputing Elements : FF, HH, FF,  -
Outtputing Elements : FF, HH, GG,  -
Outtputing Elements : FF, HH, HH,  -
Outtputing Elements : FF, HH, II,  -
Outtputing Elements : FF, HH, JJ,  -
Outtputing Elements : FF, II, CC,  -
Outtputing Elements : FF, II, DD,  -
Outtputing Elements : FF, II, EE,  -
Outtputing Elements : FF, II, FF,  -
Outtputing Elements : FF, II, GG,  -
Outtputing Elements : FF, II, HH,  -
Outtputing Elements : FF, II, II,  -
Outtputing Elements : FF, II, JJ,  -
Outtputing Elements : GG, BB, CC,  -
Outtputing Elements : GG, BB, DD,  -
Outtputing Elements : GG, BB, EE,  -
Outtputing Elements : GG, BB, FF,  -
Outtputing Elements : GG, BB, GG,  -
Outtputing Elements : GG, BB, HH,  -
Outtputing Elements : GG, BB, II,  -
Outtputing Elements : GG, BB, JJ,  -
Outtputing Elements : GG, CC, CC,  -
Outtputing Elements : GG, CC, DD,  -
Outtputing Elements : GG, CC, EE,  -
Outtputing Elements : GG, CC, FF,  -
Outtputing Elements : GG, CC, GG,  -
Outtputing Elements : GG, CC, HH,  -
Outtputing Elements : GG, CC, II,  -
Outtputing Elements : GG, CC, JJ,  -
Outtputing Elements : GG, DD, CC,  -
Outtputing Elements : GG, DD, DD,  -
Outtputing Elements : GG, DD, EE,  -
Outtputing Elements : GG, DD, FF,  -
Outtputing Elements : GG, DD, GG,  -
Outtputing Elements : GG, DD, HH,  -
Outtputing Elements : GG, DD, II,  -
Outtputing Elements : GG, DD, JJ,  -
Outtputing Elements : GG, EE, CC,  -
Outtputing Elements : GG, EE, DD,  -
Outtputing Elements : GG, EE, EE,  -
Outtputing Elements : GG, EE, FF,  -
Outtputing Elements : GG, EE, GG,  -
Outtputing Elements : GG, EE, HH,  -
Outtputing Elements : GG, EE, II,  -
Outtputing Elements : GG, EE, JJ,  -
Outtputing Elements : GG, FF, CC,  -
Outtputing Elements : GG, FF, DD,  -
Outtputing Elements : GG, FF, EE,  -
Outtputing Elements : GG, FF, FF,  -
Outtputing Elements : GG, FF, GG,  -
Outtputing Elements : GG, FF, HH,  -
Outtputing Elements : GG, FF, II,  -
Outtputing Elements : GG, FF, JJ,  -
Outtputing Elements : GG, GG, CC,  -
Outtputing Elements : GG, GG, DD,  -
Outtputing Elements : GG, GG, EE,  -
Outtputing Elements : GG, GG, FF,  -
Outtputing Elements : GG, GG, GG,  -
Outtputing Elements : GG, GG, HH,  -
Outtputing Elements : GG, GG, II,  -
Outtputing Elements : GG, GG, JJ,  -
Outtputing Elements : GG, HH, CC,  -
Outtputing Elements : GG, HH, DD,  -
Outtputing Elements : GG, HH, EE,  -
Outtputing Elements : GG, HH, FF,  -
Outtputing Elements : GG, HH, GG,  -
Outtputing Elements : GG, HH, HH,  -
Outtputing Elements : GG, HH, II,  -
Outtputing Elements : GG, HH, JJ,  -
Outtputing Elements : GG, II, CC,  -
Outtputing Elements : GG, II, DD,  -
Outtputing Elements : GG, II, EE,  -
Outtputing Elements : GG, II, FF,  -
Outtputing Elements : GG, II, GG,  -
Outtputing Elements : GG, II, HH,  -
Outtputing Elements : GG, II, II,  -
Outtputing Elements : GG, II, JJ,  -
Outtputing Elements : HH, BB, CC,  -
Outtputing Elements : HH, BB, DD,  -
Outtputing Elements : HH, BB, EE,  -
Outtputing Elements : HH, BB, FF,  -
Outtputing Elements : HH, BB, GG,  -
Outtputing Elements : HH, BB, HH,  -
Outtputing Elements : HH, BB, II,  -
Outtputing Elements : HH, BB, JJ,  -
Outtputing Elements : HH, CC, CC,  -
Outtputing Elements : HH, CC, DD,  -
Outtputing Elements : HH, CC, EE,  -
Outtputing Elements : HH, CC, FF,  -
Outtputing Elements : HH, CC, GG,  -
Outtputing Elements : HH, CC, HH,  -
Outtputing Elements : HH, CC, II,  -
Outtputing Elements : HH, CC, JJ,  -
Outtputing Elements : HH, DD, CC,  -
Outtputing Elements : HH, DD, DD,  -
Outtputing Elements : HH, DD, EE,  -
Outtputing Elements : HH, DD, FF,  -
Outtputing Elements : HH, DD, GG,  -
Outtputing Elements : HH, DD, HH,  -
Outtputing Elements : HH, DD, II,  -
Outtputing Elements : HH, DD, JJ,  -
Outtputing Elements : HH, EE, CC,  -
Outtputing Elements : HH, EE, DD,  -
Outtputing Elements : HH, EE, EE,  -
Outtputing Elements : HH, EE, FF,  -
Outtputing Elements : HH, EE, GG,  -
Outtputing Elements : HH, EE, HH,  -
Outtputing Elements : HH, EE, II,  -
Outtputing Elements : HH, EE, JJ,  -
Outtputing Elements : HH, FF, CC,  -
Outtputing Elements : HH, FF, DD,  -
Outtputing Elements : HH, FF, EE,  -
Outtputing Elements : HH, FF, FF,  -
Outtputing Elements : HH, FF, GG,  -
Outtputing Elements : HH, FF, HH,  -
Outtputing Elements : HH, FF, II,  -
Outtputing Elements : HH, FF, JJ,  -
Outtputing Elements : HH, GG, CC,  -
Outtputing Elements : HH, GG, DD,  -
Outtputing Elements : HH, GG, EE,  -
Outtputing Elements : HH, GG, FF,  -
Outtputing Elements : HH, GG, GG,  -
Outtputing Elements : HH, GG, HH,  -
Outtputing Elements : HH, GG, II,  -
Outtputing Elements : HH, GG, JJ,  -
Outtputing Elements : HH, HH, CC,  -
Outtputing Elements : HH, HH, DD,  -
Outtputing Elements : HH, HH, EE,  -
Outtputing Elements : HH, HH, FF,  -
Outtputing Elements : HH, HH, GG,  -
Outtputing Elements : HH, HH, HH,  -
Outtputing Elements : HH, HH, II,  -
Outtputing Elements : HH, HH, JJ,  -
Outtputing Elements : HH, II, CC,  -
Outtputing Elements : HH, II, DD,  -
Outtputing Elements : HH, II, EE,  -
Outtputing Elements : HH, II, FF,  -
Outtputing Elements : HH, II, GG,  -
Outtputing Elements : HH, II, HH,  -
Outtputing Elements : HH, II, II,  -
Outtputing Elements : HH, II, JJ,  -
Total outputted 512


Where the components were

AA, BB, CC, DD, EE, FF, GG, HH, II, JJ
and we're selecting groups of 3...

C.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Now all I need to do is make it good output - i.e. continent worthy...

And make it easily configurable - i.e. read an XML file to take in what you want.

C.
Image
Highest score : 2297
User avatar
cairnswk
Posts: 11510
Joined: Sat Feb 03, 2007 8:32 pm
Gender: Male
Location: Australia

Post by cairnswk »

yeti_c, i'd been keeping up with you until U had those pints for lunch...

Now i'm lost like DiM...

**if you can't beat 'em, baffle 'em with bull!** something like that :) :wink:
Image
* Pearl Harbour * Waterloo * Forbidden City * Jamaica * Pot Mosbi
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Bugger - I've noticed my output isn't correct...

Back to the looping drawing board...

C.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Right sorted it out...

Check this output...

Code: Select all

Outtputing Elements : AA, BB, CC,  - 
Outtputing Elements : AA, BB, DD,  -
Outtputing Elements : AA, BB, EE,  -
Outtputing Elements : AA, BB, FF,  -
Outtputing Elements : AA, BB, GG,  -
Outtputing Elements : AA, BB, HH,  -
Outtputing Elements : AA, BB, II,  -
Outtputing Elements : AA, BB, JJ,  -
Outtputing Elements : AA, CC, DD,  -
Outtputing Elements : AA, CC, EE,  -
Outtputing Elements : AA, CC, FF,  -
Outtputing Elements : AA, CC, GG,  -
Outtputing Elements : AA, CC, HH,  -
Outtputing Elements : AA, CC, II,  -
Outtputing Elements : AA, CC, JJ,  -
Outtputing Elements : AA, DD, EE,  -
Outtputing Elements : AA, DD, FF,  -
Outtputing Elements : AA, DD, GG,  -
Outtputing Elements : AA, DD, HH,  -
Outtputing Elements : AA, DD, II,  -
Outtputing Elements : AA, DD, JJ,  -
Outtputing Elements : AA, EE, FF,  -
Outtputing Elements : AA, EE, GG,  -
Outtputing Elements : AA, EE, HH,  -
Outtputing Elements : AA, EE, II,  -
Outtputing Elements : AA, EE, JJ,  -
Outtputing Elements : AA, FF, GG,  -
Outtputing Elements : AA, FF, HH,  -
Outtputing Elements : AA, FF, II,  -
Outtputing Elements : AA, FF, JJ,  -
Outtputing Elements : AA, GG, HH,  -
Outtputing Elements : AA, GG, II,  -
Outtputing Elements : AA, GG, JJ,  -
Outtputing Elements : AA, HH, II,  -
Outtputing Elements : AA, HH, JJ,  -
Outtputing Elements : AA, II, JJ,  -
Outtputing Elements : BB, CC, DD,  -
Outtputing Elements : BB, CC, EE,  -
Outtputing Elements : BB, CC, FF,  -
Outtputing Elements : BB, CC, GG,  -
Outtputing Elements : BB, CC, HH,  -
Outtputing Elements : BB, CC, II,  -
Outtputing Elements : BB, CC, JJ,  -
Outtputing Elements : BB, DD, EE,  -
Outtputing Elements : BB, DD, FF,  -
Outtputing Elements : BB, DD, GG,  -
Outtputing Elements : BB, DD, HH,  -
Outtputing Elements : BB, DD, II,  -
Outtputing Elements : BB, DD, JJ,  -
Outtputing Elements : BB, EE, FF,  -
Outtputing Elements : BB, EE, GG,  -
Outtputing Elements : BB, EE, HH,  -
Outtputing Elements : BB, EE, II,  -
Outtputing Elements : BB, EE, JJ,  -
Outtputing Elements : BB, FF, GG,  -
Outtputing Elements : BB, FF, HH,  -
Outtputing Elements : BB, FF, II,  -
Outtputing Elements : BB, FF, JJ,  -
Outtputing Elements : BB, GG, HH,  -
Outtputing Elements : BB, GG, II,  -
Outtputing Elements : BB, GG, JJ,  -
Outtputing Elements : BB, HH, II,  -
Outtputing Elements : BB, HH, JJ,  -
Outtputing Elements : BB, II, JJ,  -
Outtputing Elements : CC, DD, EE,  -
Outtputing Elements : CC, DD, FF,  -
Outtputing Elements : CC, DD, GG,  -
Outtputing Elements : CC, DD, HH,  -
Outtputing Elements : CC, DD, II,  -
Outtputing Elements : CC, DD, JJ,  -
Outtputing Elements : CC, EE, FF,  -
Outtputing Elements : CC, EE, GG,  -
Outtputing Elements : CC, EE, HH,  -
Outtputing Elements : CC, EE, II,  -
Outtputing Elements : CC, EE, JJ,  -
Outtputing Elements : CC, FF, GG,  -
Outtputing Elements : CC, FF, HH,  -
Outtputing Elements : CC, FF, II,  -
Outtputing Elements : CC, FF, JJ,  -
Outtputing Elements : CC, GG, HH,  -
Outtputing Elements : CC, GG, II,  -
Outtputing Elements : CC, GG, JJ,  -
Outtputing Elements : CC, HH, II,  -
Outtputing Elements : CC, HH, JJ,  -
Outtputing Elements : CC, II, JJ,  -
Outtputing Elements : DD, EE, FF,  -
Outtputing Elements : DD, EE, GG,  -
Outtputing Elements : DD, EE, HH,  -
Outtputing Elements : DD, EE, II,  -
Outtputing Elements : DD, EE, JJ,  -
Outtputing Elements : DD, FF, GG,  -
Outtputing Elements : DD, FF, HH,  -
Outtputing Elements : DD, FF, II,  -
Outtputing Elements : DD, FF, JJ,  -
Outtputing Elements : DD, GG, HH,  -
Outtputing Elements : DD, GG, II,  -
Outtputing Elements : DD, GG, JJ,  -
Outtputing Elements : DD, HH, II,  -
Outtputing Elements : DD, HH, JJ,  -
Outtputing Elements : DD, II, JJ,  -
Outtputing Elements : EE, FF, GG,  -
Outtputing Elements : EE, FF, HH,  -
Outtputing Elements : EE, FF, II,  -
Outtputing Elements : EE, FF, JJ,  -
Outtputing Elements : EE, GG, HH,  -
Outtputing Elements : EE, GG, II,  -
Outtputing Elements : EE, GG, JJ,  -
Outtputing Elements : EE, HH, II,  -
Outtputing Elements : EE, HH, JJ,  -
Outtputing Elements : EE, II, JJ,  -
Outtputing Elements : FF, GG, HH,  -
Outtputing Elements : FF, GG, II,  -
Outtputing Elements : FF, GG, JJ,  -
Outtputing Elements : FF, HH, II,  -
Outtputing Elements : FF, HH, JJ,  -
Outtputing Elements : FF, II, JJ,  -
Outtputing Elements : GG, HH, II,  -
Outtputing Elements : GG, HH, JJ,  -
Outtputing Elements : GG, II, JJ,  -
Outtputing Elements : HH, II, JJ,  -
Total outputted 120


C.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

My additional loops were starting at the beginning again and not incremented from my loop...

Sorted...

C.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Almost there now...

Code: Select all

I've removed the horrid version of this now!!!


C.
Last edited by yeti_c on Mon Oct 01, 2007 8:12 am, edited 1 time in total.
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Got it...

Now to make it easily configurable... should be easy...

C.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<map>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>CC</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>DD</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>EE</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>DD</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>EE</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>EE</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>FF</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>FF</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>FF</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>FF</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>GG</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>GG</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>GG</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>HH</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>HH</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>AA</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>DD</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>EE</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>EE</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>FF</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>FF</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>FF</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>FF</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>GG</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>GG</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>GG</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>HH</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>HH</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>BB</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>EE</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>FF</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>FF</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>FF</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>FF</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>GG</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>GG</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>GG</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>HH</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>HH</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>CC</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>FF</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>FF</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>FF</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>FF</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>FF</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>GG</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>GG</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>GG</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>HH</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>HH</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>DD</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>FF</component>
      <component>GG</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>FF</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>FF</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>FF</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>GG</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>GG</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>GG</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>HH</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>HH</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>EE</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>FF</component>
      <component>GG</component>
      <component>HH</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>FF</component>
      <component>GG</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>FF</component>
      <component>GG</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>FF</component>
      <component>HH</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>FF</component>
      <component>HH</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>FF</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>GG</component>
      <component>HH</component>
      <component>II</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>GG</component>
      <component>HH</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>GG</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
  <continent>
    <name>test group</name>
    <bonus>2</bonus>
    <components>
      <component>HH</component>
      <component>II</component>
      <component>JJ</component>
    </components>
  </continent>
</map>
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

OK then...

Here's the config file...

Code: Select all

<?xml version="1.0"?>
<config>
   <amount>4</amount><!-- number in set for group-->
   <components><!-- components in the group by name -->
      <component>AA</component>
      <component>BB</component>
      <component>CC</component>
      <component>DD</component>
      <component>EE</component>
      <component>FF</component>
      <component>GG</component>
      <component>HH</component>
   </components>
   <name>name</name><!-- name of the continent-->
   <bonus>4</bonus><!-- bonus amount -->
   <!-- any overrides to be added -->
   <overrides>
      <override>dave</override>
   </overrides>
</config>


Essentially the small program will require you to fill out a config file for it to run from... this is what it should look like...

The program will run from a command line with 2 arguments.

i.e. java XMLComboGenerator config.xml output.xml

The first will be the path to the config.xml file - and the second will be the path to the output.xml file (including filename)

With the above config file - you get the following output.xml...

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<map>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>CC</component>
      <component>DD</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>CC</component>
      <component>EE</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>CC</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>CC</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>CC</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>DD</component>
      <component>EE</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>DD</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>DD</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>DD</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>EE</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>EE</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>EE</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>BB</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>DD</component>
      <component>EE</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>DD</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>DD</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>DD</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>EE</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>EE</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>EE</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>CC</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>EE</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>EE</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>EE</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>DD</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>EE</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>AA</component>
      <component>FF</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>DD</component>
      <component>EE</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>DD</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>DD</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>DD</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>EE</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>EE</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>EE</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>CC</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>EE</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>EE</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>EE</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>DD</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>EE</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>BB</component>
      <component>FF</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>EE</component>
      <component>FF</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>EE</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>EE</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>DD</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>EE</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>CC</component>
      <component>FF</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>FF</component>
      <component>GG</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>FF</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>DD</component>
      <component>EE</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>DD</component>
      <component>FF</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
  <continent>
    <name>name</name>
    <bonus>4</bonus>
    <components>
      <component>EE</component>
      <component>FF</component>
      <component>GG</component>
      <component>HH</component>
    </components>
    <overrides>
      <override>dave</override>
    </overrides>
  </continent>
</map>


Now the problem is - how to deliver this to you the punter... It might be easier if I get Lack to host it online here - as it requries JDOM.jar to run it...

C.
Image
Highest score : 2297
User avatar
Sierra_Leon
Posts: 952
Joined: Mon Jan 08, 2007 4:49 pm
Location: The Netherlands

Post by Sierra_Leon »

I'm not completely clear on what you're trying to achieve. Components are the countries that make up the continents, right? So your program would write XML that groups every 4 countries into every possible continent? I don't see how that is useful.. :?
Btw I'm not trying to shoot down any ideas here, I'm just trying to understand what you want to achieve. I know XML and java (and I'm pretty bored at work atm), so maybe I can help somehow.
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Sierra_Leon wrote:I'm not completely clear on what you're trying to achieve. Components are the countries that make up the continents, right? So your program would write XML that groups every 4 countries into every possible continent? I don't see how that is useful.. :?
Btw I'm not trying to shoot down any ideas here, I'm just trying to understand what you want to achieve. I know XML and java (and I'm pretty bored at work atm), so maybe I can help somehow.


Hi Sierra,

The problem here is that for some maps you need to create a continent based on, say, 5 out of 10 countries... so to ensure that you know when you have all of these countries you have to write out each and every combination of those 5 countries within the set of 10 countries...

This little Java app - does that for you... - it just saves a lot of copy and paste (and time!)

C.
Image
Highest score : 2297
User avatar
Sierra_Leon
Posts: 952
Joined: Mon Jan 08, 2007 4:49 pm
Location: The Netherlands

Post by Sierra_Leon »

Ok. So say you need 4 countries out of 10 for a bonus of 4, but actually you own 5 countries: AA BB CC DD and EE.

AA BB CC DD = 4 bonus
AA BB CC EE = 4 bonus
AA BB DD EE = 4 bonus
AA CC DD EE = 4 bonus
BB CC DD EE = 4 bonus

= 20. But you want it to be 4, or if you want to reward a 5th country with an extra bonus, maybe 5 or 6.

You would need to add a negative bonus for owning more than the necessary amount of countries. If you're going to write this program, you should have it calculate this also or you would still be doing an awful lot of math every time.
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Ah yes...

However we can get round that with an overrides / required feature...

Essentially the main problem is that at the moment the XML can't cope with 1 or 2 territories that you have to have and X territories that are optional...

So mainly this is for the SuperMax map... of course I need to do that bit of coding next!!!

C.
Image
Highest score : 2297
User avatar
Sierra_Leon
Posts: 952
Joined: Mon Jan 08, 2007 4:49 pm
Location: The Netherlands

Post by Sierra_Leon »

yeti_c wrote:Essentially the main problem is that at the moment the XML can't cope with 1 or 2 territories that you have to have and X territories that are optional...


Can't you just remove all combinations without the territories that you have to have from the list? Say there are AA, BB, CC, DD and EE. To get a bonus, you need 4 out of 5, but AA and EE must be among those 4. The list your program would generate is:

AA BB CC DD
AA BB CC EE
AA BB DD EE
AA CC DD EE
BB CC DD EE

Leave out those without both AA and EE and you are left with:

AA BB CC EE
AA BB DD EE
AA CC DD EE

Which are exactly the combinations that you are looking for, right? Or is the "Leave out those without both AA and EE"-part not possible?
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

Indeed - this is the plan for this... but if you take a look in the Supermax thread you will see the exact extent of the problem...

We have 4 sections of 15 territories...

Of these you get a bonus for 4, 7, 10, 13 and all... and you have to hold the leader...

The XML combinations for all of these is quite extensive... hence the need for this generator...

Of course the other way of doing it - is run the generator with all but the obvious - then copy and replace the top half of the XML with the required components into each combination...

i.e.

Territories are

AA BB CC DD EE FF GG

AA - is always required... with groups of 4...

So drop AA from the list and run with 3 against BB CC DD EE FF GG...

Then copy and replace

Code: Select all

    <components>

with

Code: Select all

    <components>
        <component>AA</component>


And this will always add in the required elements to the continents...

C.
Image
Highest score : 2297
User avatar
Sierra_Leon
Posts: 952
Joined: Mon Jan 08, 2007 4:49 pm
Location: The Netherlands

Post by Sierra_Leon »

yeti_c wrote:Of course the other way of doing it - is run the generator with all but the obvious - then copy and replace the top half of the XML with the required components into each combination...

This sounds like a good plan, but you should be able to have your program do this instead of doing it manually. In your psuedocode, it can be added where you "output combination to XML". You'll need to split the required territories from the rest of them in your input/config file.
Post Reply

Return to “Foundry Discussions”