I have created a basic barrack calculator for this round.
This is for those who don't use firefox and the addon.
https://mi-linux.wlv.ac.uk/~1106191/barracks.htmlJust type in the values, and press Submit to see the following
- How many barracks your current military requires
- The Barrack capacity
- How many barracks the military in training will require
- How many barracks the current and military in training will require
- What The barrack capacity will be once completed.
Please let me know if there are any mistakes.
p.s. I know about the numbers showing 8 decimal places. and I know you can round is off using float, but I can't seem to get it to work so I figured leaving it as is will be better than not having this at all..
TFs are not included, as TFs do not require barracks.
Comments
Total number of units (owned+training) / #barracks (owned + training) *75.
"Total number of units (owned+training)/75 = # of barracks required."
the projected is to say if you need to build any more barracks or not.
this is my crapy code
<?php
$Barracks = $HTTP_POST_VARS['Barracks'];
$Soldiers = $HTTP_POST_VARS['Soldiers'];
$Troopers = $HTTP_POST_VARS['Troopers'];
$Dragoons = $HTTP_POST_VARS['Dragoons'];
$Fighters = $HTTP_POST_VARS['Fighters'];
$LaserTroopers = $HTTP_POST_VARS['LaserTroopers'];
$LaserDragoons = $HTTP_POST_VARS['LaserDragoons'];
$Tanks = $HTTP_POST_VARS['Tanks'];
$Scientists = $HTTP_POST_VARS['Scientists'];
$Barracks1 = $HTTP_POST_VARS['Barracks1'];
$Soldiers1 = $HTTP_POST_VARS['Soldiers1'];
$Troopers1 = $HTTP_POST_VARS['Troopers1'];
$Dragoons1 = $HTTP_POST_VARS['Dragoons1'];
$Fighters1 = $HTTP_POST_VARS['Fighters1'];
$LaserTroopers1 = $HTTP_POST_VARS['LaserTroopers1'];
$LaserDragoons1 = $HTTP_POST_VARS['LaserDragoons1'];
$Tanks1 = $HTTP_POST_VARS['Tanks1'];
$Scientists1 = $HTTP_POST_VARS['Scientists1'];
echo "Your current military requires ";
echo (($Soldiers+$Troopers+$Dragoons+$Fighters+$LaserTroopers+$LaserDragoons+$Tanks+$Scientists)/75);
echo " Barracks<br>";
echo "Your barrack capacity is ";
echo (((($Soldiers+$Troopers+$Dragoons+$Fighters+$LaserTroopers+$LaserDragoons+$Tanks+$Scientists))/($Barracks*75))*100);
echo "%
";
echo "Your military in training will require an additional ";
echo (($Soldiers1+$Troopers1+$Dragoons1+$Fighters1+$LaserTroopers1+$LaserDragoons1+$Tanks1+$Scientists1)/75);
echo " Barracks
";
echo "Your military including those in training will require ";
echo (($Soldiers+$Troopers+$Dragoons+$Fighters+$LaserTroopers+$LaserDragoons+$Tanks+$Scientists+$Soldiers1+$Troopers1+$Dragoons1+$Fighters1+$LaserTroopers1+$LaserDragoons1+$Tanks1+$Scientists1)/75);
echo " Barracks
";
echo "Your projected barrack capacity will be ";
echo (($Soldiers+$Troopers+$Dragoons+$Fighters+$LaserTroopers+$LaserDragoons+$Tanks+$Scientists+$Soldiers1+$Troopers1+$Dragoons1+$Fighters1+$LaserTroopers1+$LaserDragoons1+$Tanks1+$Scientists1)/(($Barracks+$Barracks1)*75)*100);
echo "%";
?>
new url you need is https://mi-linux.wlv.ac.uk/~1106191/other/barracks.html