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,383 @@
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::Boolfuck
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::Boolfuck";
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 (B)</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">Boolfuck</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::Boolfuck
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::Boolfuck</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/boolfuck_interpreter.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>The Boolfuck class represents an interpreter for the Boolfuck 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, input = &#39;&#39;) &#x21d2; Boolfuck </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 Boolfuck 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 Boolfuck 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, input = &#39;&#39;) &#x21d2; <tt><span class='object_link'><a href="" title="Esolang::Interpreters::Boolfuck (class)">Boolfuck</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 Boolfuck 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 Boolfuck code to interpret.</p>
225
+ </div>
226
+
227
+ </li>
228
+
229
+ <li>
230
+
231
+ <span class='name'>input</span>
232
+
233
+
234
+ <span class='type'>(<tt>String</tt>)</span>
235
+
236
+
237
+ <em class="default">(defaults to: <tt>&#39;&#39;</tt>)</em>
238
+
239
+
240
+ &mdash;
241
+ <div class='inline'>
242
+ <p>The input for the Boolfuck program (optional).</p>
243
+ </div>
244
+
245
+ </li>
246
+
247
+ </ul>
248
+
249
+
250
+ </div><table class="source_code">
251
+ <tr>
252
+ <td>
253
+ <pre class="lines">
254
+
255
+
256
+ 13
257
+ 14
258
+ 15
259
+ 16
260
+ 17
261
+ 18</pre>
262
+ </td>
263
+ <td>
264
+ <pre class="code"><span class="info file"># File 'lib/interpreters/boolfuck_interpreter.rb', line 13</span>
265
+
266
+ <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_input'>input</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
267
+ <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'>[^,\.;&lt;&gt;\+\[\]]</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>
268
+ <span class='ivar'>@input</span> <span class='op'>=</span> <span class='id identifier rubyid_chars_to_bits'>chars_to_bits</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
269
+ <span class='ivar'>@output</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
270
+ <span class='ivar'>@tape</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
271
+ <span class='kw'>end</span></pre>
272
+ </td>
273
+ </tr>
274
+ </table>
275
+ </div>
276
+
277
+ </div>
278
+
279
+
280
+ <div id="instance_method_details" class="method_details_list">
281
+ <h2>Instance Method Details</h2>
282
+
283
+
284
+ <div class="method_details first">
285
+ <h3 class="signature first" id="run-instance_method">
286
+
287
+ #<strong>run</strong> &#x21d2; <tt>String</tt>
288
+
289
+
290
+
291
+
292
+
293
+ </h3><div class="docstring">
294
+ <div class="discussion">
295
+
296
+ <p>Executes the interpretation of the Boolfuck code.</p>
297
+
298
+
299
+ </div>
300
+ </div>
301
+ <div class="tags">
302
+
303
+ <p class="tag_title">Returns:</p>
304
+ <ul class="return">
305
+
306
+ <li>
307
+
308
+
309
+ <span class='type'>(<tt>String</tt>)</span>
310
+
311
+
312
+
313
+ &mdash;
314
+ <div class='inline'>
315
+ <p>The result of the Boolfuck interpretation.</p>
316
+ </div>
317
+
318
+ </li>
319
+
320
+ </ul>
321
+
322
+ </div><table class="source_code">
323
+ <tr>
324
+ <td>
325
+ <pre class="lines">
326
+
327
+
328
+ 23
329
+ 24
330
+ 25
331
+ 26
332
+ 27
333
+ 28
334
+ 29
335
+ 30
336
+ 31
337
+ 32
338
+ 33
339
+ 34
340
+ 35
341
+ 36
342
+ 37
343
+ 38
344
+ 39</pre>
345
+ </td>
346
+ <td>
347
+ <pre class="code"><span class="info file"># File 'lib/interpreters/boolfuck_interpreter.rb', line 23</span>
348
+
349
+ <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
350
+ <span class='kw'>while</span> <span class='id identifier rubyid_running?'>running?</span> <span class='kw'>do</span>
351
+ <span class='kw'>case</span> <span class='id identifier rubyid_command'>command</span>
352
+ <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_input_to_tape'>input_to_tape</span>
353
+ <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_tape_to_output_array'>tape_to_output_array</span>
354
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_right'>move_right</span>
355
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_left'>move_left</span>
356
+ <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>
357
+ <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>
358
+ <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>
359
+ <span class='kw'>end</span>
360
+
361
+ <span class='ivar'>@code_pointer</span> <span class='op'>+=</span> <span class='int'>1</span>
362
+ <span class='kw'>end</span>
363
+
364
+ <span class='id identifier rubyid_translate_output_bits_to_chars'>translate_output_bits_to_chars</span>
365
+ <span class='kw'>end</span></pre>
366
+ </td>
367
+ </tr>
368
+ </table>
369
+ </div>
370
+
371
+ </div>
372
+
373
+ </div>
374
+
375
+ <div id="footer">
376
+ Generated on Mon Jan 22 14:49:08 2024 by
377
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
378
+ 0.9.34 (ruby-3.1.2).
379
+ </div>
380
+
381
+ </div>
382
+ </body>
383
+ </html>