How to print pattern below pattern.

Please provide the code for printing the below pattern:

a

ab

abc

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    I am also eager to know your use case. But this is how you would be able to create this pattern. You can take local!alphabet in a constant from A-Z and bring upto the letter for which you want to iterate it. In your case upto letter C.

     

    a!localVariables(
      local!alphabet: {
        "a",
        "b",
        "c",
        "d",
        "e",
        "f",
        "g",
        "h",
        "i",
        "j",
        "k",
        "l"
      },
      a!forEach(
        count(local!alphabet) - { enumerate(count(local!alphabet)) + 1 },
        concat(rdrop(local!alphabet, fv!item))
      )
    )

Reply
  • 0
    Certified Associate Developer

    I am also eager to know your use case. But this is how you would be able to create this pattern. You can take local!alphabet in a constant from A-Z and bring upto the letter for which you want to iterate it. In your case upto letter C.

     

    a!localVariables(
      local!alphabet: {
        "a",
        "b",
        "c",
        "d",
        "e",
        "f",
        "g",
        "h",
        "i",
        "j",
        "k",
        "l"
      },
      a!forEach(
        count(local!alphabet) - { enumerate(count(local!alphabet)) + 1 },
        concat(rdrop(local!alphabet, fv!item))
      )
    )

Children