Skip to content

Instantly share code, notes, and snippets.

@VIRUXE
Last active January 5, 2023 00:28
Show Gist options
  • Save VIRUXE/aec44bd5f67069f3882b042c5651c16f to your computer and use it in GitHub Desktop.
Save VIRUXE/aec44bd5f67069f3882b042c5651c16f to your computer and use it in GitHub Desktop.
Some stats on GTA V Online Shark Cards monetary value
import random
cards = {
"tiger shark": {"price": 3.19, "cash": 250_000},
"bullshark" : {"price": 5.99, "cash": 600_000},
"great white": {"price": 11.99, "cash": 1_500_000},
"whale" : {"price": 30.99, "cash": 4_250_000},
"megalodon" : {"price": 59.99, "cash": 10_000_000},
}
last_cash_per_pound = 0.0
last_percent = 0.0
for card in cards:
# Calculate the cash per pound for the current card
cash_per_pound = round(cards[card]["cash"] / cards[card]["price"])
if last_cash_per_pound == 0.0: # This is the first card so we don't have a last card to compare to
print(f"\033[1m{card.title()} (£{cards[card]['price']} / ${cards[card]['cash']}): ${cash_per_pound} cash per pound\033[0m")
else:
# Calculate the difference from the last card
diff_from_last = cash_per_pound - last_cash_per_pound
# Calculate the percentage of the difference from the last card
benefit_percent = round((diff_from_last / last_cash_per_pound) * 100)
if benefit_percent > last_percent: # If there is a bigger benefit print green
color = "\033[92m"
else: # If there is a smaller benefit print red
color = "\033[91m"
last_percent = benefit_percent # Save the percentage for the next card
print(f"{card.title()} (£{cards[card]['price']} / ${cards[card]['cash']}): {color}${cash_per_pound} cash per pound - {benefit_percent}% more than last card\033[0m")
last_cash_per_pound = cash_per_pound # Save the cash per pound for the next card
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment