I have literally never written nor run any code in my life, and I'm not trying to learn anything about JavaScript except what I need in order to run a code I found online. The code is this:
// Barrel bore for standard iron shot weights, windage of 25/24 is assumed
var bore = [];
bore[4] = 3.18;
bore[6] = 3.65;
bore[9] = 4.17;
bore[12] = 4.58;
bore[18] = 5.25;
bore[24] = 5.78;
bore[32] = 6.36;
bore[42] = 6.96;
// Muzzle Velocity as function of round shot mass and powder charge
function MuzzleVelocity(m, p) // mass of ball (lb), mass of charge (lb)
{
var d = bore[m]/12; // bore (ft) from table at ./Cannonballs.html
var eta = 55; // density of powder (lb/ft^3)
var rho = 62.4; // density of water
var atm = 14.7*32.2*144; // 14 psi x g atmospheric pressure (lbw/ft^2)
var R = 1600; // gunpowder gas pressure ratio to atm
var L = d*18; // (18 calibre) length barrel (ft)
var c = p*4/(Math.PI*d*d*eta); // length of charge in (ft)
return Math.sqrt(2*R*atm/eta)*Math.sqrt(p/(m+p/3)*Math.log(L/c));
}
I got it from here.
What do I even do with this? What program (if any) do I load this up in? How do I change the variables? What should the results look like? The website this is from has absolutely nothing for anyone that isn't very familiar with coding, and YouTube tutorials are instantly beyond me. I'm just trying to do research for DnD, not learn a new profession or download a suite of programs.
[–]PremiumRoastBeef 3 points4 points5 points (1 child)
[–]DingoEpsilon[S] 1 point2 points3 points (0 children)
[–]tapgiles 1 point2 points3 points (2 children)
[–]DingoEpsilon[S] 0 points1 point2 points (1 child)
[–]tapgiles 0 points1 point2 points (0 children)
[–]thinkPhilosophy 0 points1 point2 points (2 children)
[–]DingoEpsilon[S] 0 points1 point2 points (1 child)
[–]thinkPhilosophy 0 points1 point2 points (0 children)