From 359e40c53f7860a44affc345c2ca363c4fb16d45 Mon Sep 17 00:00:00 2001 From: Josh Mudge Date: Fri, 8 Sep 2017 22:15:16 -0600 Subject: [PATCH] v2.0 --- Ardon-income.html | 10 ++++++++++ calculate.js | 26 ++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Ardon-income.html b/Ardon-income.html index 60cff2f..accde45 100644 --- a/Ardon-income.html +++ b/Ardon-income.html @@ -13,8 +13,18 @@ Enter the number of those blocks that qualify as Housing, Infrastructure, Busine



+Enter the number of rent blocks that qualify as being government buildings (other than capitals) or as being exceptionally designed (confirmed by two people). +



+Enter the number of embassies in other empires built by permission and confirmed to be embassies by two people. +

+ +

+Enter 1 if you have a capital +

+ +






diff --git a/calculate.js b/calculate.js index abccb0d..f4f9b45 100644 --- a/calculate.js +++ b/calculate.js @@ -2,9 +2,12 @@ //Licensed under the Apache License 2.0. See license file for information. function calculate() { - var emeralds = 0 + var blocks = 0 var tenblocks = 0 - var tenthbonus = 0 + var twentyfifth = 0 + var embassies = 0 + var capital = 0 + var percent = 0 var numReg = /^\d+$/; //Get input @@ -12,8 +15,10 @@ function calculate() { var blocks = document.getElementById("blocks").value; var tenblocks = document.getElementById("tenblocks").value; var twentyfifth = document.getElementById("twentyfifth").value; + var embassies = document.getElementById("embassies").value; + var capital = document.getElementById("capital").value; - if (tenblocks.match(numReg)) + if (blocks.match(numReg)) { //Do nothing. } @@ -29,9 +34,18 @@ function calculate() { var tenblocks = +tenblocks / 1000 * 0.001 console.log(tenblocks) var twentyfifth = +twentyfifth / 1000 * 0.0025 - var tenthbonus = +emeralds + +tenblocks +twentyfifth - var total = tenthbonus.toFixed(4); - console.log(tenthbonus) + console.log(twentyfifth) + var embassies = +embassies * 0.0025 + console.log(embassies) + var capital = +capital * 0.01 + console.log(capital) + var percent = +tenblocks + +twentyfifth + +embassies + +capital + console.log(percent) + var total = +emeralds * +percent +emeralds + var total = total.toFixed(4); + console.log(total) + var date = Date(); + console.log(date) //Show result alert("Your secret message is " + total);