esolang 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,419 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Esolang::Interpreters::Paintfuck
8
+
9
+ &mdash; Documentation by YARD 0.9.34
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Esolang::Interpreters::Paintfuck";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (P)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Esolang.html" title="Esolang (module)">Esolang</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Interpreters.html" title="Esolang::Interpreters (module)">Interpreters</a></span></span>
41
+ &raquo;
42
+ <span class="title">Paintfuck</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Esolang::Interpreters::Paintfuck
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="BaseInterpreter.html" title="Esolang::Interpreters::BaseInterpreter (class)">BaseInterpreter</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="BaseInterpreter.html" title="Esolang::Interpreters::BaseInterpreter (class)">BaseInterpreter</a></span></li>
78
+
79
+ <li class="next">Esolang::Interpreters::Paintfuck</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/interpreters/paintfuck_interpreter.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>The Paintfuck class represents an interpreter for the Paintfuck esoteric programming language.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <h2>
124
+ Instance Method Summary
125
+ <small><a href="#" class="summary_toggle">collapse</a></small>
126
+ </h2>
127
+
128
+ <ul class="summary">
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(code, iterations, width, height) &#x21d2; Paintfuck </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+ <span class="note title constructor">constructor</span>
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+ <span class="summary_desc"><div class='inline'>
150
+ <p>Initializes a new instance of the Paintfuck interpreter.</p>
151
+ </div></span>
152
+
153
+ </li>
154
+
155
+
156
+ <li class="public ">
157
+ <span class="summary_signature">
158
+
159
+ <a href="#run-instance_method" title="#run (instance method)">#<strong>run</strong> &#x21d2; String </a>
160
+
161
+
162
+
163
+ </span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'>
174
+ <p>Executes the interpretation of the Paintfuck code.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ </ul>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <div id="constructor_details" class="method_details_list">
190
+ <h2>Constructor Details</h2>
191
+
192
+ <div class="method_details first">
193
+ <h3 class="signature first" id="initialize-instance_method">
194
+
195
+ #<strong>initialize</strong>(code, iterations, width, height) &#x21d2; <tt><span class='object_link'><a href="" title="Esolang::Interpreters::Paintfuck (class)">Paintfuck</a></span></tt>
196
+
197
+
198
+
199
+
200
+
201
+ </h3><div class="docstring">
202
+ <div class="discussion">
203
+
204
+ <p>Initializes a new instance of the Paintfuck interpreter.</p>
205
+
206
+
207
+ </div>
208
+ </div>
209
+ <div class="tags">
210
+ <p class="tag_title">Parameters:</p>
211
+ <ul class="param">
212
+
213
+ <li>
214
+
215
+ <span class='name'>code</span>
216
+
217
+
218
+ <span class='type'>(<tt>String</tt>)</span>
219
+
220
+
221
+
222
+ &mdash;
223
+ <div class='inline'>
224
+ <p>The Paintfuck code to interpret.</p>
225
+ </div>
226
+
227
+ </li>
228
+
229
+ <li>
230
+
231
+ <span class='name'>iterations</span>
232
+
233
+
234
+ <span class='type'>(<tt>Integer</tt>)</span>
235
+
236
+
237
+
238
+ &mdash;
239
+ <div class='inline'>
240
+ <p>The number of iterations for the Paintfuck program.</p>
241
+ </div>
242
+
243
+ </li>
244
+
245
+ <li>
246
+
247
+ <span class='name'>width</span>
248
+
249
+
250
+ <span class='type'>(<tt>Integer</tt>)</span>
251
+
252
+
253
+
254
+ &mdash;
255
+ <div class='inline'>
256
+ <p>The width of the Paintfuck canvas.</p>
257
+ </div>
258
+
259
+ </li>
260
+
261
+ <li>
262
+
263
+ <span class='name'>height</span>
264
+
265
+
266
+ <span class='type'>(<tt>Integer</tt>)</span>
267
+
268
+
269
+
270
+ &mdash;
271
+ <div class='inline'>
272
+ <p>The height of the Paintfuck canvas.</p>
273
+ </div>
274
+
275
+ </li>
276
+
277
+ </ul>
278
+
279
+
280
+ </div><table class="source_code">
281
+ <tr>
282
+ <td>
283
+ <pre class="lines">
284
+
285
+
286
+ 15
287
+ 16
288
+ 17
289
+ 18
290
+ 19
291
+ 20
292
+ 21
293
+ 22</pre>
294
+ </td>
295
+ <td>
296
+ <pre class="code"><span class="info file"># File 'lib/interpreters/paintfuck_interpreter.rb', line 15</span>
297
+
298
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_iterations'>iterations</span><span class='comma'>,</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span><span class='rparen'>)</span>
299
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[^nesw\*\[\]]</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
300
+ <span class='ivar'>@iterations</span> <span class='op'>=</span> <span class='id identifier rubyid_iterations'>iterations</span>
301
+ <span class='ivar'>@width</span> <span class='op'>=</span> <span class='id identifier rubyid_width'>width</span>
302
+ <span class='ivar'>@height</span> <span class='op'>=</span> <span class='id identifier rubyid_height'>height</span>
303
+ <span class='ivar'>@data_grid</span> <span class='op'>=</span> <span class='id identifier rubyid_generate_zero_grid'>generate_zero_grid</span>
304
+ <span class='ivar'>@grid_pointer</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span>
305
+ <span class='kw'>end</span></pre>
306
+ </td>
307
+ </tr>
308
+ </table>
309
+ </div>
310
+
311
+ </div>
312
+
313
+
314
+ <div id="instance_method_details" class="method_details_list">
315
+ <h2>Instance Method Details</h2>
316
+
317
+
318
+ <div class="method_details first">
319
+ <h3 class="signature first" id="run-instance_method">
320
+
321
+ #<strong>run</strong> &#x21d2; <tt>String</tt>
322
+
323
+
324
+
325
+
326
+
327
+ </h3><div class="docstring">
328
+ <div class="discussion">
329
+
330
+ <p>Executes the interpretation of the Paintfuck code.</p>
331
+
332
+
333
+ </div>
334
+ </div>
335
+ <div class="tags">
336
+
337
+ <p class="tag_title">Returns:</p>
338
+ <ul class="return">
339
+
340
+ <li>
341
+
342
+
343
+ <span class='type'>(<tt>String</tt>)</span>
344
+
345
+
346
+
347
+ &mdash;
348
+ <div class='inline'>
349
+ <p>The result of the Paintfuck interpretation.</p>
350
+ </div>
351
+
352
+ </li>
353
+
354
+ </ul>
355
+
356
+ </div><table class="source_code">
357
+ <tr>
358
+ <td>
359
+ <pre class="lines">
360
+
361
+
362
+ 27
363
+ 28
364
+ 29
365
+ 30
366
+ 31
367
+ 32
368
+ 33
369
+ 34
370
+ 35
371
+ 36
372
+ 37
373
+ 38
374
+ 39
375
+ 40
376
+ 41
377
+ 42
378
+ 43
379
+ 44</pre>
380
+ </td>
381
+ <td>
382
+ <pre class="code"><span class="info file"># File 'lib/interpreters/paintfuck_interpreter.rb', line 27</span>
383
+
384
+ <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
385
+ <span class='kw'>while</span> <span class='id identifier rubyid_running?'>running?</span> <span class='kw'>do</span>
386
+ <span class='kw'>case</span> <span class='id identifier rubyid_command'>command</span>
387
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>n</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_up'>move_up</span>
388
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>e</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_right'>move_right</span>
389
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>s</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_down'>move_down</span>
390
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>w</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_left'>move_left</span>
391
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_flip'>flip</span>
392
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_loop_begin'>loop_begin</span>
393
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>]</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_loop_end'>loop_end</span>
394
+ <span class='kw'>end</span>
395
+
396
+ <span class='ivar'>@code_pointer</span> <span class='op'>+=</span> <span class='int'>1</span>
397
+ <span class='ivar'>@iterations</span> <span class='op'>-=</span> <span class='int'>1</span>
398
+ <span class='kw'>end</span>
399
+
400
+ <span class='id identifier rubyid_output'>output</span>
401
+ <span class='kw'>end</span></pre>
402
+ </td>
403
+ </tr>
404
+ </table>
405
+ </div>
406
+
407
+ </div>
408
+
409
+ </div>
410
+
411
+ <div id="footer">
412
+ Generated on Mon Jan 22 14:49:08 2024 by
413
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
414
+ 0.9.34 (ruby-3.1.2).
415
+ </div>
416
+
417
+ </div>
418
+ </body>
419
+ </html>