Last edit: @<!error getting user name for intra:pjha> in (via web) 9 months ago - Slack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end
-- Created by pjha
function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space
    if (channel.type == "public") then
       return
    end
    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp
    if (channel.type == "public") then
       return
    end
    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned
    if (channel.type == "public") then
       return
    end
    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size
    if (channel.type == "public") then
        return
    end
    

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

History

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end
-- Created by pjha
function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space
    if (channel.type == "public") then
       return
    end
    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp
    if (channel.type == "public") then
       return
    end
    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned
    if (channel.type == "public") then
       return
    end
    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size
    if (channel.type == "public") then
        return
    end
    

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2904 by @jkrause in #[IM @jkrause] 1 year agoSlack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end
-- Created by pjha
function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space
    if (channel.type == "public") then
       return
    end
    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp
    if (channel.type == "public") then
       return
    end
    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned
    if (channel.type == "public") then
       return
    end
    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size
    if (channel.type == "public") then
        return
    end
    

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

if (channel.type == "public") then
  return ""
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2903 by @jkrause in #[IM @jkrause] 1 year agoSlack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end
-- Created by pjha
function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space
    if (channel.type == "public") then
       return
    end
    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp
    if (channel.type == "public") then
       return
    end
    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned
    if (channel.type == "public") then
       return
    end
    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size
    if (channel.type == "public") then
        return
    end
    

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

if (channel.type == "public") then
  return
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2902 by @jkrause in #[IM @jkrause] 1 year agoSlack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end
-- Created by pjha
function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space

    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp

    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned
    if (channel.type == "public") then
       return
    end
    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size
    if (channel.type == "public") then
        return
    end
    

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

if (channel.type == "public") then
  return
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2901 by @jkrause in #[IM @jkrause] 1 year agoSlack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end
-- Created by pjha
function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space

    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp

    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned

    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size

    

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end
if (channel.type == "public") then
return
end
print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2900 by @jkrause in #[IM @jkrause] 1 year agoSlack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end
-- Created by pjha
function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space

    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp

    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned

    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size

    if (channel.type == "public") then
      return
    end

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2899 (deleted) by @jkrause in #[IM @jkrause] 1 year agoSlack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end

function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space

    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp

    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned

    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size
    print(channel.type)
    if (channel.type == "public") then
      return
    end

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2898 (deleted) by @jkrause in #[IM @jkrause] 1 year agoSlack Archive

{lua}function display_sequence (c, w)
    local i = 0
    while i < w do
        print(c)
        i = i + 1
    end
end

function calc_width_top_floor (level, size)
    local i
    local j
    local width

    width = 3
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            width = width + 2
            j = j - 1
        end
        width = width + (2 * (math.floor(i / 2) + 2))
        i = i + 1
    end
    return width
end

function calc_space_top_floot (level, size)
    local i
    local j
    local space

    space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
    i = 0
    while size - level > i do
        j = i + 3
        while j > 0 do
            space = space - 1
            j = j - 1
        end
        space = space + (-2 - math.floor(i / 2))
        i = i + 1
    end
    return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
    local tmp

    tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
    if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
        display_sequence("|", size_aligned)
    else
        display_sequence("|", size_aligned - 2)
        display_sequence("$", 1)
        display_sequence("|", 1)
    end
    display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
    local i
    local brk
    local space_top_floor
    local width_top_level
    local size_aligned

    brk = size - level + 3
    space_top_floor = calc_space_top_floot(level, size)
    width_top_level = calc_width_top_floor(level, size)
    size_aligned = size - (1 - (size % 2))
    i = 0
    while i < brk do
        display_sequence(" ", space_top_floor)
        display_sequence("/", 1)
        if bottom and (brk - size_aligned) <= i then
            show_doorway(i, brk, width_top_level, size_aligned)
        else
            display_sequence("*", width_top_level - 2)
        end
        display_sequence("\\", 1)
        space_top_floor = space_top_floor - 1
        width_top_level = width_top_level + 2
        print("\n");
        i = i + 1
    end
end

function sastantua (size)
    local i = size
    if (channel.type == "public") then
      return  
    end

    if size <= 0 then
        return
    end
    if size >= 20 then
        print("sassy tuna too sassy for you")
        return
    end
    while i > 0 do
        display_level(i, size, i == 1)
        i = i - 1
    end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2489 (deleted) by @sgardner in (via web) 1 year agoSlack Archive

Download the binary from the project page.

