Below is a quick and unglamorous solution.
If you have a better one, please include it in your answer.
let tree_height = 15;
range i from -1 to tree_height * 2 step 2
| extend side_width = tree_height + 1 - i / 2
| extend side_space = strrep(" ", side_width)
| extend tree_part = case(i > 0, strcat("/", strrep("*", i), @"\"), " ^ ")
| project ta_da = strcat(side_space, tree_part, side_space)
^
/*\
/***\
/*****\
/*******\
/*********\
/***********\
/*************\
/***************\
/*****************\
/*******************\
/*********************\
/***********************\
/*************************\
/***************************\
/*****************************\
If you need some inspiration:
Here's my Khristmas tree:
let L=10;
range x from 1 to L step 1
| project t=strcat(strrep(' ', L-x), strrep('.', x), strrep('*', x-1))
| summarize Tree=make_list(t)
| project Tree=array_concat(pack_array(strcat(strrep(' ', L-3), make_string(127775))), Tree)
| project HappyXmas=strcat_array(Tree, '\n')
Based on Yoni's answer - a similar implementation for Kusto Web Explorer (the web UI removes leading spaces from the result grid)
let tree_height = 10;
let invisible_space = '\u00AD';
range i from 0 to tree_height*2 step 2
| extend side_width = tree_height + 1 - i /2
| extend side_space = strcat_array(repeat(strcat(invisible_space,''), side_width), " ")
| project Happy_Holidays = case(i != 0, strcat(side_space, "O", strcat_array(repeat("-", i-1), ""), @"O", side_space), strcat(side_space, " O", side_space))
Result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With