Skip to main content
Commonmark migration
Source Link

#Dyalog APL, 1 byte

Dyalog APL, 1 byte

This has worked since the very first APL, back in the seventies:

⍳⎕

No built-in (also always worked):

+\⎕⍴1

Cumulative sum +\ of input number of 1s.

Obviously you will need enough memory to contain the result. Here is a print loop to avoid memory full:

{⎕←1+⍵}⍣⎕⊢0

{return and print ⎕← 1+ argument } applied input times to 0.

#Dyalog APL, 1 byte

This has worked since the very first APL, back in the seventies:

⍳⎕

No built-in (also always worked):

+\⎕⍴1

Cumulative sum +\ of input number of 1s.

Obviously you will need enough memory to contain the result. Here is a print loop to avoid memory full:

{⎕←1+⍵}⍣⎕⊢0

{return and print ⎕← 1+ argument } applied input times to 0.

Dyalog APL, 1 byte

This has worked since the very first APL, back in the seventies:

⍳⎕

No built-in (also always worked):

+\⎕⍴1

Cumulative sum +\ of input number of 1s.

Obviously you will need enough memory to contain the result. Here is a print loop to avoid memory full:

{⎕←1+⍵}⍣⎕⊢0

{return and print ⎕← 1+ argument } applied input times to 0.

added 23 characters in body
Source Link
Adám
  • 31.1k
  • 3
  • 124
  • 287

Dyalog APL, 1 byte

#Dyalog APL, 1 byte

This has worked since the very first APL, back in the seventies:

⍳⎕

No built-in (also always worked):

+\⎕⍴1

Cumulative sum +\ of input number of 1s.

Obviously you will need enough memory to contain the result. Here is a print loop to avoid memory full:

{⎕←1+⍵}⍣⎕⊢0

{return and print ⎕← 1+ argument } applied input times to 0.

Dyalog APL, 1 byte

This has worked since the very first APL, back in the seventies:

⍳⎕

No built-in (also always worked):

+\⎕⍴1

Cumulative sum +\ of input number of 1s.

Obviously you will need enough memory to contain the result. Here is a print loop to avoid memory full:

{⎕←1+⍵}⍣⎕⊢0

{return and print ⎕← 1+ argument } applied input times to 0.

#Dyalog APL, 1 byte

This has worked since the very first APL, back in the seventies:

⍳⎕

No built-in (also always worked):

+\⎕⍴1

Cumulative sum +\ of input number of 1s.

Obviously you will need enough memory to contain the result. Here is a print loop to avoid memory full:

{⎕←1+⍵}⍣⎕⊢0

{return and print ⎕← 1+ argument } applied input times to 0.

Source Link
Adám
  • 31.1k
  • 3
  • 124
  • 287

Dyalog APL, 1 byte

This has worked since the very first APL, back in the seventies:

⍳⎕

No built-in (also always worked):

+\⎕⍴1

Cumulative sum +\ of input number of 1s.

Obviously you will need enough memory to contain the result. Here is a print loop to avoid memory full:

{⎕←1+⍵}⍣⎕⊢0

{return and print ⎕← 1+ argument } applied input times to 0.