Skip to content

Instantly share code, notes, and snippets.

@ara-ta3
Created June 28, 2020 13:57
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 ara-ta3/414919a2b780bf049634712eb1763581 to your computer and use it in GitHub Desktop.
Save ara-ta3/414919a2b780bf049634712eb1763581 to your computer and use it in GitHub Desktop.
// https://hyperwiki.jp/acnh/kabu-tool/
// Array.from(document.querySelectorAll("#output tr")).filter((tr) => tr.className === '').map((tr) => {return { p: parseFloat(tr.childNodes[1].innerText.replace("%", "")), max: parseInt(tr.childNodes[16].innerText), min: parseInt(tr.childNodes[15].innerText)}}).map((x) => (x.max+x.min)/2 * (x.p / 100)).reduce((E, en) => E + en, 0)
Array.from(document.querySelectorAll("#output tr")).filter((tr) => tr.className === '').map((tr) => {
return {
p: parseFloat(tr.childNodes[1].innerText.replace("%", "")),
max: parseInt(tr.childNodes[16].innerText),
min: parseInt(tr.childNodes[15].innerText)
}
}).map((x) => (x.max + x.min) / 2 * (x.p / 100)).reduce((E, en) => E + en, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment