Skip to content

Commit 28e2507

Browse files
author
Derp McDerpson
authored
Merge pull request #4 from testitem/gh-pages
Create gh-pages branch via GitHub
2 parents 1137917 + 6dd3d0e commit 28e2507

File tree

5 files changed

+937
-1
lines changed

5 files changed

+937
-1
lines changed

index.html

Lines changed: 138 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,138 @@
1-
<h1>Welcome to Logicode!</h1>
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Logicode by testitem</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
8+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
9+
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
10+
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
11+
</head>
12+
<body>
13+
<section class="page-header">
14+
<h1 class="project-name">Logicode</h1>
15+
<h2 class="project-tagline">An esoteric language based on logic gates.</h2>
16+
<a href="https://github.com/testitem/Logicode" class="btn">View on GitHub</a>
17+
<a href="https://github.com/testitem/Logicode/zipball/master" class="btn">Download .zip</a>
18+
<a href="https://github.com/testitem/Logicode/tarball/master" class="btn">Download .tar.gz</a>
19+
</section>
20+
21+
<section class="main-content">
22+
<h1>
23+
<a id="logicode" class="anchor" href="#logicode" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Logicode</h1>
24+
25+
<p>Welcome to Logicode!</p>
26+
27+
<p>Logicode is a minimalistic language that is mainly based on Logisim.</p>
28+
29+
<p>Because of that, the only built-in commands are AND, OR and NOT, and you make the rest.</p>
30+
31+
<p>The three logic gates are represented like so:</p>
32+
33+
<ul>
34+
<li>
35+
<code>a&amp;b</code>: AND of <code>a</code> and <code>b</code>.</li>
36+
<li>
37+
<code>a|b</code>: OR of <code>a</code> and <code>b</code>.</li>
38+
<li>
39+
<code>!a</code>: NOT of <code>a</code>.</li>
40+
</ul>
41+
42+
<p>There are more built-ins:</p>
43+
44+
<ul>
45+
<li>
46+
<code>?</code>: Random bit, either <code>0</code> or <code>1</code>.</li>
47+
<li>
48+
<code>#</code>: Begins a line for comments.</li>
49+
</ul>
50+
51+
<p>You can make extra things from these commands, like circuits and variables.</p>
52+
53+
<h2>
54+
<a id="make-your-own-things" class="anchor" href="#make-your-own-things" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Make-your-own Things</h2>
55+
56+
<h3>
57+
<a id="circuits" class="anchor" href="#circuits" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Circuits</h3>
58+
59+
<p>To create a circuit, you have to do this:</p>
60+
61+
<p><code>circ circuit_name(arg1, arg2...)-&gt;{what the function does}</code></p>
62+
63+
<p><code>circ</code> is the circuit "declaration", and everything after the <code>-&gt;</code> is interpreted as code. </p>
64+
65+
<p>Normal circuits have 1 bit as output, but if more bits are required, use the <code>+</code> symbol to separate bits.</p>
66+
67+
<p>Like this:</p>
68+
69+
<p><code>circ circuit_name(arg1, arg2...)-&gt;{1st bit}+{2nd bit}+...</code></p>
70+
71+
<h3>
72+
<a id="variables" class="anchor" href="#variables" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Variables</h3>
73+
74+
<p>To create a variable:</p>
75+
76+
<p><code>var var_name=value</code></p>
77+
78+
<p><code>var</code> is the variable declaration.</p>
79+
80+
<h3>
81+
<a id="conditions" class="anchor" href="#conditions" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Conditions</h3>
82+
83+
<p>To create a condition:</p>
84+
85+
<p><code>cond arg-&gt;{executed if arg = 1}/{executed if arg = 0}</code></p>
86+
87+
<p><code>cond</code> is the variable declaration, <code>arg</code> is either a value of <code>0</code> or <code>1</code>, and the <code>/</code> is the separator of the two executing strings.</p>
88+
89+
<h2>
90+
<a id="io" class="anchor" href="#io" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>I/O</h2>
91+
92+
<h3>
93+
<a id="output" class="anchor" href="#output" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Output</h3>
94+
95+
<p>There is also output as well:</p>
96+
97+
<p><code>out out_value</code></p>
98+
99+
<p><code>out</code> is the output declaration, and you can include the built-in commands, as well as self-made circuits, into the output to be processed.</p>
100+
101+
<h2>
102+
<a id="example-code" class="anchor" href="#example-code" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Example code:</h2>
103+
104+
<pre><code>circ xor(a,b)-&gt;(!(a&amp;b))&amp;(a|b)
105+
var test=xor(1,1)
106+
out !(test)
107+
108+
Output: 1
109+
</code></pre>
110+
111+
<p>The circuit <code>xor</code> calculates the XOR of two bits, and <code>test</code> is declared as the XOR of 1 and 1 (which is 0). </p>
112+
113+
<p>Then, the <code>out</code> outputs the NOT of <code>test</code>, which is <code>1</code>.</p>
114+
115+
<p>Expanding on the previous example:</p>
116+
117+
<pre><code>circ xor(a,b)-&gt;(!(a&amp;b))&amp;(a|b)
118+
circ ha(a,b)-&gt;(a&amp;b)+(xor(a,b))
119+
out ha(1,?)
120+
121+
Output: 10
122+
</code></pre>
123+
124+
<p>The circuit <code>xor</code> is the same as before, and the circuit <code>ha</code> is a half-adder of two bits (so it takes two arguments), and outputs two bits.</p>
125+
126+
<p>The <code>out</code> outputs the half-adding of <code>1</code> and <code>?</code>, which is either <code>01</code> or <code>10</code> (depending on what the <code>?</code> gives).</p>
127+
128+
<footer class="site-footer">
129+
<span class="site-footer-owner"><a href="https://github.com/testitem/Logicode">Logicode</a> is maintained by <a href="https://github.com/testitem">testitem</a>.</span>
130+
131+
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
132+
</footer>
133+
134+
</section>
135+
136+
137+
</body>
138+
</html>

