• x mas tree, ordering example, https://regularlighter.com/business-oppor

    From dzw!@21:1/5 to All on Sun Apr 19 05:06:51 2020
    Hi guys,
    I was working on solving my worry, how to visualize x mas tree, for
    products displaying in given order.

    I could not solve it in one language, I used Ruby and JavaScript, do
    you know how to achieve it in only Ruby?

    Ruby code:
    a = (1..14).to_a.map { |x| x.to_s }
    tree = a.map.with_index { |x, i| "<span class='no'></span>" * i }.map
    {|x| "<p>#{x}</p>"}

    tree[1..-1].each { |x|
    puts x
    }

    JavaScript code:
    if($('.no').length > 0) {
    $('.no').each(function(index, value) {
    this.innerHTML = index+1;
    });
    }


    Thanks, and best wishes during coronavirus madness.

    Bartosz Wais
    regularlighter.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)