Skip to main content
added 4 characters in body
Source Link
Mayube
  • 11.7k
  • 2
  • 48
  • 93

Clam, 99 7 bytes

p;#>q0B1Qp;#qB1Q

4 extra bytes just to handle 0-2 bytes thanks to ASCII-only

Explanation

p;#>q0B1Qp;#qB1Q - Implicit Q = first input
p         - Print...
 ;        - Product of...
      B1Q - Range(1...Q) OR Range(Q...1) if (Q < 1)
  #>q0#q    - Where (q => q) >ie (q != 0)

Clam, 9 bytes

p;#>q0B1Q

4 extra bytes just to handle 0

Explanation

p;#>q0B1Q - Implicit Q = first input
p         - Print...
 ;        - Product of...
      B1Q - Range(1...Q) OR Range(Q...1) if (Q < 1)
  #>q0    - Where (q => q > 0)

Clam, 9 7 bytes

p;#qB1Q

-2 bytes thanks to ASCII-only

Explanation

p;#qB1Q - Implicit Q = first input
p       - Print...
 ;      - Product of...
    B1Q - Range(1...Q) OR Range(Q...1) if (Q < 1)
  #q    - Where (q => q) ie (q != 0)
Source Link
Mayube
  • 11.7k
  • 2
  • 48
  • 93

Clam, 9 bytes

p;#>q0B1Q

4 extra bytes just to handle 0

Explanation

p;#>q0B1Q - Implicit Q = first input
p         - Print...
 ;        - Product of...
      B1Q - Range(1...Q) OR Range(Q...1) if (Q < 1)
  #>q0    - Where (q => q > 0)