• ok i messed it up ahits[0] should be set to 1, all the other values should be zero so:

    for(int i=MAXHITSATTACK-1;i>=0;i–)
    {
    ahits[i+1]+=ahits_(attackvalue/6); //attackvalue is 3 for a tank
    ahits_
    =(attackvalue/6); //if it misses
    }
    i think this works
    after one tank is entered i get:
    ahits={.5, .5}
    after a second is entered i get:
    ahits={.25,.5,.25}

    so all i need to do is combine them to make attack and defence work together in possibly a 2d array.__


  • What do you mean with this line here?
    //for a tank take half of what’s in a hits, and shift it up, the rest stays where it is

    As I understand it it should be something like this…
    for(int i=0; i<=MAXATTHITS; i++)
    {
    float half = (ahits_/2);
    ahits _-= half;
    ahits[i+1] += half;
    }
    and then add .5 to all the cells?

    Or have I gotten it completly wrong??
    I can’t get it to work with more than 1 attacking unit…

    //Samael__


  • note: it is in reverse order, i– this is important due to the nature of the algorithm

    for(int i=u;i>=0;i–) //changed it to i=u, u is the counter for the outer loop this increases efficiancy
    {
    ahits[i+1]+=ahits_(attackvalue/6); //attackvalue is 3 for a tank
    ahits_
    =(attackvalue/6); //if it misses
    }

    for 2 tanks
    for tanks attackvalue=3 so (attackvalue/6) is always .5
    when i enter a tank, and i=0 (u=0) then
    ahits[1]+=ahits[0].5
    which is:
    ahits[1]+=.5 (ahits[1]=.5)
    then
    ahits[0]
    =.5 (ahits[0]=.5)

    ahits={.5,.5};

    for the second tank, i=1;
    ahits[2]+=ahits[1].5
    which is:
    ahits[2]+=.5
    .5=.25 (ahits[2]=.5)
    then
    ahits[1]=.5 (ahits_=.25)
    now ahits={.5,.25,.25} but we have to do when i=0 also
    ahits[1]+=ahits[0]
    .5
    which is:
    ahits[1]+=.5*.5
    ahits[1]=ahits[1]+.25 (ahits[1]=.5)
    then
    ahits[0]=.5
    ahits[0]=.5
    .5=.25 (ahits[0]=.25)

    so after 2 tanks ahits={.25,.5,.25} 25% miss, 50% 1 hit, 25% 2 hits
    i might code this up for a special purope, in the meantime, you could try to get it to work. I’ll work on the 2d array so i can get say 25% attack hits once, defence hits twice, or whatever, then to do multiple rounds…___


  • oops… my bad…
    Forgott the outer for loop :oops:

    It works fine now… I’m working with another theory that might work
    better when removing casualites… but i’m not sure how it’ll work out…
    I’ll let you now…

    //Samael


  • Do you have an updated version out yet?

    Maybe you could include rules for some variations.


  • do you mean his calculator, or my theory? I haven’t actually compiled mine yet, but I know a good use for it…


  • I haven’t done any work on the calculator since version 1.1b, there just has’nt been time… I’ll post a non .NET version shortly though…
    Lots of projects in the making though… :D

    Inxduk: How are your calculations going along?
    If you wish I could send you the GUI and you can just implement your calculatoins to test them… Just have them in Visual C++ C or Visual C# 7 though…

    //Samael


  • I have the full version of VC++ 6.0 which is old, but works. I’m mainly to lazy to program it in due to my other projects


  • Hey Sam,
    I downloaded your version 1.1b.
    Lookin’ great! :wink:
    nice icon/piccys, looks very professional.
    works perfect too


  • My opponent in a game sent me a calculator that does europe pacific regular etc, and is quite advanced. Don’t know how i can post it…


  • I don’t wish to hurt anyone’s pride – and I do think the formulas, logarithms, and constructions are a testament to imagination, persistence, resourcefulness and yes even FUN – but reading through these posts makes me realize how much I LIKE ROLLING DICE!!! YEEEHOOO!!

    Anyone think that’s strange??


  • of course the dice are fun, you never know, you might get lucky! but calculators are important. Without a calculator, for large battles, the odds can be 90%+ or <10% and it’s really hard to tell which it is usually.


  • Ah, yes: the famous “fog of war” in its manifestation on the diceboard!

Suggested Topics

  • 3
  • 6
  • 8
  • 5
  • 5
  • 10
  • 5
  • 1
Axis & Allies Boardgaming Custom Painted Miniatures

34

Online

17.8k

Users

40.4k

Topics

1.8m

Posts