Skip to content

Commit

Permalink
Add explain of control syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
KajizukaTaichi committed Jun 23, 2024
1 parent f1b3873 commit 3ba9c9e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
23 changes: 23 additions & 0 deletions docs/commands_reference/control.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,29 @@ <h1 class="menu-title">Documents of Stack Programming Language</h1>
<div id="content" class="content">
<main>
<h1 id="control"><a class="header" href="#control">Control</a></h1>
<p>Any programming language needs control syntax.
In this chapter, Explain control syntax such as <code>if</code>, <code>while</code> etc of Stack.</p>
<h2 id="if"><a class="header" href="#if">If</a></h2>
<p><strong>Example</strong>:<br />
In this code, judgement which even or odd is 5987.</p>
<pre><code>Stack〔 〕 ← (Even print)
Stack〔 (Even print) 〕 ← (Odd print)
Stack〔 (Even print) | (Odd print) 〕 ← 5987
Stack〔 (Even print) | (Odd print) | 5987 〕 ← 2
Stack〔 (Even print) | (Odd print) | 5987 | 2 〕 ← mod
Stack〔 (Even print) | (Odd print) | 1 〕 ← 0
Stack〔 (Even print) | (Odd print) | 1 | 0 〕 ← equal
Stack〔 (Even print) | (Odd print) | false 〕 ← if
Stack〔 〕 ← Odd
Stack〔 (Odd) 〕 ← print
[Output]: Odd
</code></pre>
<p><strong>Result</strong>:</p>
<pre><code class="language-stack-repl">Stack〔 〕 ← 3
Stack〔 3 〕 ← 4
Stack〔 3 | 4 〕 ← add
Stack〔 7 〕
</code></pre>

</main>

Expand Down
23 changes: 23 additions & 0 deletions docs/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,29 @@ <h2 id="combining-operations"><a class="header" href="#combining-operations">Com
</code></pre>
<div style="break-before: page; page-break-before: always;"></div><h1 id="inputoutput"><a class="header" href="#inputoutput">Input/Output</a></h1>
<div style="break-before: page; page-break-before: always;"></div><h1 id="control"><a class="header" href="#control">Control</a></h1>
<p>Any programming language needs control syntax.
In this chapter, Explain control syntax such as <code>if</code>, <code>while</code> etc of Stack.</p>
<h2 id="if"><a class="header" href="#if">If</a></h2>
<p><strong>Example</strong>:<br />
In this code, judgement which even or odd is 5987.</p>
<pre><code>Stack〔 〕 ← (Even print)
Stack〔 (Even print) 〕 ← (Odd print)
Stack〔 (Even print) | (Odd print) 〕 ← 5987
Stack〔 (Even print) | (Odd print) | 5987 〕 ← 2
Stack〔 (Even print) | (Odd print) | 5987 | 2 〕 ← mod
Stack〔 (Even print) | (Odd print) | 1 〕 ← 0
Stack〔 (Even print) | (Odd print) | 1 | 0 〕 ← equal
Stack〔 (Even print) | (Odd print) | false 〕 ← if
Stack〔 〕 ← Odd
Stack〔 (Odd) 〕 ← print
[Output]: Odd
</code></pre>
<p><strong>Result</strong>:</p>
<pre><code class="language-stack-repl">Stack〔 〕 ← 3
Stack〔 3 〕 ← 4
Stack〔 3 | 4 〕 ← add
Stack〔 7 〕
</code></pre>
<div style="break-before: page; page-break-before: always;"></div><h1 id="string"><a class="header" href="#string">String</a></h1>
<div style="break-before: page; page-break-before: always;"></div><h1 id="list"><a class="header" href="#list">List</a></h1>
<div style="break-before: page; page-break-before: always;"></div><h1 id="functional"><a class="header" href="#functional">Functional</a></h1>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.json

Large diffs are not rendered by default.

0 comments on commit 3ba9c9e

Please sign in to comment.