Widget:YieldCalc: Difference between revisions
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
Line 7: | Line 7: | ||
<form id="foodYieldForm"> | <form id="foodYieldForm"> | ||
<input type="number" id="cityProd"> | <input type="number" id="cityProd"><br /> | ||
<input type="submit" value="Calculate" onClick="yieldScript()"> | <input type="submit" value="Calculate" onClick="yieldScript()"> | ||
</form> | </form> | ||
Line 23: | Line 20: | ||
// Yield Calculator | // Yield Calculator | ||
function yieldScript(){ | function yieldScript(){ | ||
let A = Number(document.getElementById('cityProd').value); | let A = Number(document.getElementById('cityProd').value); /* City Production */ | ||
let B = | let B = 4; /* Yield(Apples) of the region */ | ||
let C = | let C = 4; /* Amount of Farms in the region */ | ||
let E = | let E = 250; /* Total Percentage Bonus (e.g. 50% from a Plow) */ | ||
let F = 1; /* Extra farm adjacency from religious verse (Boolean) */ | |||
let H = C + F; /* Add | let H = C + F; /* Add f to the actual amount of farms in the region */ | ||
document.getElementById('outputvalue').innerText= ( | document.getElementById('outputvalue').innerText= ( |
Revision as of 01:04, 25 October 2024
This widget is used to display and calculate the yield with the values submitted by the user.
Usage: {{#Widget:YieldCalc}}