Skip to content

Instantly share code, notes, and snippets.

View vulpesfoxnik's full-sized avatar

Vulpes Foxnik vulpesfoxnik

View GitHub Profile
// ==UserScript==
// @name furaffinity.net
// @namespace furaffinity-downloadLinks
// @description furaffinity.net addons
// @include furaffinity.net*
// @version 0.1b
// ==/UserScript==
var myDocument
(function () {
@vulpesfoxnik
vulpesfoxnik / peaks.js
Created June 29, 2017 23:44
Distribution calculation method for the Peak game
(()=>{
const distribution = [8,12,20,12,10,20,17,1];
console.log(distribution.reduce((x,y)=>x+y, 0));
return (distribution.reduce(function (array, cur){
const previous = array[array.length-1]|| []
, previousRemoved = previous[0]||0
, previousRemaining = previous[1]||100;
return array.concat([[cur, previousRemaining - previousRemoved]]);
}, []).map((x)=>x.join("/")).join(', '));
})();