Created
November 24, 2016 02:11
-
-
Save temmings/0331e18ff64b4c351e5478998ff8d3fd to your computer and use it in GitHub Desktop.
hatara-clicker-wip.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const cashGoal = 10000 * 10000; | |
const wageEffects = { shikaku: 1.5, programming: 20 }; | |
const esteemItems = ['shikaku', 'programming']; | |
const wage = (items, effects) => | |
2 | |
+ (items.shikaku * effects.shikaku) | |
+ (items.programming * effects.programming); | |
const perCost = (price, effect) => effect / price; | |
const itemPerCost = (prices, effects, item) => perCost(prices[item], effects[item]); | |
const repeatf = (f, amount) => Array(null, {length:amount}).forEach(f); | |
const getEsteemItemPrices = (prices, esteemItems) => | |
const highPerformanceItem = (prices, effects) => | |
start(); | |
while (cash < cashGoal) { | |
print(wage(items, wageEffects)); | |
if (itemPerCost(prices, wageEffects, 'shikaku') | |
> itemPerCost(prices, wageEffects, 'programming')) | |
{ | |
while (cash < prices.shikaku) work(); | |
purchase('shikaku'); | |
} else { | |
repeatf(work, 10000); | |
purchase('programming'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment