init_arr %hod (1) 854, 140 65416                   //  
init_arr %LevVerh (1) 851, 198               //   


//     
init_arr %workwindow (1) 0 0            //      
set #handle 2                           //  
//set #handle findwindow ()

set linedelay 0
if  workwindow = 0
    log    
    End_script
end_if
log open
wait 100
set windowpos 0 0 500 300 loghandle
log clear
log mode compact
set $regexp6 "(\d)\1\1\d\1\1|(\d)\2\d\2\2\2|(\d)\d\3\3\3\3|(\d)\4\4\4\4\d|(\d)\5\5\5\d\5|\d(\d)\6\6\6\6"
set %reg [1 1] "(\d)\1\1\1\d\d|(\d)\d\2\2\2\2|(\d)\3\3\3\d\3|\d(\d)\4\4\4\d|\d\d(\d)\5\5\5|(\d)\d\6\6\6\d|"
set %reg [1 2] "(\d)\7\d\7\7\d|(\d)\8\8\d\8\d|\d(\d)\9\d\9\9|\d(?<10>\d)\k<10>\k<10>\d\k<10>|\d(?<11>\d)\d\k<11>\k<11>\k<11>"
set $regexp5 %reg [1]
set $regexp4 "(\d)\1\1|(\d)\2\d\2|(\d)\d\3\3|(\d)\4\4(\d)\5\5"
set $regexp3_1 "(\d)\1"
set $regexp3_2 "(\d)\d\1"

set #startX %LevVerh [1 1] + %workwindow [1 1]
set #startY %LevVerh [1 2] + %workwindow [1 2]
set #stepX 41
set #stepY 41
set #endX #startX + #stepX * 5
set #endY #startY + #stepY * 5

set #hodx %hod [1 1] + %workwindow [1 1]
set #hody %hod [1 2] + %workwindow [1 2]

//set %imya [1] 
//set %imya [2] 
//set %imya [3] Ƹ
//set %imya [4] 
//set %imya [5] 


:start
set size(%left)
set #result 0
if  %workwindow [1 1] = 0 and %workwindow [1 2] = 0
    while_not #hodx #hody %hod [1 3]    //    
        wait 100
    end_while