Revision: 2488 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence (c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width = width + 2
			j = j - 1
		end
		width = width + (2 * (math.floor(i / 2) + 2))
		i = i + 1
	end
	return width
end

function calc_space_top_floot (level, size)
	local i
	local j
	local space

	space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			space = space - 1
			j = j - 1
		end
		space = space + (-2 - math.floor(i / 2))
		i = i + 1
	end
	return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
	local tmp

	tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
	display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
	if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
		display_sequence("|", size_aligned)
	else
		display_sequence("|", size_aligned - 2)
		display_sequence("$", 1)
		display_sequence("|", 1)
	end
	display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
	local i
	local brk
	local space_top_floor
	local width_top_level
	local size_aligned

	brk = size - level + 3
	space_top_floor = calc_space_top_floot(level, size)
	width_top_level = calc_width_top_floor(level, size)
	size_aligned = size - (1 - (size % 2))
	i = 0
	while i < brk do
		display_sequence(" ", space_top_floor)
		display_sequence("/", 1)
		if bottom and (brk - size_aligned) <= i then
			show_doorway(i, brk, width_top_level, size_aligned)
		else
			display_sequence("*", width_top_level - 2)
		end
		display_sequence("\\", 1)
		space_top_floor = space_top_floor - 1
		width_top_level = width_top_level + 2
		print("\n");
		i = i + 1
	end
end

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	if size >= 20 then
		print("sassy tuna too sassy for you")
		return
	end
	while i > 0 do
		display_level(i, size, i == 1)
		i = i - 1
	end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2486 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence (c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width = width + 2
			j = j - 1
		end
		width = width + (2 * (math.floor(i / 2) + 2))
		i = i + 1
	end
	return width
end

function calc_space_top_floot (level, size)
	local i
	local j
	local space

	space = math.floor((2 * (size + 1) + calc_width_top_floor(1, size)) / 2) - 1
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			space = space - 1
			j = j - 1
		end
		space = space + (-2 - math.floor(i / 2))
		i = i + 1
	end
	return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
	local tmp

	tmp = math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1
	display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
	if size_aligned <= 4 or brk - math.floor(size_aligned / 2) - 1 ~= i then
		display_sequence("|", size_aligned)
	else
		display_sequence("|", size_aligned - 2)
		display_sequence("$", 1)
		display_sequence("|", 1)
	end
	display_sequence("*", math.floor(width_top_level / 2) - math.floor(size_aligned / 2) - 1)
end

function display_level (level, size, bottom)
	local i
	local brk
	local space_top_floor
	local width_top_level
	local size_aligned

	brk = size - level + 3
	space_top_floor = calc_space_top_floot(level, size)
	width_top_level = calc_width_top_floor(level, size)
	size_aligned = size - (1 - (size % 2))
	i = 0
	while i < brk do
		display_sequence(" ", space_top_floor)
		display_sequence("/", 1)
		if bottom and (brk - size_aligned) <= i then
			show_doorway(i, brk, width_top_level, size_aligned)
		else
			display_sequence("*", width_top_level - 2)
		end
		display_sequence("\\", 1)
		space_top_floor = space_top_floor - 1
		width_top_level = width_top_level + 2
		print("\n");
		i = i + 1
	end
end

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		display_level(i, size, i == 1)
		i = i - 1
	end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2485 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence (c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width = width + 2
			j = j - 1
		end
		width = width + (2 * (i / 2 + 2))
		i = i + 1
	end
	return width
end

function calc_space_top_floot (level, size)
	local i
	local j
	local space

	space = (2 * (size + 1) + calc_width_top_floor(1, size)) / 2 - 1
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			space = space - 1
			j = j - 1
		end
		space = space + (-2 - i / 2)
		i = i + 1
	end
	return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
	local tmp

	tmp = (width_top_level / 2) - (size_aligned / 2) - 1
	display_sequence("*", (width_top_level / 2) - (size_aligned / 2) - 1)
	if size_aligned <= 4 or brk - size_aligned / 2 - 1 ~= i then
		display_sequence("|", size_aligned)
	else
		display_sequence("|", size_aligned - 2)
		display_sequence("$", 1)
		display_sequence("|", 1)
	end
	display_sequence("*", width_top_level / 2 - size_aligned / 2 - 1)
end

function display_level (level, size, bottom)
	local i
	local brk
	local space_top_floor
	local width_top_level
	local size_aligned

	brk = size - level + 3
	space_top_floor = calc_space_top_floot(level, size)
	width_top_level = calc_width_top_floor(level, size)
	size_aligned = size - (1 - (size % 2))
	i = 0
	while i < brk do
		display_sequence(" ", space_top_floor)
		display_sequence("/", 1)
		if bottom and (brk - size_aligned) <= i then
			show_doorway(i, brk, width_top_level, size_aligned)
		else
			display_sequence("*", width_top_level - 2)
		end
		space_top_floor = space_top_floor - 1
		width_top_level = width_top_level + 2
		print("\n");
		i = i + 1
	end
end

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		display_level(i, size, i == 1)
		i = i - 1
	end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2484 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence (c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width = width + 2
			j = j - 1
		end
		width = width + (2 * (i / 2 + 2))
		i = i + 1
	end
	return width
end

function calc_space_top_floot (level, size)
	local i
	local j
	local space

	space = (2 * (size + 1) + calc_width_top_floor(1, size)) / 2 - 1
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			space = space - 1
			j = j - 1
		end
		space = space + (-2 - i / 2)
		i = i + 1
	end
	return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
	local tmp

	tmp = (width_top_level / 2) - (size_aligned / 2) - 1
	display_sequence("*", (width_top_level / 2) - (size_aligned / 2) - 1)
	if size_aligned <= 4 or brk - size_aligned / 2 - 1 ~= i then
		display_sequence("|", size_aligned)
	else
		display_sequence("|", size_aligned - 2)
		display_sequence("$", 1)
		display_sequence("|", 1)
	end
	display_sequence("*", width_top_level / 2 - size_aligned / 2 - 1)
end

function display_level (level, size, bottom)
	local i
	local brk
	local space_top_floor
	local width_top_level
	local size_aligned

	brk = size - level + 3
	space_top_floor = calc_space_top_floot(level, size)
	width_top_level = calc_width_top_floor(level, size)
	size_aligned = size - (1 - (size % 2))
	i = 0
	while i < brk do
		display_sequence(" ", space_top_floor)
		display_sequence("/", 1)
		if bottom and (brk - size_aligned) <= i then
			show_doorway(i, brk, width_top_level, size_aligned)
		else
			display_sequence("*", width_top_level - 2)
		end
		space_top_floor = space_top_floor - 1
		width_top_level = width_top_level + 2
		print("\n");
		i = i + 1
	end
end

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		print(i)
		print(" ")
		i = i - 1
	end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2483 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence (c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width = width + 2
			j = j - 1
		end
		width = width + (2 * (i / 2 + 2))
		i = i + 1
	end
	return width
end

function calc_space_top_floot (level, size)
	local i
	local j
	local space

	space = (2 * (size + 1) + calc_width_top_floor(1, size)) / 2 - 1
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			space = space - 1
			j = j - 1
		end
		space = space + (-2 - i / 2)
		i = i + 1
	end
	return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
	local tmp

	tmp = (width_top_level / 2) - (size_aligned / 2) - 1
	display_sequence("*", (width_top_level / 2) - (size_aligned / 2) - 1)
	if size_aligned <= 4 or brk - size_aligned / 2 - 1 ~= i then
		display_sequence("|", size_aligned)
	else
		display_sequence("|", size_aligned - 2)
		display_sequence("$", 1)
		display_sequence("|", 1)
	end
	display_sequence("*", width_top_level / 2 - size_aligned / 2 - 1)
end

function display_level (level, size, bottom)
	local i
	local brk
	local space_top_floor
	local width_top_level
	local size_aligned

	brk = size - level + 3
	space_top_floor = calc_space_top_floot(level, size)
	width_top_level = calc_width_top_floor(level, size)
	size_aligned = size - (1 - (size % 2))
	i = 0
	while i < brk do
		display_sequence(" ", space_top_floor)
		display_sequence("/", 1)
		if bottom && (brk - size_aligned) <= i then
			show_doorway(i, brk, width_top_level, size_aligned)
		else
			display_sequence("*", width_top_level - 2)
		end
		space_top_floor = space_top_floor - 1
		width_top_level = width_top_level + 2
		print("\n");
		i = i + 1
	end
end

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		print(i)
		print(" ")
		i = i - 1
	end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2482 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence (c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width = width + 2
			j = j - 1
		end
		width = width + (2 * (i / 2 + 2))
		i = i + 1
	end
	return width
end

function calc_space_top_floot (level, size)
	local i
	local j
	local space

	space = (2 * (size + 1) + calc_width_top_floor(1, size)) / 2 - 1
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			space = space - 1
			j = j - 1
		end
		space = space + (-2 - i / 2)
		i = i + 1
	end
	return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
	local tmp

	tmp = (width_top_level / 2) - (size_aligned / 2) - 1
	display_sequence("*", (width_top_level / 2) - (size_aligned / 2) - 1)
	if size_aligned <= 4 || brk - size_aligned / 2 - 1 != i then
		display_sequence("|", size_aligned)
	else
		display_sequence("|", size_aligned - 2)
		display_sequence("$", 1)
		display_sequence("|", 1)
	end
	display_sequence("*", width_top_level / 2 - size_aligned / 2 - 1)
end

function display_level (level, size, bottom)
	local i
	local brk
	local space_top_floor
	local width_top_level
	local size_aligned

	brk = size - level + 3
	space_top_floor = calc_space_top_floot(level, size)
	width_top_level = calc_width_top_floor(level, size)
	size_aligned = size - (1 - (size % 2))
	i = 0
	while i < brk do
		display_sequence(" ", space_top_floor)
		display_sequence("/", 1)
		if bottom && (brk - size_aligned) <= i then
			show_doorway(i, brk, width_top_level, size_aligned)
		else
			display_sequence("*", width_top_level - 2)
		end
		space_top_floor = space_top_floor - 1
		width_top_level = width_top_level + 2
		print("\n");
		i = i + 1
	end
end

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		print(i)
		print(" ")
		i = i - 1
	end
end

print("`" .. "`" .. "`")
sastantua(tonumber(args))
print("`" .. "`" .. "`")

Revision: 2481 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence (c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width = width + 2
			j = j - 1
		end
		width = width + (2 * (i / 2 + 2))
		i = i + 1
	end
	return width
end

function calc_space_top_floot (level, size)
	local i
	local j
	local space

	space = (2 * (size + 1) + calc_width_top_floor(1, size)) / 2 - 1
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			space = space - 1
			j = j - 1
		end
		space = space + (-2 - i / 2)
		i = i + 1
	end
	return space
end

function show_doorway (i, brk, width_top_level, size_aligned)
	local tmp

	tmp = (width_top_level / 2) - (size_aligned / 2) - 1
	display_sequence("*", (width_top_level / 2) - (size_aligned / 2) - 1)
	if size_aligned <= 4 || brk - size_aligned / 2 - 1 != i then
		display_sequence("|", size_aligned)
	else
		display_sequence("|", size_aligned - 2)
		display_sequence("$", 1)
		display_sequence("|", 1)
	end
	display_sequence("*", width_top_level / 2 - size_aligned / 2 - 1)
end

function display_level (level, size, bottom)
	local i
	local brk
	local space_top_floor
	local width_top_level
	local size_aligned

	brk = size - level + 3
	space_top_floor = calc_space_top_floot(level, size)
	width_top_level = calc_width_top_floor(level, size)
	size_aligned = size - (1 - (size % 2))
	i = 0
	while i < brk do
		display_sequence(" ", space_top_floor)
		display_sequence("/", 1)
		if bottom && (brk - size_aligned) <= i then
			show_doorway(i, brk, width_top_level, size_aligned)
		else
			display_sequence("*", width_top_level - 2)
		end
		space_top_floor = space_top_floor - 1
		width_top_level = width_top_level + 2
		print("\n");
		i = i + 1
	end
end

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		print(i)
		print(" ")
		i = i - 1
	end
end

print("```")
sastantua(tonumber(args))
print("```")

Revision: 2476 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function calc_width_top_floor (level, size)
	local i
	local j
	local width

	width = 3
	i = 0
	while size - level > i do
		j = i + 3
		while j > 0 do
			width += 2
			j--
		end
		width += 2 * (i / 2 + 2)
		i++
	end
	return width
end
print(calc_width_top_floor(5, 5)

Revision: 2475 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence(c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end
display_sequence("B", 5)

Revision: 2474 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence(c, w)
	local i = 0
	while i < w do
		print(c)
		i = i + 1
	end
end

Revision: 2473 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}function display_sequence(c, w)
	local i = 0
	while i < w do
		print(c)
	end
end
display_sequence("l", 5)

Revision: 2472 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive

{lua}

function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		print(i)
		print(" ")
		i = i - 1
	end
end

sastantua(tonumber(args))

Revision: 2471 (deleted) by @pjha in <!error getting other user for D7SC58AD8> 1 year agoSlack Archive



function sastantua (size)
	local i = size

	if size <= 0 then
		return
	end
	while i > 0 do
		print(i)
		print(" ")
		i = i - 1
	end
end

sastantua(tonumber(args))