Hi,
I'm trying to build these star and number patterns using only OutSystems logic (without JavaScript).
I’ve attached the image with the 4 patterns I want to create:
Palindrome Triangular
Rhombus
Diamond
Butterfly Star
Can anyone guide me with the logic or flow for any of these patterns in OutSystems Service Studio?
Thanks in advance!
Hi,Please find the attached oml,Thanks,sahana
Hi @Thimmisetty surendrababu. I hope you are well.
Could you share the .oml so we can see how far you've come ?
Additionally, this type of implementation is a bit rare to do in Outsystems. But it can be done.
For writing these patterns logic is same as its in other programming language like C, C++, Java. Only the way of writing the logic. We just need to write the logic in action. If you have prepared something please help to share the OML and specifically what challenge you are facing.
regards
you can build html in the logic and then display in the expression.
lets take paliandrome triangular.
def print_palindrome_triangle(n): """Prints a palindrome triangle pattern of a given size. Args: n: The number of rows in the triangle. """ for i in range(1, n + 1): # Print leading spaces for j in range(n - i): print(" ", end=" ") # Print ascending numbers for j in range(1, i + 1): print(j, end=" ") # Print descending numbers for j in range(i - 1, 0, -1): print(j, end=" ") print()
take this algorithm, but except printing put br tag or new line of outsystems. just define returned value in the local var and use as an expression. I do not have my laptop with me right now, if you are not in hurry I will upload sample later if you want to.
Hi, what logic do you want? On click and things appear as the user adds something?
Or just present the objects in these formats? If you only want to present them in these formats, you can use CSS and flex...