Skip to content

Instantly share code, notes, and snippets.

@temmings
Created November 24, 2016 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save temmings/0331e18ff64b4c351e5478998ff8d3fd to your computer and use it in GitHub Desktop.
Save temmings/0331e18ff64b4c351e5478998ff8d3fd to your computer and use it in GitHub Desktop.
hatara-clicker-wip.js
'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