Cake by Jacob

@layers = gets.to_i


def make_layers layers, bl,l
    if layers == 1 
  
    answ= ""
    ((l-1)*2).times do
            answ+=" "
        end
        answ += "\xe2\x95\xad\xe2\x94\x80\xe2\x95\xa8\xe2\x94\x80\xe2\x95\xa8\xe2\x94\x80\xe2\x95\xae\n"
        ((l-2)*2).times do
            answ += " "
        end
        answ += "\xe2\x95\xad\xe2\x94\x80\xe2\x94\xb4\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xb4\xe2\x94\x80\xe2\x95\xae\n"
    
    return answ
    else

        mid_section=""
        ((l-(layers))*2).times do
            mid_section+=" "
        end
        mid_section+="\xe2\x94\x82"
       
        bot_section=""
          ((l-layers)*2).times do
            bot_section+=" "
        end
        (1+(4*layers)).times do
            mid_section+=" "
        end
        mid_section += "\xe2\x94\x82"
        if bl
            bot_section="\xe2\x94\x94"
            (1+ (4*layers)).times do
                bot_section+="\xe2\x94\x80"
            end
            bot_section+="\xe2\x94\x98"
            return make_layers(layers-1, false,l) + mid_section + "\n" + bot_section + "\n" 
        else
            bot_section=""
            ((l-(layers+1))*2).times do
            bot_section+=" "
        end
            bot_section+="\xe2\x95\xad\xe2\x94\x80\xe2\x94\xb4"
            (1+(4*layers)).times do
                bot_section+="\xe2\x94\x80"
            end
            bot_section+="\xe2\x94\xb4\xe2\x94\x80\xe2\x95\xae"
            return make_layers(layers-1, false,l) + mid_section + "\n" + bot_section + "\n" 
        end
    end

end
  
if @layers == 1 
    puts "\xe2\x95\xad\xe2\x94\x80\xe2\x95\xa8\xe2\x94\x80\xe2\x95\xa8\xe2\x94\x80\xe2\x95\xae\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98"
else
    puts make_layers(@layers.to_i, true,@layers.to_i)
end

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page