[Ruby] straight forward, not very elegant solution[Ruby] straight forward, not very elegant solution

🎆

Happy New Year

Week 1, 2026

def fireworks(n, out: $stdout) (n / 2).downto(1) do |i| si = i - 1 out << ' ' * (n / 2 - i) << '\\' << ' ' * si << '|' << ' ' * si << '/' << "\n" end out << '-' * n << "\n" 1.upto(n / 2) do |i| si = i - 1 out << ' ' * (n / 2 - i) << '/' << ' ' * si << '|' << ' ' * si << '\\' << "\n" end out end