Advertisement
ajr-dev

Missing MTG arena packs to complete rares

Sep 20th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Calculate the number of packs to open to complete rares for a set
  4. # Most recent sets have 53 rares. As a rule of thumb,
  5. # 53 * 4 * (1-completion%) * 1.2 is the number of packs you want to have.
  6. # The 1.2 accounts for mythic rares and wildcard upgrades.
  7. ceil() {                                                                      
  8. echo "define ceil (x) {if (x<0) {return x/1} \
  9.      else {if (scale(x)==0) {return x} \
  10.      else {return x/1 + 1 }}} ; ceil($1)" | bc
  11. }
  12.  
  13. packs=$( echo "53 * 4 * (1 - $1/100)" | bc -l )
  14. packs=$(ceil $packs 0)
  15. echo "$packs packs missing"
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement