Advertisement
mch_pastebin

ClubsRevenue.ps1

Sep 3rd, 2020 (edited)
2,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. param (
  2.     [parameter(Mandatory = $true)][int] $BiggestTip,
  3.     [parameter(Mandatory = $false)][int] $TipScaleFactor = 2,
  4.     [parameter(Mandatory = $false)][int] $SimulationTime = 365,
  5.     [parameter(Mandatory = $false)][int] $MinimalBreak = 30,
  6.     [parameter(Mandatory = $false)][int] $ClubCost = 5000000,
  7.     [parameter(Mandatory = $false)][int] $ClubCount = 1,
  8.     [parameter(Mandatory = $false)][bigint] $Money = 0,
  9. )
  10.  
  11. Write-Output "Biggest tip claim: $BiggestTip`$"
  12. Write-Output "Biggest tip to daily club revenue scale factor: $TipScaleFactor"
  13. Write-Output "Whole simulation time period: $SimulationTime days"
  14. Write-Output "Minimal time period between buying new clubs: $MinimalBreak days"
  15. Write-Output "Club cost: $ClubCost`$"
  16. Write-Output "Money at the start: $Money`$"
  17. Write-Output "Clubs count at the start: $ClubCount`n"
  18.  
  19. [bigint] $revenuePerClubPerDay = $BiggestTip * $TipScaleFactor
  20. [bigint] $revenuePerClubPerTimespan = $revenuePerClubPerDay * $MinimalBreak
  21.  
  22. for ($day = 0; $day -lt $SimulationTime; $day += 1) {
  23.     if ($day % $MinimalBreak -eq 0) {
  24.         $Money += $ClubCount * $revenuePerClubPerTimespan
  25.  
  26.         while ($Money -gt $ClubCost) {
  27.             $Money -= $ClubCost
  28.             $ClubCount += 1
  29.         }
  30.     }
  31. }
  32.  
  33. Write-Output "Revenues per timespan at the end of the $SimulationTime days time period:"
  34.  
  35. if ($MinimalBreak -gt 1 -and $MinimalBreak -ne 30) {
  36.     Write-Output "Per $MinimalBreak days: $($ClubCount * $revenuePerClubPerTimespan)`$"
  37. }
  38.  
  39. Write-Output "Per day: $($ClubCount * $revenuePerClubPerDay)`$"
  40. Write-Output "Per month: $($revenuePerClubPerDay * $ClubCount * 30)`$`n"
  41. Write-Output "Clubs count at the end of the $SimulationTime days time period: $ClubCount`n"
  42.  
  43.  
  44.  
  45. # Biggest tip claim: 18000$
  46. # Biggest tip to daily club revenue scale factor: 2
  47. # Whole simulation time period: 365 days
  48. # Minimal time period between buying new clubs: 30 days
  49. # Club cost: 2000000$
  50. # Money at the start: 0$
  51. # Clubs count at the start: 1
  52.  
  53. # Revenues per timespan at the end of the 365 days time period:
  54. # Per day: 7236000$
  55. # Per month: 217080000$
  56.  
  57. # Clubs count at the end of the 365 days time period: 201
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement