Skip to content

Instantly share code, notes, and snippets.

@dbgarf
Created May 1, 2019 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbgarf/c29ae7d7a3bebc4887986c3f631f0948 to your computer and use it in GitHub Desktop.
Save dbgarf/c29ae7d7a3bebc4887986c3f631f0948 to your computer and use it in GitHub Desktop.
$total = 1440;
$totalW = 0 <# 52 #>;
$totalB = 0 <# 8 #>;
for ($i = 0; $i -lt 1440) {
if ($totalW -eq $totalB) {
$i += 52; $totalW += 1
}
else {
$i += 8; $totalB += 1 }
};
# output results
$totalW; # 24
$totalB; # 24
$i; # 1440
$total -eq ($totalW*52)+($totalB*8) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment