improved indentation and whitespace for markdown code blocks
All code blocks in markdown have been intended by at least 4 spaces. We add `--tab-stop=8` to all `pandoc(1)` executions in order to set a better tab stop indentation, especially for tab intended code blocks. Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26" to "1.6 2024-03-31". Fixed `1991/brnstnd/sorta.README.md` so that the sorta code is code blocks. Removed unneeded paragraph group in copyright in `inc/footer.default.html`. Fixed excess whitespace after list Author on entry `index.html` page. Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26" to "1.6 2024-03-31". Performed `make www` to perform the above and test under macOS. TODO: Fix the problem of the initial line of code being extra intended. TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
+35
-35
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ make
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2013 endoh3 bugs](../../bugs.html#2013_endoh3).
|
||||
@@ -19,7 +19,7 @@ For more detailed information see [2013 endoh3 bugs](../../bugs.html#2013_endoh3
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./endoh3
|
||||
./endoh3
|
||||
```
|
||||
|
||||
This program plays sound. See [FAQ 3.10 - How do I compile and use an IOCCC
|
||||
@@ -30,13 +30,13 @@ system up for this or if you want to verify that everything is oky.
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
|
||||
./try.sh ABC
|
||||
./try.sh ABC
|
||||
|
||||
./try.sh test.abc yankee.abc
|
||||
./try.sh test.abc yankee.abc
|
||||
|
||||
./try.sh *.abc
|
||||
./try.sh *.abc
|
||||
```
|
||||
|
||||
The script will check for SoX first and next `padsp` from `PulseAudio` and
|
||||
@@ -76,28 +76,28 @@ notation](http://en.wikipedia.org/wiki/ABC_notation).
|
||||
Try:
|
||||
|
||||
```sh
|
||||
cc -o endoh3 endoh3.c
|
||||
echo "CDEFGABc" | ./endoh3 > /dev/dsp
|
||||
cc -o endoh3 endoh3.c
|
||||
echo "CDEFGABc" | ./endoh3 > /dev/dsp
|
||||
```
|
||||
|
||||
If `/dev/dsp` is not available on your system, use an OSS sound wrapper such
|
||||
as `padsp` or `aoss`:
|
||||
|
||||
```sh
|
||||
echo "CDEFGABc" | ./endoh3 | padsp tee /dev/dsp > /dev/null
|
||||
echo "CDEFGABc" | ./endoh3 | padsp tee /dev/dsp > /dev/null
|
||||
```
|
||||
|
||||
If you are using Mac OS X, try [sox](http://sox.sourceforge.net/) like so:
|
||||
|
||||
```sh
|
||||
echo "CDEFGABc" | ./endoh3 | sox -q -traw -r8000 -b8 -e unsigned-integer - -tcoreaudio
|
||||
echo "CDEFGABc" | ./endoh3 | sox -q -traw -r8000 -b8 -e unsigned-integer - -tcoreaudio
|
||||
```
|
||||
|
||||
If that does not work, use the attached script to convert the output into a wave
|
||||
file format:
|
||||
|
||||
```sh
|
||||
echo "CDEFGABc" | ./endoh3 | ruby wavify.rb > cde.wav
|
||||
echo "CDEFGABc" | ./endoh3 | ruby wavify.rb > cde.wav
|
||||
```
|
||||
|
||||
and play `cde.wav`.
|
||||
@@ -108,8 +108,8 @@ do so like:
|
||||
|
||||
|
||||
```sh
|
||||
cat twinkle.abc | ./endoh3 > /dev/dsp
|
||||
cat menuet.abc | ./endoh3 > /dev/dsp
|
||||
cat twinkle.abc | ./endoh3 > /dev/dsp
|
||||
cat menuet.abc | ./endoh3 > /dev/dsp
|
||||
```
|
||||
|
||||
but you should be able to modify it a way to meet your system requirements as
|
||||
@@ -186,37 +186,37 @@ You know, it is ["the famous song"](http://en.wikipedia.org/wiki/4%E2%80%B233%E2
|
||||
Here is a magical expression which I found by brute-force:
|
||||
|
||||
```c
|
||||
(c % 32 + 5) * 9 / 5 % 13 + n / 32 * 12 - 22
|
||||
(c % 32 + 5) * 9 / 5 % 13 + n / 32 * 12 - 22
|
||||
```
|
||||
|
||||
Interestingly, it converts an ASCII number of ABC notes
|
||||
to the corresponding tone number.
|
||||
|
||||
```
|
||||
'C' (ASCII 67) => 3
|
||||
'D' (ASCII 68) => 5
|
||||
'E' (ASCII 69) => 7
|
||||
'F' (ASCII 70) => 9
|
||||
'G' (ASCII 71) => 10
|
||||
'A' (ASCII 65) => 12
|
||||
'B' (ASCII 66) => 14
|
||||
'c' (ASCII 99) => 15
|
||||
'd' (ASCII 100) => 17
|
||||
'e' (ASCII 101) => 19
|
||||
'f' (ASCII 102) => 20
|
||||
'g' (ASCII 103) => 22
|
||||
'a' (ASCII 97) => 24
|
||||
'b' (ASCII 98) => 26
|
||||
'C' (ASCII 67) => 3
|
||||
'D' (ASCII 68) => 5
|
||||
'E' (ASCII 69) => 7
|
||||
'F' (ASCII 70) => 9
|
||||
'G' (ASCII 71) => 10
|
||||
'A' (ASCII 65) => 12
|
||||
'B' (ASCII 66) => 14
|
||||
'c' (ASCII 99) => 15
|
||||
'd' (ASCII 100) => 17
|
||||
'e' (ASCII 101) => 19
|
||||
'f' (ASCII 102) => 20
|
||||
'g' (ASCII 103) => 22
|
||||
'a' (ASCII 97) => 24
|
||||
'b' (ASCII 98) => 26
|
||||
```
|
||||
|
||||
By the way, you can write a half-tone by the following characters.
|
||||
|
||||
```
|
||||
'K' => 4 (= C#)
|
||||
'L' => 6 (= D#)
|
||||
'U' => 8 (= F#)
|
||||
'V' => 11 (= G#)
|
||||
'P' => 13 (= A#)
|
||||
'K' => 4 (= C#)
|
||||
'L' => 6 (= D#)
|
||||
'U' => 8 (= F#)
|
||||
'V' => 11 (= G#)
|
||||
'P' => 13 (= A#)
|
||||
```
|
||||
|
||||
Note that the tone numbers simply enumerate the semi-tone steps. So we can
|
||||
@@ -229,7 +229,7 @@ frequency by multiplying the value by `n` times.
|
||||
Finally, the following code generates a saw wave:
|
||||
|
||||
```c
|
||||
for(c = 0; c < len; c++) putchar(a = n * D);
|
||||
for(c = 0; c < len; c++) putchar(a = n * D);
|
||||
```
|
||||
|
||||
where `D` is a frequency and `a` is a variable whose type is `char`. By
|
||||
|
||||
+36
-37
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Yusuke_Endoh">Yusuke Endoh</a><br>
|
||||
Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em>
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,24 +141,24 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em>
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2013_endoh3">2013 endoh3 bugs</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./endoh3</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./endoh3</span></span></code></pre></div>
|
||||
<p>This program plays sound. See <a href="../../faq.html#sox">FAQ 3.10 - How do I compile and use an IOCCC
|
||||
entry that requires sound?</a> if you do not know how to set your
|
||||
system up for this or if you want to verify that everything is oky.</p>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span> ABC</span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span> ABC</span>
|
||||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span> test.abc yankee.abc</span>
|
||||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span> test.abc yankee.abc</span>
|
||||
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span> <span class="pp">*</span>.abc</span></code></pre></div>
|
||||
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span> <span class="pp">*</span>.abc</span></code></pre></div>
|
||||
<p>The script will check for SoX first and next <code>padsp</code> from <code>PulseAudio</code> and
|
||||
finally if neither are found if you have <code>ruby(1)</code> installed it’ll use the
|
||||
included ruby script to convert it to a WAV file for you to play.</p>
|
||||
@@ -181,21 +180,21 @@ will remain the same for historical purposes.</p>
|
||||
<p>This is a sound synthesizer for a subset of <a href="http://en.wikipedia.org/wiki/ABC_notation">ABC music
|
||||
notation</a>.</p>
|
||||
<p>Try:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-o</span> endoh3 endoh3.c</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="op">></span> /dev/dsp</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> <span class="at">-o</span> endoh3 endoh3.c</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="op">></span> /dev/dsp</span></code></pre></div>
|
||||
<p>If <code>/dev/dsp</code> is not available on your system, use an OSS sound wrapper such
|
||||
as <code>padsp</code> or <code>aoss</code>:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="kw">|</span> <span class="ex">padsp</span> tee /dev/dsp <span class="op">></span> /dev/null</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="kw">|</span> <span class="ex">padsp</span> tee /dev/dsp <span class="op">></span> /dev/null</span></code></pre></div>
|
||||
<p>If you are using Mac OS X, try <a href="http://sox.sourceforge.net/">sox</a> like so:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="kw">|</span> <span class="fu">sox</span> <span class="at">-q</span> <span class="at">-traw</span> <span class="at">-r8000</span> <span class="at">-b8</span> <span class="at">-e</span> unsigned-integer <span class="at">-</span> <span class="at">-tcoreaudio</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="kw">|</span> <span class="fu">sox</span> <span class="at">-q</span> <span class="at">-traw</span> <span class="at">-r8000</span> <span class="at">-b8</span> <span class="at">-e</span> unsigned-integer <span class="at">-</span> <span class="at">-tcoreaudio</span></span></code></pre></div>
|
||||
<p>If that does not work, use the attached script to convert the output into a wave
|
||||
file format:</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="kw">|</span> <span class="ex">ruby</span> wavify.rb <span class="op">></span> cde.wav</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">"CDEFGABc"</span> <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="kw">|</span> <span class="ex">ruby</span> wavify.rb <span class="op">></span> cde.wav</span></code></pre></div>
|
||||
<p>and play <code>cde.wav</code>.</p>
|
||||
<p>You can also enjoy some music scores that I attached. With <code>/dev/dsp</code> you can
|
||||
do so like:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> twinkle.abc <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="op">></span> /dev/dsp</span>
|
||||
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> menuet.abc <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="op">></span> /dev/dsp</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> twinkle.abc <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="op">></span> /dev/dsp</span>
|
||||
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> menuet.abc <span class="kw">|</span> <span class="ex">./endoh3</span> <span class="op">></span> /dev/dsp</span></code></pre></div>
|
||||
<p>but you should be able to modify it a way to meet your system requirements as
|
||||
described above.</p>
|
||||
<h3 id="obfuscation">Obfuscation</h3>
|
||||
@@ -258,29 +257,29 @@ But I do not attach it to protect you from W****r.</p>
|
||||
You know, it is <a href="http://en.wikipedia.org/wiki/4%E2%80%B233%E2%80%B3">“the famous song”</a>.</p>
|
||||
<h3 id="spoiler">Spoiler</h3>
|
||||
<p>Here is a magical expression which I found by brute-force:</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="op">(</span>c <span class="op">%</span> <span class="dv">32</span> <span class="op">+</span> <span class="dv">5</span><span class="op">)</span> <span class="op">*</span> <span class="dv">9</span> <span class="op">/</span> <span class="dv">5</span> <span class="op">%</span> <span class="dv">13</span> <span class="op">+</span> n <span class="op">/</span> <span class="dv">32</span> <span class="op">*</span> <span class="dv">12</span> <span class="op">-</span> <span class="dv">22</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span>c <span class="op">%</span> <span class="dv">32</span> <span class="op">+</span> <span class="dv">5</span><span class="op">)</span> <span class="op">*</span> <span class="dv">9</span> <span class="op">/</span> <span class="dv">5</span> <span class="op">%</span> <span class="dv">13</span> <span class="op">+</span> n <span class="op">/</span> <span class="dv">32</span> <span class="op">*</span> <span class="dv">12</span> <span class="op">-</span> <span class="dv">22</span></span></code></pre></div>
|
||||
<p>Interestingly, it converts an ASCII number of ABC notes
|
||||
to the corresponding tone number.</p>
|
||||
<pre><code>'C' (ASCII 67) => 3
|
||||
'D' (ASCII 68) => 5
|
||||
'E' (ASCII 69) => 7
|
||||
'F' (ASCII 70) => 9
|
||||
'G' (ASCII 71) => 10
|
||||
'A' (ASCII 65) => 12
|
||||
'B' (ASCII 66) => 14
|
||||
'c' (ASCII 99) => 15
|
||||
'd' (ASCII 100) => 17
|
||||
'e' (ASCII 101) => 19
|
||||
'f' (ASCII 102) => 20
|
||||
'g' (ASCII 103) => 22
|
||||
'a' (ASCII 97) => 24
|
||||
'b' (ASCII 98) => 26</code></pre>
|
||||
<pre><code> 'C' (ASCII 67) => 3
|
||||
'D' (ASCII 68) => 5
|
||||
'E' (ASCII 69) => 7
|
||||
'F' (ASCII 70) => 9
|
||||
'G' (ASCII 71) => 10
|
||||
'A' (ASCII 65) => 12
|
||||
'B' (ASCII 66) => 14
|
||||
'c' (ASCII 99) => 15
|
||||
'd' (ASCII 100) => 17
|
||||
'e' (ASCII 101) => 19
|
||||
'f' (ASCII 102) => 20
|
||||
'g' (ASCII 103) => 22
|
||||
'a' (ASCII 97) => 24
|
||||
'b' (ASCII 98) => 26</code></pre>
|
||||
<p>By the way, you can write a half-tone by the following characters.</p>
|
||||
<pre><code>'K' => 4 (= C#)
|
||||
'L' => 6 (= D#)
|
||||
'U' => 8 (= F#)
|
||||
'V' => 11 (= G#)
|
||||
'P' => 13 (= A#)</code></pre>
|
||||
<pre><code> 'K' => 4 (= C#)
|
||||
'L' => 6 (= D#)
|
||||
'U' => 8 (= F#)
|
||||
'V' => 11 (= G#)
|
||||
'P' => 13 (= A#)</code></pre>
|
||||
<p>Note that the tone numbers simply enumerate the semi-tone steps. So we can
|
||||
calculate the frequency easily: <code>pow(2, n / 12.0)</code>. Then, how can we calculate
|
||||
<code>pow</code> without <code>math.h</code>? <code>pow(2, 1.0 / 12.0)</code> is approximated by <code>89/84.</code>. (I
|
||||
@@ -288,7 +287,7 @@ found this approximation by using the <a href="http://en.wikipedia.org/wiki/Ster
|
||||
tree</a>.) We can gain the
|
||||
frequency by multiplying the value by <code>n</code> times.</p>
|
||||
<p>Finally, the following code generates a saw wave:</p>
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span><span class="op">(</span>c <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> c <span class="op"><</span> len<span class="op">;</span> c<span class="op">++)</span> putchar<span class="op">(</span>a <span class="op">=</span> n <span class="op">*</span> D<span class="op">);</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span><span class="op">(</span>c <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> c <span class="op"><</span> len<span class="op">;</span> c<span class="op">++)</span> putchar<span class="op">(</span>a <span class="op">=</span> n <span class="op">*</span> D<span class="op">);</span></span></code></pre></div>
|
||||
<p>where <code>D</code> is a frequency and <code>a</code> is a variable whose type is <code>char</code>. By
|
||||
assigning <code>float</code> to <code>char</code> variable, the implicit type conversion is performed
|
||||
from <code>float</code> to <code>char</code> (modulo 256).</p>
|
||||
|
||||
Reference in new issue
Block a user