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