r24
r6
1##@미완성. 아마 작성된다면 수만 자는 나올 지도. 본 문서는 {{{틀}}} 네임스페이스의 편집 ACL에 맞게, 인증된 사용자이면 편집할 수 있습니다.
r1
2##@[include(틀:문서 가져옴/the seed, 위키=t, 문서명=틀:계산기, 버전=28, uuid=6259b383-901a-449b-b75c-5106a5c865ac)]
r4
3##테스트용 if문. 식="텍스트" 형식으로 입력하고 미리보기 가능.
r5
4{{{#!if
r3
5}}}{{{#!if b=(식==null)||(식==""), b
r1
6##b : blank
r2
7식을 입력하세요... (숫자와 {{{+}}}, {{{-}}}, {{{*}}}, {{{/}}}만 입력 가능합니다.)}}}{{{#!wiki style="display: none;"
r4
8##d : 자릿수, r : read
9{{{#!if l=식.length, d=0, r=1
r2
10}}}}}}{{{#!if !b
r3
11##print와 for문이 없으면 이렇게 환장할 수 있는 길이가 나옵니다.
12{{{#!wiki style="display: inline-flex;"
13{{{#!wiki style="display: inline-block; width: .8em; height: 1.5em; padding: 0 0.1em; margin: 0 0.05em; background: #abcdef; text-align: center;"
14{{{#!if d<l
15{{{#!if 식[d]==48
r4
16{{{#!if this['r'+d]=1
17}}}0}}}{{{#!if 식[d]==49
18{{{#!if this['r'+d]=1
19}}}1}}}{{{#!if 식[d]==50
20{{{#!if this['r'+d]=1
21}}}2}}}{{{#!if 식[d]==51
22{{{#!if this['r'+d]=1
23}}}3}}}{{{#!if 식[d]==52
24{{{#!if this['r'+d]=1
25}}}4}}}{{{#!if 식[d]==53
26{{{#!if this['r'+d]=1
27}}}5}}}{{{#!if 식[d]==54
28{{{#!if this['r'+d]=1
29}}}6}}}{{{#!if 식[d]==55
30{{{#!if this['r'+d]=1
31}}}7}}}{{{#!if 식[d]==56
32{{{#!if this['r'+d]=1
33}}}8}}}{{{#!if 식[d]==57
34{{{#!if this['r'+d]=1
35}}}9}}}{{{#!if d=d+1
r7
36}}}}}}}}}{{{#!wiki style="display: inline-block; width: .8em; height: 1.5em; padding: 0 0.1em; margin: 0 0.05em; background: #abcdef; text-align: center"
r3
37{{{#!if d<l
38{{{#!if 식[d]==48
390}}}{{{#!if 식[d]==49
401}}}{{{#!if 식[d]==50
412}}}{{{#!if 식[d]==51
423}}}{{{#!if 식[d]==52
434}}}{{{#!if 식[d]==53
445}}}{{{#!if 식[d]==54
456}}}{{{#!if 식[d]==55
467}}}{{{#!if 식[d]==56
478}}}{{{#!if 식[d]==57
489}}}{{{#!if d=d+1
r8
49}}}}}}}}}}}}}}}
50
51
52== 테스트 ==
53{{{#!if 식="3.141592"
54식="3.141592"}}}{{{#!if s1=false, s2=false, s3=false, j=1+0, i=0+0, k=1+0
r9
55}}}
56초기화 불러오기.
57
58{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
r8
59}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
60{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
61}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
62{{{#!if s2==false
63{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
64}}}}}}{{{#!if s2==true
65{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
66}}}{{{#!if k+=1
r9
67}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
68{{{#!if s2=true, s3=true, k=1+0
r17
69}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
70{{{#!if j+=1, s1=false, s2=false, s3=true
r20
71}}}}}}{{{#!if s3==true
r19
72{{{#!if this.s3=false
r21
73}}}}}}{{{#!if i+=1
r8
74}}}
75
r9
76검사
r8
77{{{#!if v1==3
78v1==3}}}
r17
79{{{#!if s2==true
80s2==true}}}{{{#!if s2==false
81s2==false}}}
r19
82{{{#!if s3==false
83s3==false}}}
84{{{#!if s3==true
85s3==true}}}
r8
86----
87{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
88}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
89{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
90}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
91{{{#!if s2==false
92{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
93}}}}}}{{{#!if s2==true
94{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
95}}}{{{#!if k+=1
r21
96}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r18
97{{{#!if s2=true, s3=true, k=1+0
r17
98}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
99{{{#!if j+=1, s1=false, s2=false, s3=true
r21
100}}}}}}{{{#!if s3==true
101{{{#!if this.s3=false
102}}}}}}{{{#!if i+=1
r8
103}}}
r11
104검사1
r18
105
r14
106{{{#!if s1==true
107s1==true}}}
r12
108{{{#!if s2==true
109s2==true}}}
r16
110{{{#!if s2==false
r15
111s2==false}}}
r9
112
r11
113검사2
r8
114{{{#!if v1==3
115v1==3}}}
r9
116{{{#!if j==1
117j==1}}}
r11
118
r8
119----
120{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
121}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
122{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
123}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
124{{{#!if s2==false
125{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
126}}}}}}{{{#!if s2==true
127{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
128}}}{{{#!if k+=1
r9
129}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
130{{{#!if s2=true, s3=true, k=1+0
r17
131}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
132{{{#!if j+=1, s1=false, s2=false, s3=true
r21
133}}}}}}{{{#!if s3==true
134{{{#!if this.s3=false
r22
135}}}}}}{{{#!if i+=1
136}}}
137
r8
138{{{#!if v1==3
139v1==3}}}
r10
140{{{#!if s2==true
141s2==true}}}
r8
142+(식.substr(i,1))==1}}}
r21
143{{{#!if this['v'+j]==3.1
144this['v'+j]==3.1}}}
r8
145----
146{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
147}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
148{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
149}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
150{{{#!if s2==false
151{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
152}}}}}}{{{#!if s2==true
153{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
154}}}{{{#!if k+=1
r21
155}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
156{{{#!if s2=true, s3=true, k=1+0
r21
157}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
158{{{#!if j+=1, s1=false, s2=false, s3=true
r21
159}}}}}}{{{#!if s3==true
160{{{#!if this.s3=false
161}}}}}}{{{#!if i+=1
162}}}
163{{{#!if this['v'+j]==3.14
164this['v'+j]==3.14}}}
165----
166{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
r8
167}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
168{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
169}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
170{{{#!if s2==false
171{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
172}}}}}}{{{#!if s2==true
173{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
174}}}{{{#!if k+=1
r22
175}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
176{{{#!if s2=true, s3=true, k=1+0
r22
177}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
178{{{#!if j+=1, s1=false, s2=false, s3=true
r22
179}}}}}}{{{#!if s3==true
180{{{#!if this.s3=false
181}}}}}}{{{#!if i+=1
182}}}
183{{{#!if this['v'+j]==3.141
184this['v'+j]==3.141}}}
185----
186{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
r8
187}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
188{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
189}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
190{{{#!if s2==false
191{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
192}}}}}}{{{#!if s2==true
193{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
194}}}{{{#!if k+=1
r22
195}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
196{{{#!if s2=true, s3=true, k=1+0
r22
197}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
198{{{#!if j+=1, s1=false, s2=false, s3=true
r22
199}}}}}}{{{#!if s3==true
200{{{#!if this.s3=false
201}}}}}}{{{#!if i+=1
r8
202}}}
r23
203{{{#!if j==1
204j==1}}}
205{{{#!if this.v1==3.1415
206this.v1==3.1415}}}
r22
207----
r8
208{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
209}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
210{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
211}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
212{{{#!if s2==false
213{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
214}}}}}}{{{#!if s2==true
215{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
r24
216}}}
217{{{#!if +(10.0**(-k))*(+(식.substr(i,1)))==0.00009
218+(10.0**(-k))*(+(식.substr(i,1)))==0.00009}}}
219{{{#!if k+=1
r22
220}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
221{{{#!if s2=true, s3=true, k=1+0
r22
222}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
223{{{#!if j+=1, s1=false, s2=false, s3=true
r22
224}}}}}}{{{#!if s3==true
225{{{#!if this.s3=false
226}}}}}}{{{#!if i+=1
r8
227}}}
r23
228{{{#!if j==1
229j==1}}}
r24
230{{{#!if k==4
231k==4}}}
232{{{#!if (s1==true)&&(s2==true)
233s1==true, s2==true}}}
r23
234{{{#!if this.v1==3.14159
235this.v1==3.14159}}}
r22
236----
r8
237{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
238}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
239{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
240}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
241{{{#!if s2==false
242{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
243}}}}}}{{{#!if s2==true
244{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
245}}}{{{#!if k+=1
r22
246}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
247{{{#!if s2=true, s3=true, k=1+0
r22
248}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
249{{{#!if j+=1, s1=false, s2=false, s3=true
r22
250}}}}}}{{{#!if s3==true
251{{{#!if this.s3=false
252}}}}}}{{{#!if i+=1
r8
253}}}
254{{{#!if v1=="3.141592"
255v1=="3.141592"}}}