| r2824 vs r2825 | ||
|---|---|---|
| ... | ... | |
| 3890 | 3890 | == method == |
| 3891 | 3891 | [include(틀:ㅁ, str=Hello\, World!)] |
| 3892 | 3892 | toString() 가능 |
| 3893 | ||
| 3894 | == == | |
| 3895 | {{{#!wiki style="font-weight: 300; font-size: 20px" | |
| 3896 | {{{#!if 식 = '11+2' | |
| 3897 | @식=11+2@}}} = {{{#!if s1=false, s2=false, s3=false, j=1+0, i=0+0, k=1+0 | |
| 3898 | ##switch1 : 숫자 계속 탐색하기, switch2 : 소수점 아래 기입하기. switch3 : 중복 실행 방지. | |
| 3899 | }}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57) | |
| 3900 | }}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false) | |
| 3901 | ##숫자를 발견할 경우 | |
| 3902 | {{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true | |
| 3903 | ##여기에 앞자리가 음수냐 아니냐를 읽는 판별을 만들어야 합니다. ㅏ 이걸 생각 못했네요 그럼 좀 많이 길어지는데 | |
| 3904 | }}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false) | |
| 3905 | ##숫자를 계속 발견할 경우 (소수점일 수도 있습니다. 여기서는 숫자일 경우) | |
| 3906 | ##여기에서 소수점 위를 기입하냐 소수점 아래를 기입하냐 소수점 아래라면 소수점 아래 몇번째 자리를 기입하느냐를 적어야 합니다. | |
| 3907 | {{{#!if s2==false | |
| 3908 | ##정수 자리를 기입하는 경우 | |
| 3909 | {{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true | |
| 3910 | }}}}}}{{{#!if s2==true | |
| 3911 | ##소수점 아래 자리를 기입하는 경우 | |
| 3912 | {{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true | |
| 3913 | }}}{{{#!if k+=1 | |
| 3914 | ##다음 소수점 자리 찾기 | |
| 3915 | }}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false) | |
| 3916 | ##앞에서 숫자를 발견한 다음 소수점을 발견할 경우 (소수점 발견은 최초 1회에 한함) | |
| 3917 | {{{#!if s2=true, s3=true, k=1+0 | |
| 3918 | ##switch2 : 켜기 | |
| 3919 | }}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false) | |
| 3920 | ##숫자가 더 이상 나오지 않고 소수점을 발견하지 못했을 경우, 소수점을 발견한 상황인데 숫자가 나오지 않을 경우 (소수점이 다시 나오는 경우가 자동적으로 포함) | |
| 3921 | {{{#!if j+=1, s1=false, s2=false, s3=true | |
| 3922 | ##소수점 아래 기입하는 스위치도 off, 다음 index(j) 매김. | |
| 3923 | }}}{{{#!if s3==true | |
| 3924 | ##여기까지 과정을 거쳤다면 스위치 off. | |
| 3925 | {{{#!if s3=false | |
| 3926 | }}}}}} | |
| 3927 | }}}{{{#!if i+=1 | |
| 3928 | }}} | |
| 3929 | ## | |
| 3930 | {{{#!if false | |
| 3931 | ##이 if문은 실행되지 않는 단락. 주석만 제거하고 복사 붙여넣기. | |
| 3932 | {{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57) | |
| 3933 | }}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false) | |
| 3934 | {{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true | |
| 3935 | }}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false) | |
| 3936 | {{{#!if s2==false | |
| 3937 | {{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true | |
| 3938 | }}}}}}{{{#!if s2==true | |
| 3939 | {{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true | |
| 3940 | }}}{{{#!if k+=1 | |
| 3941 | }}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false) | |
| 3942 | {{{#!if s2=true, s3=true, k=1+0 | |
| 3943 | }}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46)||(s2==false))||((s2==true)&&!this['d'+i]&&(식=[i]==46)))&&(s3==false) | |
| 3944 | {{{#!if j+=1, s1=false, s2=false, s3=true | |
| 3945 | }}}{{{#!if s3==true | |
| 3946 | {{{#!if s3=false | |
| 3947 | }}}}}} | |
| 3948 | }}}{{{#!if i+=1 | |
| 3949 | }}} | |
| 3950 | #### | |
| 3951 | }}} | |
| 3952 | ## | |
| 3953 | {{{#!if this['v1'] == 1 | |
| 3954 | this['v1'] == 1}}} | |
| 3955 | ## | |
| 3956 | {{{#!if s3=false | |
| 3957 | }}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57) | |
| 3958 | }}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false) | |
| 3959 | {{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true | |
| 3960 | }}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false) | |
| 3961 | {{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true | |
| 3962 | }}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false) | |
| 3963 | {{{#!if s2=true, s3=true | |
| 3964 | }}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false) | |
| 3965 | {{{#!if j+=1, s1=false, s2=false, s3=true | |
| 3966 | }}}}}}{{{#!if i+=1 | |
| 3967 | }}} | |
| 3968 | ## | |
| 3969 | {{{#!if this['v1'] == 11 | |
| 3970 | this['v1'] == 11}}} | |
| 3971 | ## | |
| 3972 | {{{#!if s3=false | |
| 3973 | }}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57) | |
| 3974 | }}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false) | |
| 3975 | {{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true | |
| 3976 | }}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false) | |
| 3977 | {{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true | |
| 3978 | }}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false) | |
| 3979 | {{{#!if s2=true, s3=true | |
| 3980 | }}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false) | |
| 3981 | {{{#!if j+=1, s1=false, s2=false, s3=true | |
| 3982 | }}}}}}{{{#!if i+=1 | |
| 3983 | }}}{{{#!if s3=false | |
| 3984 | }}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57) | |
| 3985 | }}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false) | |
| 3986 | {{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true | |
| 3987 | }}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false) | |
| 3988 | {{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true | |
| 3989 | }}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false) | |
| 3990 | {{{#!if s2=true, s3=true | |
| 3991 | }}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false) | |
| 3992 | {{{#!if j+=1, s1=false, s2=false, s3=true | |
| 3993 | }}}}}}{{{#!if i+=1 | |
| 3994 | }}} | |
| 3995 | ## | |
| 3996 | {{{#!if this['v2'] == 2 | |
| 3997 | this['v2'] == 2}}} | |
| 3998 | ## | |
| 3999 | ## | |
| 4000 | ## | |
| 4001 | ## | |
| 4002 | {{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57), i+=1 | |
| 4003 | }}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57), i+=1 | |
| 4004 | }}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57), i+=1 | |
| 4005 | }}} | |
| 4006 | ## 식 검증이 됐다 치면 | |
| 4007 | ## dn : true - 수 / false - 연산자 | |
| 4008 | {{{#!if this['d0'] | |
| 4009 | 1}}}{{{#!if this['d1'] | |
| 4010 | 1}}}{{{#!if !this['d2'] | |
| 4011 | +}}}{{{#!if this['d3'] | |
| 4012 | 2}}} | |
| 4013 | ## in : 11+2 에서 '11'은 0번째 위치, '+'는 2번째 위치.. > 0, 2, 3 > 위치 기억 / 뺄셈으로 자릿수 계산 | |
| 4014 | ## 보다 좋은 방법이 있ㅅ을 것 같은데음ㅁ.. | |
| 4015 | {{{#!if i = 1, j = 1, i0 = 0 | |
| 4016 | }}} | |
| 4017 | {{{#!if t = this['d0'] != this['d1'], t | |
| 4018 | {{{#!if this['i'+i] = j, j+=1, i+=1 | |
| 4019 | }}}}}}{{{#!if !t | |
| 4020 | {{{#!if j+=1 | |
| 4021 | }}}}}}{{{#!if t = this['d1'] != this['d2'], t | |
| 4022 | {{{#!if this['i'+i] = j, j+=1, i+=1 | |
| 4023 | }}}}}}{{{#!if !t | |
| 4024 | {{{#!if j+=1 | |
| 4025 | }}}}}}{{{#!if t = this['d1'] != this['d2'], t | |
| 4026 | {{{#!if this['i'+i] = j, j+=1, i+=1 | |
| 4027 | }}}}}}{{{#!if !t | |
| 4028 | {{{#!if j+=1 | |
| 4029 | }}}}}} | |
| 4030 | ## {{{#!if i0 == 0 | |
| 4031 | ## i0 == 0 }}}{{{#!if i1 == 2 | |
| 4032 | ## i1 == 2 }}}{{{#!if i2 == 3 | |
| 4033 | ## i2 == 3 }}} | |
| 4034 | ## {{{#!if list = [d0, d1, d2, d3] | |
| 4035 | ## }}} | |
| 4036 | }}} |