else
    while_not color (#hodx #hody #handle) = %hod [1 3]    //   
        wait 100
    end_while
end_if

wait 300
log clear
set timer

set #a findcolor (#startX #startY #endX #endY #stepX #stepY (0-16777215) %arr #handle)
//log size(%arr)
//save_array %arr C:\ColorInput.txt
if  size(%arr) = 36
    set #sizeInput size (%arr)
    set #sizeOutput 0
    set size(%output)
    for #i 1 #sizeInput  1 //   .
        set #duplicat 0 //   ,    .
        for #n 1 #sizeOutput 1          //   .
            if  %arr[#i 3] = %output[#n]  //         .
                set #duplicat 1         //  ,    .
                break            //    .
            end_if
        end_for
        if  #duplicat = 0 //     .
            set #sizeOutput #sizeOutput  + 1 //    .
            set %output[#sizeOutput ] %arr[#i 3] //     ,   .
        end_if
    end_for
else
    goto start
end_if

save_array %output C:\ColorOutput.txt
//log size (%output)
if  size (%output) < 6
    //  
    set #a findcolor (#startX #startY #endX #endY #stepX #stepY (%output [1 1] %output [2 1] %output [3 1] %output [4 1] %output [5 1]) %arr #handle)
    if  #a > 0
        set #z 0
        for #i 1 6
            for #j 1 6
                set #z #z + 1
                switch %arr [#z 3]
                    case %output [1 1]: set %a [#i #j] 1
                        break
                    case %output [2 1]: set %a [#i #j] 2
                        break
                    case %output [3 1]: set %a [#i #j] 3
                        break
                    case %output [4 1]: set %a [#i #j] 4
                        break
                    case %output [5 1]: set %a [#i #j] 5
                end_switch
            end_for
        end_for
    end_if
    save_array %a C:\Setka.txt    // 
else
    goto start
end_if

for #i 1 size(%a)
    init_arr %b (#i)  %a[1 #i] %a[2 #i] %a[3 #i] %a[4 #i] %a[5 #i] %a[6 #i]
end_for


call line6 %a $regexp6 0
call line6 %b $regexp6 1
if  #result != 1
    call line5 %a $regexp5 0
    call line5 %b $regexp5 1
    if  #result != 1
        call line4 %a $regexp4 0
        call line4 %b $regexp4 1
        if  #result != 1
            for #i 1 size(%a)
                set $string %a [#i]
                call line3_1 %a #i $string $string 0 $regexp3_1 0
                call line3_2 %a #i $string $string 0 $regexp3_2 0
            end_for
            set %a %b
            for #i 1 size(%a)   //   %a
                set $string %a [#i]
                call line3_1 %a #i $string $string 0 $regexp3_1 1
                call line3_2 %a #i $string $string 0 $regexp3_2 1
            end_for
        end_if
    end_if
end_if

//    
for #i 1 size(%left)
    log   %left [#i 2] %left [#i 1]  %left [#i 4] %left [#i 3]      %left [#i 6]    %left [#i 7]
end_for

log
log    : timer 
//     
if  size(%left) > 0
    //sort_array %left 5
    log
    log  : %left [1 2] %left [1 1]  %left [1 4] %left [1 3]      %left [1 6]    %left [1 7]
    set #x1 ((#startX + %left [1 1] * #stepX) - #stepX) - %workwindow [1 1]
    set #y1 ((#startY + %left [1 2] * #stepY) - #stepY) - %workwindow [1 2]
    set #x2 ((#startX + %left [1 3] * #stepX) - #stepX) - %workwindow [1 1]
    set #y2 ((#startY + %left [1 4] * #stepY) - #stepY) - %workwindow [1 2]
end_if

//  
left #x1 #y1
wait 200
left #x2 #y2
wait 100
left 133, 575 20 20 20 20
wait 1000
goto start
End_script

proc colrow #col1 #row1 #col2 #row2 #flagcolrow #number #cur #z
    set #result.#cur 1
    log mode compact
    if  #flagcolrow = 0
        set #size size(%left.#cur)
        set #size #size + 1
        set %left.#cur [#size 1] #row1
        set %left.#cur [#size 2] #col1
        set %left.#cur [#size 3] #row2
        set %left.#cur [#size 4] #col2
        set %left.#cur [#size 5] #z
        set %left.#cur [#size 6] #number
        set %left.#cur [#size 7] %imya.#cur [#z]
    else
        set #size size(%left.#cur)
        set #size #size + 1
        set %left.#cur [#size 1] #col1
        set %left.#cur [#size 2] #row1
        set %left.#cur [#size 3] #col2
        set %left.#cur [#size 4] #row2
        set %left.#cur [#size 5] #z
        set %left.#cur [#size 6] #number
        set %left.#cur [#size 7] %imya.#cur [#z]
    end_if
end_proc


//  111110 011111 101111 110111 111011 111101 (  6  )
proc line6 %c $regexp #flagcolrow
    for #i 1 size(%c)
        set #n regexp (#pos $str %c[#i] $regexp)
        if  #n > 0
            switch #i
                case 1:
                    set #n regexp (#pos1 $str1 %c[#i] (\d)\1\1\1\1)
                    if  #n > 0
                        if  #pos1 = 1
                            set #z copy($str1 1 1)
                            if  %c [2 6] = #z
                                set #cure  current_script
                                call colrow #i 6 2 6 #flagcolrow 6 current_script #z
                            end_if
                        else
                            set #z copy($str1 5 1)
                            if  %c [2 1] = #z
                                call colrow #i 1 2 1 #flagcolrow 6 current_script #z
                            end_if
                        end_if
                    else
                        set #n regexp (#position $strnew %c[#i] (?<=(\d))(?!\1)\d)
                        if  #n > 0
                            set #str %c[#i]
                            if  #position = 2
                                set #z copy($str 3 1)
                            else
                                set #z copy($str 2 1)
                            end_if
                            if  %c [2 #position] = #z
                                call colrow #i #position 2 #position #flagcolrow 6 current_script #z
                            end_if
                        end_if
                    end_if
                    break
                case 2:
                case 3:
                case 4:
                case 5:
                    set #col1 #i - 1
                    set #col2 #i + 1
                    set #n regexp (#pos1 $str1 %c[#i] (\d)\1\1\1\1)
                    if  #n > 0

                        if  #pos1 = 1
                            set #z copy($str1 1 1)
                            if  %c [#col1 6] = #z
                                call colrow #i 6 #col1 6 #flagcolrow 6 current_script #z
                            end_if
                            if  %c [#col2 6] = #z
                                call colrow #i 6 #col2 6 #flagcolrow 6 current_script #z
                            end_if
                        else
                            set #z copy($str1 5 1)
                            if  %c [#col1 1] = #z
                                call colrow #i 1 #col1 1 #flagcolrow 6 current_script #z
                            end_if
                            if  %c [#col2 1] = #z
                                call colrow #i 1 #col2 1 #flagcolrow 6 current_script #z
                            end_if
                        end_if
                    else
                        set #n regexp (#position $strnew %c[#i] (?<=(\d))(?!\1)\d)
                        if  #n > 0
                            set #str %c[#i]
                            if  #position = 2
                                set #z copy($str 3 1)
                            else
                                set #z copy($str 2 1)
                            end_if
                            set #col1 #i - 1
                            set #col2 #i + 1
                            if  #pos1 = 1
                                if  %c [#col1 #position] = #z
                                    call colrow #i #position #col1 #position #flagcolrow 6 current_script #z
                                end_if
                                if  %c [#col2 #position] = #z
                                    call colrow #i #position #col2 #position #flagcolrow 6 current_script #z
                                end_if
                            else
                                if  %c [#col1 #position] = #z
                                    call colrow #i #position #col1 #position #flagcolrow 6 current_script #z
                                end_if
                                if  %c [#col2 #position] = #z
                                    call colrow #i #position #col2 #position #flagcolrow 6 current_script #z
                                end_if
                            end_if
                        end_if
                    end_if
                    break
                case 6:
                    set #n regexp (#pos1 $str1 %c[#i] (\d)\1\1\1\1)
                    if  #n > 0
                        if  #pos1 = 1
                            set #z copy($str1 1 1)
                            if  %c [5 6] = #z
                                call colrow #i 6 5 6 #flagcolrow 6 current_script #z
                            end_if
                        else
                            set #z copy($str1 5 1)
                            if  %c [5 1] = #z
                                call colrow #i 1 5 1 #flagcolrow 6 current_script #z
                            end_if
                        end_if
                    else
                        set #n regexp (#position $strnew %c[#i] (?<=(\d))(?!\1)\d)
                        if  #n > 0
                            set #str %c[#i]
                            if  #position = 2
                                set #z copy($str 3 1)
                            else
                                set #z copy($str 2 1)
                            end_if
                            if  %c [5 #position] = #z
                                call colrow #i #position 5 #position #flagcolrow 6 current_script #z
                            end_if
                        end_if
                    end_if
            end_switch
        end_if
    end_for
end_proc

//  111100 011110 001111   101111 111101

//     101110  110110 111010
proc line5 %c $regexp #flagcolrow
    for #i 1 size(%c)
        set #n regexp (#pos $str %c[#i] $regexp)
        if  #n > 0
            set #z copy($str 1 1)
            set #n1 regexp (#pos2 $str2 %c[#i] (\d)\d\1\1\1\1|(\d)\2\2\2\d\2)
            if  #n1 = 0         //  111100 011110 001111
                set #n regexp (#pos $str %c[#i] (\d)\1\1\1)
                if  #n > 0
                    set #z copy($str 1 1)
                    switch #i           //   
                        case 1:
                            switch #pos        //  1 2  3
                                case 1:
                                    if  %c [2 5] = #z
                                        call colrow #i 5 2 5 #flagcolrow 5 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [2 1] = #z
                                        call colrow #i 1 2 1 #flagcolrow 5 current_script #z
                                    end_if
                                    if  %c [2 6] = #z
                                        call colrow #i 6 2 6 #flagcolrow 5 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [2 2] = #z
                                        call colrow #i 2 2 2 #flagcolrow 5 current_script #z
                                    end_if
                            end_switch
                            set #flagbreak 1
                            break
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                            set #col1 #i + 1
                            set #col2 #i - 1
                            switch #pos
                                case 1:
                                    if  %c [#col1 5] = #z
                                        call colrow #i 5 #col1 5 #flagcolrow 5 current_script #z
                                    end_if
                                    if  %c [#col2 5] = #z
                                        call colrow #i 5 #col2 5 #flagcolrow 5 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [#col1 6] = #z
                                        call colrow #i 6 #col1 6 #flagcolrow 5 current_script #z
                                    end_if
                                    if  %c [#col2 6] = #z
                                        call colrow #i 6 #col2 6 #flagcolrow 5 current_script #z
                                    end_if
                                    if  %c [#col1 1] = #z
                                        call colrow #i 1 #col1 1 #flagcolrow 5 current_script #z
                                    end_if
                                    if  %c [#col2 1] = #z
                                        call colrow #i 1 #col2 1 #flagcolrow 5 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [#col1 2] = #z
                                        call colrow #i 2 #col1 2 #flagcolrow 5 current_script #z
                                    end_if
                                    if  %c [#col2 2] = #z
                                        call colrow #i 2 #col2 2 #flagcolrow 5 current_script #z
                                    end_if
                            end_switch

                            if  #flagbreak = 1
                                break
                            end_if
                            break
                        case 6:
                            switch #pos        //  1 2  3
                                case 1:
                                    if  %c [5 5] = #z
                                        call colrow #i 5 5 5 #flagcolrow 5 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [5 1] = #z
                                        call colrow #i 1 5 1 #flagcolrow 5 current_script #z
                                    end_if
                                    if  %c [5 6] = #z
                                        call colrow #i 6 5 6 #flagcolrow 5 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [5 2] = #z
                                        call colrow #i 2 5 2 #flagcolrow 5 current_script #z
                                    end_if
                            end_switch
                    end_switch
                end_if
            else
                // 111101    101111
                set #n regexp (#pos $str %c[#i] (\d)\1\1\1)
                if  #n > 0
                    if  #pos = 1
                        if  %c [#i 6] = #z
                            call colrow #i 5 #i 6 #flagcolrow 5 current_script #z
                        end_if
                    else
                        if  %c [#i 1] = #z
                            call colrow #i 1 #i 2 #flagcolrow 5 current_script #z
                        end_if
                    end_if
                end_if
            end_if
            //  111010  011101       101110  010111       110110   011011
            set #n regexp (#pos1 $str1 %c[#i] (\d)\1\1\1\1)    //    5  
            if  #n = 0
                set #n regexp (#pos1 $str1 %c[#i] (\d)\d\1\1\1\d|(\d)\2\d\2\2\d|(\d)\3\3\d\3\d|\d(\d)\4\d\4\4|\d(\d)\d\5\5\5|\d(\d)\6\6\d\6)
                if  #n > 0
                    set #n1 regexp (#pos1 $str1 %c[#i] (\d)\1\1)    //  111010  011101       101110  010111
                    set #n2 regexp (#pos3 $str3 %c[#i] (\d)\1\d\1\1)    // 110110   011011
                    switch #i
                        case 1:
                            if  #n1 > 0
                                set #z copy($str1 1 1)
                                switch #pos1
                                    case 1:
                                        if  %c [2 4] = #z
                                            call colrow #i 4 2 4 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 2:
                                        if  %c [2 5] = #z
                                            call colrow #i 5 2 5 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 3:
                                        if  %c [2 2] = #z
                                            call colrow #i 2 2 2 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 4:
                                        if  %c [2 3] = #z
                                            call colrow #i 3 2 3 #flagcolrow 5 current_script #z
                                        end_if
                                end_switch
                            end_if
                            if  #n2 > 0
                                if  #pos3 = 1
                                    if  %c [2 3] = #z
                                        call colrow #i 3 2 3 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                                if  #pos3 = 2
                                    set #z copy($str3 1 1)
                                    if  %c [2 4] = #z
                                        call colrow #i 4 2 4 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                            end_if
                            set #flagbreak 1
                            break
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                            set #col1 #i + 1
                            set #col2 #i - 1
                            if  #n1 > 0
                                set #z copy($str1 1 1)
                                switch #pos1
                                    case 1:
                                        if  %c [#col1 4] = #z
                                            call colrow #i 4 #col1 4 #flagcolrow 5 current_script #z
                                        end_if
                                        if  %c [#col2 4] = #z
                                            call colrow #i 4 #col2 4 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 2:
                                        if  %c [#col1 5] = #z
                                            call colrow #i 5 #col1 5 #flagcolrow 5 current_script #z
                                        end_if
                                        if  %c [#col2 5] = #z
                                            call colrow #i 5 #col2 5 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 3:
                                        if  %c [#col1 2] = #z
                                            call colrow #i 2 #col1 2 #flagcolrow 5 current_script #z
                                        end_if
                                        if  %c [#col2 2] = #z
                                            call colrow #i 2 #col2 2 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 4:
                                        if  %c [#col1 3] = #z
                                            call colrow #i 3 #col1 3 #flagcolrow 5 current_script #z
                                        end_if
                                        if  %c [#col2 3] = #z
                                            call colrow #i 3 #col2 3 #flagcolrow 5 current_script #z
                                        end_if
                                end_switch
                                if  #flagbreak = 1
                                    break
                                end_if
                            end_if
                            if  #n2 > 0
                                if  #pos3 = 1
                                    if  %c [#col1 3] = #z
                                        call colrow #i 3 #col1 3 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                                if  #pos3 = 2
                                    set #z copy($str3 1 1)
                                    if  %c [#col1 4] = #z
                                        call colrow #i 4 #col1 4 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                                if  #pos3 = 1
                                    if  %c [#col2 3] = #z
                                        call colrow #i 3 #col2 3 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                                if  #pos3 = 2
                                    set #z copy($str3 1 1)
                                    if  %c [#col2 4] = #z
                                        call colrow #i 4 #col2 4 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                            end_if
                            break
                        case 6:
                            if  #n2 > 0
                                if  #pos3 = 1
                                    if  %c [5 3] = #z
                                        call colrow #i 3 5 3 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                                if  #pos3 = 2
                                    set #z copy($str3 1 1)
                                    if  %c [5 4] = #z
                                        call colrow #i 4 5 4 #flagcolrow 5 current_script #z
                                    end_if
                                end_if
                            end_if
                            if  #n1 > 0
                                set #z copy($str1 1 1)
                                switch #pos1
                                    case 1:
                                        if  %c [5 4] = #z
                                            call colrow #i 4 5 4 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 2:
                                        if  %c [5 5] = #z
                                            call colrow #i 5 5 5 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 3:
                                        if  %c [5 2] = #z
                                            call colrow #i 2 5 2 #flagcolrow 5 current_script #z
                                        end_if
                                        break
                                    case 4:
                                        if  %c [5 3] = #z
                                            call colrow #i 3 5 3 #flagcolrow 5 current_script #z
                                        end_if
                                end_switch
                            end_if
                    end_switch
                end_if
            end_if
        end_if
    end_for
end_proc


proc line4 %c $regexp #flagcolrow
    for #i 1 size(%c)
        set #n regexp (#pos $str %c[#i] $regexp)
        if  #n > 0
            set #flagbreak 0
            switch #i
                case 1:
                    //111000
                    set #n1 regexp (#pos1 $str1 %c[#i] (\d)\1\1(\d)\2\2)
                    if  #n1 > 0
                        set #z copy($str1 1 1)
                        if  %c [2 4] = #z
                            call colrow #i 4 2 4 #flagcolrow 4 current_script #z
                        end_if
                        set #z copy($str1 4 1)
                        if  %c [2 3] = #z
                            call colrow #i 3 2 3 #flagcolrow 4 current_script #z
                        end_if
                    end_if

                    //  110100 011010 001101
                    set #n2 regexp (#pos2 $str2 %c[#i] (\d)\1\d\1)
                    set #n6 regexp (#pos6 $str6 %c[#i] (\d)\1\1\1)
                    if  #n6 = 0
                        if  #n2 > 0
                            set #z copy($str2 1 1)
                            switch #pos2
                                case 1:
                                    if  %c [2 3] = #z
                                        call colrow #i 3 2 3 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [2 4] = #z
                                        call colrow #i 4 2 4 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [2 5] = #z
                                        call colrow #i 5 2 5 #flagcolrow 4 current_script #z
                                    end_if
                            end_switch
                        end_if
                    end_if
                    // 101100 010110 001011
                    set #n3 regexp (#pos3 $str3 %c[#i] (\d)\d\1\1)
                    set #n6 regexp (#pos6 $str6 %c[#i] (\d)\1\1\1)
                    if  #n6 = 0
                        if  #n3 > 0
                            set #z copy($str3 1 1)
                            switch #pos3
                                case 1:
                                    if  %c [2 2] = #z
                                        call colrow #i 2 2 2 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [2 3] = #z
                                        call colrow #i 3 2 3 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [2 4] = #z
                                        call colrow #i 4 2 4 #flagcolrow 4 current_script #z
                                    end_if
                            end_switch
                        end_if
                    end_if
                    //  101110 010111  111010 011101    3  111
                    set #n4 regexp (#pos4 $str4 %c[#i] (\d)\1\1)
                    if  #n4 > 0
                        set #n5 regexp (#pos5 $str5 %c[#i] (\d)\1\1\1)
                        if  #n5 = 0
                            set #z copy($str4 1 1)
                            switch #pos4
                                case 1:
                                    if  %c [1 5] = #z
                                        call colrow #i 4 #i 5 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [2 4] = #z
                                            call colrow #i 4 2 4 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    break
                                case 2:
                                    if  %c [1 6] = #z
                                        call colrow #i 5 #i 6 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [2 5] = #z
                                            call colrow #i 5 2 5 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    if  %c [2 1] = #z
                                        call colrow #i 1 2 1 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [1 1] = #z
                                        call colrow #i 1 #i 2 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [2 2] = #z
                                            call colrow #i 2 2 2 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    if  %c [2 6] = #z
                                        call colrow #i 6 2 6 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 4:
                                    if  %c [1 2] = #z
                                        call colrow #i 2 #i 3 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [2 3] = #z
                                            call colrow #i 3 2 3 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                            end_switch
                        end_if
                    end_if
                    set #flagbreak 1
                    break
                case 2:
                case 3:
                case 4:
                case 5:
                    //111000
                    set #col1 #i + 1
                    set #col2 #i - 1
                    set #n1 regexp (#pos1 $str1 %c[#i] (\d)\1\1(\d)\2\2)
                    if  #n1 > 0
                        set #z copy($str1 1 1)
                        if  %c [#col1 4] = #z
                            call colrow #i 4 #col1 4 #flagcolrow 4 current_script #z
                        end_if
                        if  %c [#col2 4] = #z
                            call colrow #i 4 #col2 4 #flagcolrow 4 current_script #z
                        end_if
                        set #z copy($str1 4 1)
                        if  %c [#col1 3] = #z
                            call colrow #i 3 #col1 3 #flagcolrow 4 current_script #z
                        end_if
                        if  %c [#col2 3] = #z
                            call colrow #i 3 #col2 3 #flagcolrow 4 current_script #z
                        end_if
                    end_if
                    //  110100 011010 001101
                    set #n2 regexp (#pos2 $str2 %c[#i] (\d)\1\d\1)
                    set #n6 regexp (#pos6 $str6 %c[#i] (\d)\1\1\1)
                    if  #n6 = 0
                        if  #n2 > 0
                            set #col1 #i + 1
                            set #col2 #i - 1
                            set #z copy($str2 1 1)
                            switch #pos2
                                case 1:
                                    if  %c [#col1 3] = #z
                                        call colrow #i 3 #col1 3 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 3] = #z
                                        call colrow #i 3 #col2 3 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [#col1 4] = #z
                                        call colrow #i 4 #col1 4 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 4] = #z
                                        call colrow #i 4 #col2 4 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [#col1 5] = #z
                                        call colrow #i 5 #col1 5 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 5] = #z
                                        call colrow #i 5 #col2 5 #flagcolrow 4 current_script #z
                                    end_if
                            end_switch
                        end_if
                    end_if
                    if  #flagbreak = 1
                        break
                    end_if
                    // 101100 010110 001011
                    set #n3 regexp (#pos3 $str3 %c[#i] (\d)\d\1\1)
                    set #n6 regexp (#pos6 $str6 %c[#i] (\d)\1\1\1)
                    if  #n6 = 0
                        if  #n3 > 0
                            set #col1 #i + 1
                            set #col2 #i - 1
                            set #z copy($str3 1 1)
                            switch #pos3
                                case 1:
                                    if  %c [#col1 2] = #z
                                        call colrow #i 2 #col1 2 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 2] = #z
                                        call colrow #i 2 #col2 2 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [#col1 3] = #z
                                        call colrow #i 3 #col1 3 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 3] = #z
                                        call colrow #i 3 #col2 3 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [#col1 4] = #z
                                        call colrow #i 4 #col1 4 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 4] = #z
                                        call colrow #i 4 #col2 4 #flagcolrow 4 current_script #z
                                    end_if
                            end_switch
                        end_if
                    end_if
                    if  #flagbreak = 1
                        break
                    end_if
                    //  101110 010111  111010 011101    3  111
                    set #n4 regexp (#pos4 $str4 %c[#i] (\d)\1\1)
                    if  #n4 > 0
                        set #n5 regexp (#pos5 $str5 %c[#i] (\d)\1\1\1)
                        if  #n5 = 0
                            set #col1 #i + 1
                            set #col2 #i - 1
                            set #z copy($str4 1 1)
                            switch #pos4
                                case 1:
                                    if  %c [#i 5] = #z
                                        call colrow #i 4 #i 5 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [#col1 4] = #z
                                            call colrow #i 4 #col1 4 #flagcolrow 4 current_script #z
                                        end_if
                                        if  %c [#col2 4] = #z
                                            call colrow #i 4 #col2 4 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    set #flagbreak 1
                                    break
                                case 2:
                                    if  %c [#i 6] = #z
                                        call colrow #i 5 #i 6 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [#col1 5] = #z
                                            call colrow #i 5 #col1 5 #flagcolrow 4 current_script #z
                                        end_if
                                        if  %c [#col2 5] = #z
                                            call colrow #i 5 #col2 5 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    if  %c [#col1 1] = #z
                                        call colrow #i 1 #col1 1 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 1] = #z
                                        call colrow #i 1 #col2 1 #flagcolrow 4 current_script #z
                                    end_if
                                    set #flagbreak 1
                                    break
                                case 3:
                                    if  %c [#i 1] = #z
                                        call colrow #i 1 #i 2 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [#col1 2] = #z
                                            call colrow #i 2 #col1 2 #flagcolrow 4 current_script #z
                                        end_if
                                        if  %c [#col2 2] = #z
                                            call colrow #i 2 #col2 2 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    if  %c [#col1 6] = #z
                                        call colrow #i 6 #col1 6 #flagcolrow 4 current_script #z
                                    end_if
                                    if  %c [#col2 6] = #z
                                        call colrow #i 6 #col2 6 #flagcolrow 4 current_script #z
                                    end_if
                                    set #flagbreak 1
                                    break
                                case 4:
                                    if  %c [#i 2] = #z
                                        call colrow #i 2 #i 3 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [#col1 3] = #z
                                            call colrow #i 3 #col1 3 #flagcolrow 4 current_script #z
                                        end_if
                                        if  %c [#col2 3] = #z
                                            call colrow #i 3 #col2 3 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                            end_switch
                        end_if
                    end_if
                    set #flagbreak 1
                    break

                case 6:
                    //  101110 010111  111010 011101    3  111
                    set #n4 regexp (#pos4 $str4 %c[#i] (\d)\1\1)
                    if  #n4 > 0
                        set #n5 regexp (#pos5 $str5 %c[#i] (\d)\1\1\1)
                        if  #n5 = 0
                            set #z copy($str4 1 1)
                            switch #pos4
                                case 1:
                                    if  %c [6 5] = #z
                                        call colrow #i 4 #i 5 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [5 4] = #z
                                            call colrow #i 4 5 4 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    break
                                case 2:
                                    if  %c [6 6] = #z
                                        call colrow #i 5 #i 6 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [5 5] = #z
                                            call colrow #i 5 5 5 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    if  %c [5 1] = #z
                                        call colrow #i 1 5 1 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [6 1] = #z
                                        call colrow #i 1 #i 2 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [5 2] = #z
                                            call colrow #i 2 5 2 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                                    if  %c [5 6] = #z
                                        call colrow #i 6 5 6 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 4:
                                    if  %c [6 2] = #z
                                        call colrow #i 2 #i 3 #flagcolrow 4 current_script #z
                                    else
                                        if  %c [5 3] = #z
                                            call colrow #i 3 5 3 #flagcolrow 4 current_script #z
                                        end_if
                                    end_if
                            end_switch
                        end_if
                    end_if
                    if  #flagbreak = 1
                        break
                    end_if

                    //111000
                    set #n1 regexp (#pos1 $str1 %c[#i] (\d)\1\1(\d)\2\2)
                    if  #n1 > 0
                        set #z copy($str1 1 1)
                        if  %c [5 4] = #z
                            call colrow #i 4 5 4 #flagcolrow 4 current_script #z
                        end_if
                        set #z copy($str1 4 1)
                        if  %c [5 3] = #z
                            call colrow #i 3 5 3 #flagcolrow 4 current_script #z
                        end_if
                    end_if



                    //  110100 011010 001101
                    set #n2 regexp (#pos2 $str2 %c[#i] (\d)\1\d\1)
                    set #n6 regexp (#pos6 $str6 %c[#i] (\d)\1\1\1)
                    if  #n6 = 0
                        if  #n2 > 0
                            set #z copy($str2 1 1)
                            switch #pos2
                                case 1:
                                    if  %c [5 3] = #z
                                        call colrow #i 3 5 3 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [5 4] = #z
                                        call colrow #i 4 5 4 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [5 5] = #z
                                        call colrow #i 5 5 5 #flagcolrow 4 current_script #z
                                    end_if
                            end_switch
                        end_if
                        if  #flagbreak = 1
                            break
                        end_if
                    end_if
                    // 101100 010110 001011
                    set #n3 regexp (#pos3 $str3 %c[#i] (\d)\d\1\1)
                    set #n6 regexp (#pos6 $str6 %c[#i] (\d)\1\1\1)
                    if  #n6 = 0
                        if  #n3 > 0
                            set #z copy($str3 1 1)
                            switch #pos3
                                case 1:
                                    if  %c [5 2] = #z
                                        call colrow #i 2 5 2 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 2:
                                    if  %c [5 3] = #z
                                        call colrow #i 3 5 3 #flagcolrow 4 current_script #z
                                    end_if
                                    break
                                case 3:
                                    if  %c [5 4] = #z
                                        call colrow #i 4 5 4 #flagcolrow 4 current_script #z
                                    end_if
                            end_switch
                        end_if
                    end_if
            end_switch
        end_if
    end_for
end_proc

proc line3_1 %a #i $string $newstring #del $regexp #flagcolrow
    set #n regexp (#pos $str $newstring $regexp)
    if  #n > 0
        set #pos #pos + #del
        if  #pos < 5
            set #del #pos + 1
            set $newstring delete($newstring 1 2)
            if  #flagcolrow = 0
                call line3_1 %a #i $string $newstring #del (\d)\1 0
            else
                call line3_1 %a #i $string $newstring #del (\d)\1 1
            end_if
        end_if
    end_if
    if  #n > 0
        set #z copy($str 1 1)
        switch #i
            case 1:
                switch #pos
                    case 1:
                        if  %a [1 3] != #z
                            if  %a [2 3] = #z
                                call colrow #i 3 2 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [1 4] = #z
                                call colrow #i 3 1 4 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 2:
                        if  %a [1 1] != #z
                            if  %a [2 1] = #z
                                call colrow #i 1 2 1 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [1 4] != #z
                            if  %a [2 4] = #z
                                call colrow #i 4 2 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [1 5] = #z
                                call colrow #i 4 1 5 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 3:
                        if  %a [1 2] != #z
                            if  %a [2 2] = #z
                                call colrow #i 2 2 2 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [1 1] = #z
                                call colrow #i 2 1 1 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [1 5] != #z
                            if  %a [2 5] = #z
                                call colrow #i 5 2 5 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [1 6] = #z
                                call colrow #i 5 1 6 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 4:
                        if  %a [1 3] != #z
                            if  %a [2 3] = #z
                                call colrow #i 3 2 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [1 2] = #z
                                call colrow #i 3 1 2 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [1 6] != #z
                            if  %a [2 6] = #z
                                call colrow #i 6 2 6 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 5:
                        if  %a [1 4] != #z
                            if  %a [2 4] = #z
                                call colrow #i 4 2 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [1 3] = #z
                                call colrow #i 4 1 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 6:
                        if  %a [1 4] != #z
                            if  %a [2 4] = #z
                                call colrow #i 4 2 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [1 3] = #z
                                call colrow #i 4 1 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                end_switch
                break
            case 2:
            case 3:
            case 4:
            case 5:
                set #col1 #i + 1
                set #col2 #i - 1
                switch #pos
                    case 1:
                        if  %a [#i 3] != #z
                            if  %a [#col1 3] = #z
                                call colrow #i 3 #col1 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 3] = #z
                                call colrow #i 3 #col2 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#i 4] = #z
                                call colrow #i 3 #i 4 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 2:
                        if  %a [#i 1] != #z
                            if  %a [#col1 1] = #z
                                call colrow #i 1 #col1 1 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 1] = #z
                                call colrow #i 1 #col2 1 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [#i 4] != #z
                            if  %a [#col1 4] = #z
                                call colrow #i 4 #col1 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 4] = #z
                                call colrow #i 4 #col2 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#i 5] = #z
                                call colrow #i 4 #i 5 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 3:
                        if  %a [#i 2] != #z
                            if  %a [#col1 2] = #z
                                call colrow #i 2 #col1 2 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 2] = #z
                                call colrow #i 2 #col2 2 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#i 1] = #z
                                call colrow #i 2 #i 1 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [#i 5] != #z
                            if  %a [#col1 5] = #z
                                call colrow #i 5 #col1 5 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 5] = #z
                                call colrow #i 5 #col2 5 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#i 6] = #z
                                call colrow #i 5 #i 6 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 4:
                        if  %a [#i 3] != #z
                            if  %a [#col1 3] = #z
                                call colrow #i 3 #col1 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 3] = #z
                                call colrow #i 3 #col2 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#i 2] = #z
                                call colrow #i 3 #i 2 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [#i 6] != #z
                            if  %a [#col1 6] = #z
                                call colrow #i 6 #col1 6 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 6] = #z
                                call colrow #i 6 #col2 6 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 5:
                        if  %a [#i 4] != #z
                            if  %a [#col1 4] = #z
                                call colrow #i 4 #col1 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 4] = #z
                                call colrow #i 4 #col2 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#i 3] = #z
                                call colrow #i 4 #i 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 6:
                        if  %a [#i 4] != #z
                            if  %a [#col1 4] = #z
                                call colrow #i 4 #col1 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 4] = #z
                                call colrow #i 4 #col2 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#i 3] = #z
                                call colrow #i 4 #i 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                end_switch
                break
            case 6:
                switch #pos
                    case 1:
                        if  %a [6 3] != #z
                            if  %a [5 3] = #z
                                call colrow #i 3 5 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [6 4] = #z
                                call colrow #i 3 6 4 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 2:
                        if  %a [6 1] != #z
                            if  %a [5 1] = #z
                                call colrow #i 1 5 1 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [6 4] != #z
                            if  %a [5 4] = #z
                                call colrow #i 4 5 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [6 5] = #z
                                call colrow #i 4 6 5 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 3:
                        if  %a [6 2] != #z
                            if  %a [5 2] = #z
                                call colrow #i 2 5 2 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [6 1] = #z
                                call colrow #i 2 6 1 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [6 5] != #z
                            if  %a [5 5] = #z
                                call colrow #i 5 5 5 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [6 6] = #z
                                call colrow #i 5 6 6 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 4:
                        if  %a [6 3] != #z
                            if  %a [5 3] = #z
                                call colrow #i 3 5 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [6 2] = #z
                                call colrow #i 3 6 2 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        if  %a [6 6] != #z
                            if  %a [5 6] = #z
                                call colrow #i 6 5 6 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 5:
                        if  %a [6 4] != #z
                            if  %a [5 4] = #z
                                call colrow #i 4 5 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [6 3] = #z
                                call colrow #i 4 6 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 6:
                        if  %a [6 4] != #z
                            if  %a [5 4] = #z
                                call colrow #i 4 5 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [6 3] = #z
                                call colrow #i 4 6 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                end_switch
        end_switch
    end_if
end_proc

proc line3_2 %a #i $string $newstring #del $regexp #flagcolrow
    set #n regexp (#pos $str $newstring $regexp)
    if  #n > 0
        set #pos #pos + #del
        if  #pos < 4
            set #del #pos
            set $newstring delete($string 1 #pos)
            if  #flagcolrow = 0
                call line3_2 %a #i $string $newstring #del (\d)\d\1 0
            else
                call line3_2 %a #i $string $newstring #del (\d)\d\1 1
            end_if
        end_if
    end_if
    if  #n > 0
        set #z copy($str 1 1)
        switch #i
            case 1:
                switch #pos
                    case 1:
                        if  %a [1 2] != #z
                            if  %a [2 2] = #z
                                call colrow #i 2 2 2 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 2:
                        if  %a [1 3] != #z
                            if  %a [2 3] = #z
                                call colrow #i 3 2 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 3:
                        if  %a [1 4] != #z
                            if  %a [2 4] = #z
                                call colrow #i 4 2 4 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 4:
                        if  %a [1 5] != #z
                            if  %a [2 5] = #z
                                call colrow #i 5 2 5 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                end_switch
                break
            case 2:
            case 3:
            case 4:
            case 5:
                set #col1 #i + 1
                set #col2 #i - 1
                switch #pos
                    case 1:
                        if  %a [#i 2] != #z
                            if  %a [#col1 2] = #z
                                call colrow #i 2 #col1 2 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 2] = #z
                                call colrow #i 2 #col2 2 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 2:
                        if  %a [#i 3] != #z
                            if  %a [#col1 3] = #z
                                call colrow #i 3 #col1 3 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 3] = #z
                                call colrow #i 3 #col2 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 3:
                        if  %a [#i 4] != #z
                            if  %a [#col1 4] = #z
                                call colrow #i 4 #col1 4 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 4] = #z
                                call colrow #i 4 #col2 4 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 4:
                        if  %a [#i 5] != #z
                            if  %a [#col1 5] = #z
                                call colrow #i 5 #col1 5 #flagcolrow 3 current_script #z
                            end_if
                            if  %a [#col2 5] = #z
                                call colrow #i 5 #col2 5 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                end_switch
                break
            case 6:
                switch #pos
                    case 1:
                        if  %a [6 2] != #z
                            if  %a [5 2] = #z
                                call colrow #i 2 5 2 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 2:
                        if  %a [6 3] != #z
                            if  %a [5 3] = #z
                                call colrow #i 3 5 3 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 3:
                        if  %a [6 4] != #z
                            if  %a [5 4] = #z
                                call colrow #i 4 5 4 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                    case 4:
                        if  %a [6 5] != #z
                            if  %a [5 5] = #z
                                call colrow #i 5 5 5 #flagcolrow 3 current_script #z
                            end_if
                        end_if
                        break
                end_switch
        end_switch
    end_if
end_proc