r20
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
r8
73}}}}}}
74}}}{{{#!if i+=1
75}}}
76
r9
77검사
r8
78{{{#!if v1==3
79v1==3}}}
r17
80{{{#!if s2==true
81s2==true}}}{{{#!if s2==false
82s2==false}}}
r19
83{{{#!if s3==false
84s3==false}}}
85{{{#!if s3==true
86s3==true}}}
r8
87----
88{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
89}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
90{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
91}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
92{{{#!if s2==false
93{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
94}}}}}}{{{#!if s2==true
95{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
96}}}{{{#!if k+=1
r18
97}}}}}}}}}
98{{{#!if s1==true
99s1==true}}}
100{{{#!if s2==false
101s2==false}}}
102{{{#!if 식[i]==46
103식[i]==46}}}
104{{{#!if i==1
105i==1}}}
106{{{#!if s3==false
107s3==false}}}
108{{{#!if (s1==true)&&(s2==false)&(식[i]==46)&&(s3==false)
109Test
110{{{#!if s2=true, s3=true, k=1+0
r17
111}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
112{{{#!if j+=1, s1=false, s2=false, s3=true
113}}}{{{#!if s3==true
114{{{#!if s3=false
115}}}}}}
116}}}
r11
117검사1
r18
118
r14
119{{{#!if s1==true
120s1==true}}}
r12
121{{{#!if s2==true
122s2==true}}}
r16
123{{{#!if s2==false
r15
124s2==false}}}
r11
125{{{#!if i+=1
126}}}
r9
127
r11
128검사2
r8
129{{{#!if v1==3
130v1==3}}}
r9
131{{{#!if j==1
132j==1}}}
r11
133
r8
134----
135{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
136}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
137{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
138}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
139{{{#!if s2==false
140{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
141}}}}}}{{{#!if s2==true
142{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
143}}}{{{#!if k+=1
r9
144}}}}}}}}}{{{#!if (s1==true)&&(s2==false)&&(식[i]==46)&&(s3==false)
r8
145{{{#!if s2=true, s3=true, k=1+0
r17
146}}}}}}{{{#!if (s1==true)&&(((s2==false)&&!this['d'+i]&&(식[i]!=46))||((s2==true)&&!this['d'+i]))&&(s3==false)
r8
147{{{#!if j+=1, s1=false, s2=false, s3=true
148}}}{{{#!if s3==true
149{{{#!if s3=false
150}}}}}}
151}}}
r9
152검사 (i=+1을 뒤로 넘김)
r8
153{{{#!if v1==3
154v1==3}}}
r10
155{{{#!if s2==true
156s2==true}}}
r8
157{{{#!if k==1
158k==1}}}
159{{{#!if 10.0**(-k)==0.1
16010**(-k)==10**(-1)==0.1}}}
161{{{#!if i==2
162i==2}}}
163{{{#!if +(식.substr(i,1))==1
164+(식.substr(i,1))==1}}}
r9
165{{{#!if +(10.0**(-k))*(+(식.substr(i,1)))==0.1
166+(10.0**(-k))*(+(식.substr(i,1)))==0.1}}}
r8
167
r10
168{{{#!if this['v'+j]==3
169this['v'+j]==3}}}
170
r9
171{{{#!if this['v'+j]+(10.0**(-k))*(+(식.substr(i,1)))==3.1
1723.1}}}
173
r10
174{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1)))
175}}}
r13
176강제로 집어넣으면 입력은 된다.
r9
177{{{#!if v1==3.1
178v1==3.1}}}
179
r8
180{{{#!if i+=1
181}}}
182----
183{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
184}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
185{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
186}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
187{{{#!if s2==false
188{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
189}}}}}}{{{#!if s2==true
190{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
191}}}{{{#!if k+=1
192}}}}}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false)
193{{{#!if s2=true, s3=true, k=1+0
194}}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false)
195{{{#!if j+=1, s1=false, s2=false, s3=true
196}}}{{{#!if s3==true
197{{{#!if s3=false
198}}}}}}
199}}}{{{#!if i+=1
200}}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
201}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
202{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
203}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
204{{{#!if s2==false
205{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
206}}}}}}{{{#!if s2==true
207{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
208}}}{{{#!if k+=1
209}}}}}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false)
210{{{#!if s2=true, s3=true, k=1+0
211}}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false)
212{{{#!if j+=1, s1=false, s2=false, s3=true
213}}}{{{#!if s3==true
214{{{#!if s3=false
215}}}}}}
216}}}{{{#!if i+=1
217}}}{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
218}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
219{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
220}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
221{{{#!if s2==false
222{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
223}}}}}}{{{#!if s2==true
224{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
225}}}{{{#!if k+=1
226}}}}}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false)
227{{{#!if s2=true, s3=true, k=1+0
228}}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false)
229{{{#!if j+=1, s1=false, s2=false, s3=true
230}}}{{{#!if s3==true
231{{{#!if s3=false
232}}}}}}
233}}}{{{#!if i+=1
234}}}
235
236
237{{{#!if v1=="3.1415"
238v1=="3.1415"}}}
239{{{#!if v1=="3.14159"
240v1=="3.14159"}}}
241
242{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
243}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
244{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
245}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
246{{{#!if s2==false
247{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
248}}}}}}{{{#!if s2==true
249{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
250}}}{{{#!if k+=1
251}}}}}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false)
252{{{#!if s2=true, s3=true, k=1+0
253}}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false)
254{{{#!if j+=1, s1=false, s2=false, s3=true
255}}}{{{#!if s3==true
256{{{#!if s3=false
257}}}}}}
258}}}{{{#!if i+=1
259}}}
260
261{{{#!if v1=="3.14159"
262v1=="3.14159"}}}
263
264{{{#!if this['d'+i] = (식[i]>=48&&식[i]<=57)
265}}}{{{#!if (s1==false)&&this['d'+i]&&(s3==false)
266{{{#!if this['v'+j] = +(식.substr(i,1)), s1=true, s3=true
267}}}}}}{{{#!if (s1==true)&&this['d'+i]&&(s3==false)
268{{{#!if s2==false
269{{{#!if this['v'+j] = 10*this['v'+j]+(+(식.substr(i,1))), s3=true
270}}}}}}{{{#!if s2==true
271{{{#!if this['v'+j] = this['v'+j]+(10.0**(-k))*(+(식.substr(i,1))), s3=true
272}}}{{{#!if k+=1
273}}}}}}}}}{{{#!if (s1==true)&&(식[i]==46)&&(s3==false)
274{{{#!if s2=true, s3=true, k=1+0
275}}}}}}{{{#!if (s1==true)&&!this['d'+i]&&(s3==false)
276{{{#!if j+=1, s1=false, s2=false, s3=true
277}}}{{{#!if s3==true
278{{{#!if s3=false
279}}}}}}
280}}}{{{#!if i+=1
281}}}
282{{{#!if v1=="3.141592"
283v1=="3.141592"}}}