Challenge 28 - Left Triangle Star Pattern
Level - Easy
Description - In this challenge, you will do a little bit of logic building and produce the star triangle below. The output will be such that each row in the pattern will be in the corresponding row of the table.
P.S. do not hardcode the pattern.
*
**
***
****
*****
******
Bonus Challenge - Do not use scripting nodes or components.
---------------------------------------------------------------------
In this challenge. I propose several solutions.
1) Using a recursive loop to generate the pattern, using the pre-defined seed * in the table creator.
2) Using a chunk loop (1 row at a time) to generate the pattern. This method doesn't require a seed to start the loop. Instead it uses the row count (defined when setting up the empty table) to generate the repeating * pattern.
3) Loop-free method, this time using row index plus one to generate the repeating * pattern
In all of these solutions, the repeating pattern is generated using the padding function, whereby additional * is added to fill the length of the string defined by the iteration/row index number plus one (i.e. 1, 2, 3 etc).
Workflow
justknimeit-28 - Challenge 28: Left Triangle Star Pattern
Used extensions & nodes
Created with KNIME Analytics Platform version 4.6.1
Legal
By using or downloading the workflow, you agree to our terms and conditions.