Water Towers ( Rosetta Code)

Implemented in LB



    data "1,5,3,7,2", "5,3,7,2,6,4,5,9,1,2", "2,6,3,5,2,8,1,4,2,2,5,3,5,7,4,1", "5,5,5,5", "5,6,7,8", "8,7,7,6", "6,7,10,7,6"

    nomainwin

    dim array$( 20, 20)

    WindowWidth  = 400
    WindowHeight = 500

    open "Water Towers" for graphics_nsb as #wg

    #wg "trapclose quit"

    #wg "down ; fill darkblue"
    #wg "font Ubuntu_Mono 15 bold"

    for k =1 to 7
        rain =0
        read wt$

        towersIn    =1
        for i =1 to len( wt$)
            if mid$( wt$, i, 1) ="," then towersIn =towersIn +1
        next i

        #wg "cls"

        gosub [clearArray]

        for i =1 to towersIn
            v =val( word$( wt$, i, ","))
            for j =0 to 20
                if j 


tenochtitlanuk ------- JohnF ------ Apr 2020 ------ mr dot john dot f at gmail.com