Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function newsplit(total|amount){ if(amount <= 1){return [total];}; if(total < amount){ self.textparticle(~Nice try~); return newsplit(total|total);}; if(total == amount){return [1].concat(newsplit(total-1|amount-1));}; if(amount * 6 == total){return[6].concat(newsplit(total-6|amount-1));}; var retval = []; var lowbound = 1; var upbound = 6; if(amount * 6 - total < 6){lowbound = 7 - (amount*6 - total);}else if(total - amount < 6){upbound = total-amount;}; while(lowbound <= upbound){retval.push(lowbound); lowbound+=1;}; var r = rand(retval); return([r].concat(newsplit(total-r|amount-1))); }; givedice(newsplit(50|10));
Advertisement
Add Comment
Please, Sign In to add comment