Beginners

Hi
I am a beginner and I try to start with code.
Could you please help me?

I want to create simple pattern on output.
I manage to do draw it on the screen.

function draw(){
textMode(CENTER)
textSize(37)
wLine=500
for n=1, 7 do
     for d=1, 4-math.abs(4-n) do
           text("A", 250+d*17,wLine)
     end
wLine=wLine-20
end
end

How can I do that on output?

Thanks

@mamazur I’m not sure why you want to show the pattern on the output screen. The output area should be the last place you want to do anything. The graphic screen is the major display area. Printing to the output area just slows everything down. But, here is what I think you asked for.


function draw()
    background(40,40,50)
    fill(255)
    textMode(CENTER)
    textSize(37)
    wLine=500
    for n=1, 7 do
         for d=1, 4-math.abs(4-n) do
           text("A", 250+d*17,wLine)
         end
    wLine=wLine-20
    end
    
    output.clear()
    v=1
    z=1
    for n=1,7 do
        str=""
        for d=1,z do
            str=str.."A"
        end
        z=z+v
        if z==4 then
            v=-1
        end      
        print(str)
    end           
end