CrazyEngineers
  • ...just a code written in #-Link-Snipped-#
    setbatchlines -1
    
    No = 1234567891234567891234567891234567891234567899
    
    MsgBox % "Square of " . No . " is:`n" square(No)
    exitapp
    
    square(No)
    {
    
    
    
    No := "0" . No
    
    Q := R := StrLen(No)
    
    zeroes := StrLen(No) * 2 + 2
    
    stringsplit, k, No
    
    index := 1
    
    Loop, % StrLen(No)
    {
       
            Loop, % StrLen(No)
            {
                if ( append = "" )
                    append = 0
            process := k%Q% * k%R% + append
            append =
            stringsplit, A, Process
                if ( A0 = 2 )
                {
                        digit := A2
                        Append := A1
                }  
                else
                {
                        digit := A1
                        Append :=
                }
    ;~ MsgBox % digit
            M%index% := digit M%index%
            digit =
            r--
            }
    
    append_zeroes :=  index-1
    
    
    loop, % append_zeroes
        app_zer .= 0
    
    M%index% := M%index% . app_zer
    app_zer =
    
    
    loop, % zeroes - Strlen(M%index%) - 2
        Zer .= 0
    
    M%index% := Zer . M%index%
    ans .= M%index% "`n"
    
    
    StringSplit, new_line, M%index%
    StringSplit, ol_ne, old_line
    damm := new_line0
    
    
    if ( old_line != "" )
    {
       
    loop, % new_line0
    {
    
    if ( append2 = "" )
        append2 = 0
    
    process2 := new_line%damm% + ol_ne%damm% + append2
    append2 =
    stringsplit, A_A, Process2
    if ( A_A0 = 2 )
    {
        digit2 := A_A2
        Append2 := A_A1
    }
    else
    {
        digit2 := A_A1
        Append2 :=
    }
    damm--
    final := digit2 final
    }
    append2 = digit2 =
    }
    
    if ( final = "" )
    old_line := M%index%
    else
        old_line := final
    if ( A_index != StrLen(No) )
    final =
    Process = Append :=
    Q--
    R := StrLen(No)
    index++
        Zer :=
    }
    
    StringSplit, the_end, m1
    
    end := the_end%the_end0%
    
    final := RegExReplace(final, "(0)+(\d+)0", "$2")
    
    final := final . end
    
    return final
    }
    
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • zaveri

    MemberApr 23, 2014

    So what
    Are you sure? This action cannot be undone.
    Cancel
  • smorgasbord

    MemberApr 23, 2014

    just ignore, right?
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register