Skip to main content
deleted 104 characters in body
Source Link
emanresu A
  • 46.2k
  • 5
  • 111
  • 257

Jelly, 8 6 bytes

⁷³p$Ȯ¿

This is a monadic link that accepts an alphabet and prints an infinite list of strings. Try it online!

How it works

⁷³p$Ȯ¿    Monadic link. Argument: A (alphabet)

⁷         Set the return value to '\n'.
     ¿    While loop.
            Condition:
    Ȯ         Print the current return value and return it (always truthy).
            Body:
   $          Combine the two links to the left into a single, monadic link.
 ³              Yield A.
  p             Perform the Cartesian product of A and the current return value,
                updating the return value in the process.

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively.

I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

How it works

R’ḃL}ị    Dyadic link. Arguments: n (integer), A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.

Jelly, 8 6 bytes

⁷³p$Ȯ¿

This is a monadic link that accepts an alphabet and prints an infinite list of strings. Try it online!

How it works

⁷³p$Ȯ¿    Monadic link. Argument: A (alphabet)

⁷         Set the return value to '\n'.
     ¿    While loop.
            Condition:
    Ȯ         Print the current return value and return it (always truthy).
            Body:
   $          Combine the two links to the left into a single, monadic link.
 ³              Yield A.
  p             Perform the Cartesian product of A and the current return value,
                updating the return value in the process.

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively.

I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

How it works

R’ḃL}ị    Dyadic link. Arguments: n (integer), A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.

Jelly, 8 6 bytes

⁷³p$Ȯ¿

Try it online!

How it works

⁷³p$Ȯ¿    Monadic link. Argument: A (alphabet)

⁷         Set the return value to '\n'.
     ¿    While loop.
            Condition:
    Ȯ         Print the current return value and return it (always truthy).
            Body:
   $          Combine the two links to the left into a single, monadic link.
 ³              Yield A.
  p             Perform the Cartesian product of A and the current return value,
                updating the return value in the process.

Alternate version, 6 bytes

R’ḃL}ị

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively.

Try it online!

How it works

R’ḃL}ị    Dyadic link. Arguments: n (integer), A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.
added 216 characters in body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 88 6 bytes

R’ṗ@;/ḣḷ⁷³p$Ȯ¿

This is a dyadicmonadic link that accepts an alphabet and the desired numberprints an infinite list of strings as left and right arguments, respectively. Try it online!Try it online!

How it works

R’ṗ@;/ḣḷ  Dyadic link.⁷³p$Ȯ¿ Left input: n (integer)Monadic Rightlink. inputArgument: A (alphabet)

R         Range;Set yieldthe [1,return ...,value n]to '\n'.
     ¿    Decrement;While yieldloop.
 [0, ..., n-1].
  ṗ@      For eachCondition:
 i in that range,Ȯ take        Print the Cartesiancurrent powerreturn Avalue **and ireturn it (always truthy).
    ;/    Concatenate    Body:
   $          Combine the resultingtwo listslinks to the left into a single, monadic link.
 ³              Yield nA.
  p       Discard all but    Perform the firstCartesian nproduct stringof A and the current return value,
                updating the return value in the process.

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

I/OThis is a dyadic link that accepts an alphabet and the desired number of strings as beforeleft and right arguments, respectively. 

I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

How it works

R’ḃL}ị    LeftDyadic inputlink. Arguments: n (integer) Right input:, A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.

Jelly, 8 bytes

R’ṗ@;/ḣḷ

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively. Try it online!

How it works

R’ṗ@;/ḣḷ  Dyadic link. Left input: n (integer) Right input: A (alphabet)

R         Range; yield [1, ..., n].
         Decrement; yield [0, ..., n-1].
  ṗ@      For each i in that range, take the Cartesian power A ** i.
    ;/    Concatenate the resulting lists.
         Yield n.
         Discard all but the first n string.

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

I/O is as before. I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

How it works

R’ḃL}ị    Left input: n (integer) Right input: A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.

Jelly, 8 6 bytes

⁷³p$Ȯ¿

This is a monadic link that accepts an alphabet and prints an infinite list of strings. Try it online!

How it works

⁷³p$Ȯ¿    Monadic link. Argument: A (alphabet)

         Set the return value to '\n'.
     ¿    While loop.
            Condition:
    Ȯ         Print the current return value and return it (always truthy).
            Body:
   $          Combine the two links to the left into a single, monadic link.
 ³              Yield A.
  p             Perform the Cartesian product of A and the current return value,
                updating the return value in the process.

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively. 

I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

How it works

R’ḃL}ị    Dyadic link. Arguments: n (integer), A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.
added 759 characters in body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 8 bytes

R’ṗ@;/ḣḷ

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively. Try it online!

How it works

R’ṗ@;/ḣḷ  Dyadic link. Left input: n (integer) Right input: A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
  ṗ@      For each i in that range, take the Cartesian power A ** i.
    ;/    Concatenate the resulting lists.
       ḷ  Yield n.
      ḣ   Discard all but the first n string.

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

I/O is as before. I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

How it works

R’ḃL}ị    Left input: n (integer) Right input: A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.

Jelly, 8 bytes

R’ṗ@;/ḣḷ

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively. Try it online!

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

I/O is as before. I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

Jelly, 8 bytes

R’ṗ@;/ḣḷ

This is a dyadic link that accepts an alphabet and the desired number of strings as left and right arguments, respectively. Try it online!

How it works

R’ṗ@;/ḣḷ  Dyadic link. Left input: n (integer) Right input: A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
  ṗ@      For each i in that range, take the Cartesian power A ** i.
    ;/    Concatenate the resulting lists.
       ḷ  Yield n.
      ḣ   Discard all but the first n string.

Alternate version, 6 bytes (non-competing)

R’ḃL}ị

I/O is as before. I consider this version non-competing, since it uses bijective base conversion, which has been implemented after this challenge had been sandboxed. Try it online!

How it works

R’ḃL}ị    Left input: n (integer) Right input: A (alphabet)

R         Range; yield [1, ..., n].
 ’        Decrement; yield [0, ..., n-1].
   L}     Yield l, the length of A.
  ḃ       Convert every i in [0, ..., n-1] to bijective base l.
     ị    For each array of digits, retrieve the corresponding characters of A.
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830
Loading