RokettoJanpu

Dice V2

May 27th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(a==`help`){
  2. r;
  3. }else{
  4.     b=a.match(/\d+\s?d\s?\d+/gi);
  5.     if(b){
  6.         c=b.map(z=>z.split(`d`).map(y=>parseInt(y.trim())));
  7.         d=[];
  8.         for(i=0;i<b.length;i++){
  9.             d[i]=[];
  10.             for(j=0;j<c[i][0];j++){
  11.                 d[i].push(Math.ceil(Math.random()*c[i][1]));
  12.             }
  13.         }
  14.         b.map((z,i)=>`🎲 ${z}: ${d[i].join(` `)} Total: ${d[i].reduce((f,g)=>f+g)}/${c[i][0]*c[i][1]}`).join(` `).slice(0,400);
  15.     }else{
  16.         `🎲 ${Math.ceil(Math.random()*100)}`;
  17.     }}
Add Comment
Please, Sign In to add comment