I am going to try and right a programme (for a wargame) that calculates the damage done by a weapon. The weapon has several 'characterisitics', being:
• one- or two-handed
• number of dice to roll (if one-handed)
• number of dice to roll (if two-handed)
• bonus points (if one-handed)
• bonus points (if two-handed)
Some weapons can be used only two-handed, or only single-handed. for example:
- Code: Select all
TYPE DICE BONUS DICE BONUS
Broadsword - - 5 2
Bastardsword 3 2 4 0
Sword 3 0 - -
How would I put this information so that a C++ programme could use it?
The aim is for the used just to select the weapon used and the programme returns a value for the damage done.
Is data array the correct term?