params.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "Logicode",
3+
"tagline": "An esoteric language based on logic gates.",
4+
"body": "# Logicode\r\nWelcome to Logicode!\r\n\r\nLogicode is a minimalistic language that is mainly based on Logisim.\r\n\r\nBecause of that, the only built-in commands are AND, OR and NOT, and you make the rest.\r\n\r\nThe three logic gates are represented like so:\r\n\r\n- `a&b`: AND of `a` and `b`.\r\n- `a|b`: OR of `a` and `b`.\r\n- `!a`: NOT of `a`.\r\n\r\nThere are more built-ins:\r\n\r\n- `?`: Random bit, either `0` or `1`.\r\n- `#`: Begins a line for comments.\r\n\r\nYou can make extra things from these commands, like circuits and variables.\r\n\r\n##Make-your-own Things\r\n\r\n###Circuits\r\nTo create a circuit, you have to do this:\r\n\r\n`circ circuit_name(arg1, arg2...)->{what the function does}`\r\n\r\n`circ` is the circuit \"declaration\", and everything after the `->` is interpreted as code. \r\n\r\nNormal circuits have 1 bit as output, but if more bits are required, use the `+` symbol to separate bits.\r\n\r\nLike this:\r\n\r\n`circ circuit_name(arg1, arg2...)->{1st bit}+{2nd bit}+...`\r\n\r\n###Variables\r\nTo create a variable:\r\n\r\n`var var_name=value`\r\n\r\n`var` is the variable declaration.\r\n\r\n###Conditions\r\nTo create a condition:\r\n\r\n`cond arg->{executed if arg = 1}/{executed if arg = 0}`\r\n\r\n`cond` is the variable declaration, `arg` is either a value of `0` or `1`, and the `/` is the separator of the two executing strings.\r\n\r\n##I/O\r\n\r\n###Output\r\nThere is also output as well:\r\n\r\n`out out_value`\r\n\r\n`out` is the output declaration, and you can include the built-in commands, as well as self-made circuits, into the output to be processed.\r\n\r\n##Example code:\r\n\r\n circ xor(a,b)->(!(a&b))&(a|b)\r\n var test=xor(1,1)\r\n out !(test)\r\n\r\n Output: 1\r\n\r\nThe circuit `xor` calculates the XOR of two bits, and `test` is declared as the XOR of 1 and 1 (which is 0). \r\n\r\nThen, the `out` outputs the NOT of `test`, which is `1`.\r\n\r\nExpanding on the previous example:\r\n\r\n circ xor(a,b)->(!(a&b))&(a|b)\r\n circ ha(a,b)->(a&b)+(xor(a,b))\r\n out ha(1,?)\r\n\r\n Output: 10\r\n \r\nThe circuit `xor` is the same as before, and the circuit `ha` is a half-adder of two bits (so it takes two arguments), and outputs two bits.\r\n\r\nThe `out` outputs the half-adding of `1` and `?`, which is either `01` or `10` (depending on what the `?` gives).\r\n",
5+
"note": "Don't delete this file! It's used internally to help with page regeneration."
6+
}

