Skip to main content
Commonmark migration
Source Link

#PowerShell, 53 45 Bytes

PowerShell, 53 45 Bytes

$n=date -f yy;.1*[int](61.45+.75*$n);280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we assume that "followed by some delimiter (e.g. space or comma)" can also mean "newline", so we execute one result and then the second. PowerShell implicitly writes out results, so we don't need to explicitly call any printing commands.

#PowerShell, 53 45 Bytes

$n=date -f yy;.1*[int](61.45+.75*$n);280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we assume that "followed by some delimiter (e.g. space or comma)" can also mean "newline", so we execute one result and then the second. PowerShell implicitly writes out results, so we don't need to explicitly call any printing commands.

PowerShell, 53 45 Bytes

$n=date -f yy;.1*[int](61.45+.75*$n);280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we assume that "followed by some delimiter (e.g. space or comma)" can also mean "newline", so we execute one result and then the second. PowerShell implicitly writes out results, so we don't need to explicitly call any printing commands.

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#PowerShell, 53 45 Bytes

$n=date -f yy;.1*[int](61.45+.75*$n);280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answerPython 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we assume that "followed by some delimiter (e.g. space or comma)" can also mean "newline", so we execute one result and then the second. PowerShell implicitly writes out results, so we don't need to explicitly call any printing commands.

#PowerShell, 53 45 Bytes

$n=date -f yy;.1*[int](61.45+.75*$n);280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we assume that "followed by some delimiter (e.g. space or comma)" can also mean "newline", so we execute one result and then the second. PowerShell implicitly writes out results, so we don't need to explicitly call any printing commands.

#PowerShell, 53 45 Bytes

$n=date -f yy;.1*[int](61.45+.75*$n);280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we assume that "followed by some delimiter (e.g. space or comma)" can also mean "newline", so we execute one result and then the second. PowerShell implicitly writes out results, so we don't need to explicitly call any printing commands.

Changed output formulation
Source Link
AdmBorkBork
  • 43.5k
  • 5
  • 103
  • 284

#PowerShell, 5353 45 Bytes

$n=date -f yy;"$(yy;.1*[int](61.45+.75*$n)),$(280+3*$n)";280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we use built-in command blocks $(...)assume that get executed before the string literal "..." is executed"followed by some delimiter (e.g. space or comma)" can also mean "newline", so we have our results already calculated into the string beforeexecute one result and then the string is printedsecond. PowerShell implicitly writes out results, saving several bytesso we don't need to explicitly call any printing commands.

#PowerShell, 53 Bytes

$n=date -f yy;"$(.1*[int](61.45+.75*$n)),$(280+3*$n)"

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we use built-in command blocks $(...) that get executed before the string literal "..." is executed, so we have our results already calculated into the string before the string is printed, saving several bytes.

#PowerShell, 53 45 Bytes

$n=date -f yy;.1*[int](61.45+.75*$n);280+3*$n

Uses a similar rounding trick as muddyfish's Python 2 answer to simplify the world population calculation, since PowerShell implicitly Round()s when you cast from a [double] to an [int], rather than truncating.

For the output, we assume that "followed by some delimiter (e.g. space or comma)" can also mean "newline", so we execute one result and then the second. PowerShell implicitly writes out results, so we don't need to explicitly call any printing commands.

Source Link
AdmBorkBork
  • 43.5k
  • 5
  • 103
  • 284
Loading