Skip to main content
The `Get-` is implied.
Source Link
mazzy
  • 7.2k
  • 2
  • 12
  • 22

Powershell, 3636 32 bytes

-4 bytes thanks AdmBorkBork

filter f{$_;if($_){Get-Random $_|f}}

Testscript:

filter f{$_;if($_){Get-Random $_|f}}

100 |f

Output:

100
61
20
8
6
3
0

Powershell, 36 bytes

filter f{$_;if($_){Get-Random $_|f}}

Testscript:

filter f{$_;if($_){Get-Random $_|f}}

100 |f

Output:

100
61
20
8
6
3
0

Powershell, 36 32 bytes

-4 bytes thanks AdmBorkBork

filter f{$_;if($_){Random $_|f}}

Testscript:

filter f{$_;if($_){Random $_|f}}

100 |f

Output:

100
61
20
8
6
3
0
Source Link
mazzy
  • 7.2k
  • 2
  • 12
  • 22

Powershell, 36 bytes

filter f{$_;if($_){Get-Random $_|f}}

Testscript:

filter f{$_;if($_){Get-Random $_|f}}

100 |f

Output:

100
61
20
8
6
3
0