stylesheets/github-light.css

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/*
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2016 GitHub, Inc.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
24+
*/
25+
26+
.pl-c /* comment */ {
27+
color: #969896;
28+
}
29+
30+
.pl-c1 /* constant, variable.other.constant, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */,
31+
.pl-s .pl-v /* string variable */ {
32+
color: #0086b3;
33+
}
34+
35+
.pl-e /* entity */,
36+
.pl-en /* entity.name */ {
37+
color: #795da3;
38+
}
39+
40+
.pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */,
41+
.pl-s .pl-s1 /* string source */ {
42+
color: #333;
43+
}
44+
45+
.pl-ent /* entity.name.tag */ {
46+
color: #63a35c;
47+
}
48+
49+
.pl-k /* keyword, storage, storage.type */ {
50+
color: #a71d5d;
51+
}
52+
53+
.pl-s /* string */,
54+
.pl-pds /* punctuation.definition.string, string.regexp.character-class */,
55+
.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
56+
.pl-sr /* string.regexp */,
57+
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
58+
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */,
59+
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ {
60+
color: #183691;
61+
}
62+
63+
.pl-v /* variable */ {
64+
color: #ed6a43;
65+
}
66+
67+
.pl-id /* invalid.deprecated */ {
68+
color: #b52a1d;
69+
}
70+
71+
.pl-ii /* invalid.illegal */ {
72+
color: #f8f8f8;
73+
background-color: #b52a1d;
74+
}
75+
76+
.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
77+
font-weight: bold;
78+
color: #63a35c;
79+
}
80+
81+
.pl-ml /* markup.list */ {
82+
color: #693a17;
83+
}
84+
85+
.pl-mh /* markup.heading */,
86+
.pl-mh .pl-en /* markup.heading entity.name */,
87+
.pl-ms /* meta.separator */ {
88+
font-weight: bold;
89+
color: #1d3e81;
90+
}
91+
92+
.pl-mq /* markup.quote */ {
93+
color: #008080;
94+
}
95+
96+
.pl-mi /* markup.italic */ {
97+
font-style: italic;
98+
color: #333;
99+
}
100+
101+
.pl-mb /* markup.bold */ {
102+
font-weight: bold;
103+
color: #333;
104+
}
105+
106+
.pl-md /* markup.deleted, meta.diff.header.from-file */ {
107+
color: #bd2c00;
108+
background-color: #ffecec;
109+
}
110+
111+
.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ {
112+
color: #55a532;
113+
background-color: #eaffea;
114+
}
115+
116+
.pl-mdr /* meta.diff.range */ {
117+
font-weight: bold;
118+
color: #795da3;
119+
}
120+
121+
.pl-mo /* meta.output */ {
122+
color: #1d3e81;
123+
}
124+

0 commit comments

Comments
 (0)