Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 138 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1,138 @@
<h1>Welcome to Logicode!</h1>
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Logicode by testitem</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">Logicode</h1>
<h2 class="project-tagline">An esoteric language based on logic gates.</h2>
<a href="https://github.com/testitem/Logicode" class="btn">View on GitHub</a>
<a href="https://github.com/testitem/Logicode/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/testitem/Logicode/tarball/master" class="btn">Download .tar.gz</a>
</section>

<section class="main-content">
<h1>
<a id="logicode" class="anchor" href="#logicode" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Logicode</h1>

<p>Welcome to Logicode!</p>

<p>Logicode is a minimalistic language that is mainly based on Logisim.</p>

<p>Because of that, the only built-in commands are AND, OR and NOT, and you make the rest.</p>

<p>The three logic gates are represented like so:</p>

<ul>
<li>
<code>a&amp;b</code>: AND of <code>a</code> and <code>b</code>.</li>
<li>
<code>a|b</code>: OR of <code>a</code> and <code>b</code>.</li>
<li>
<code>!a</code>: NOT of <code>a</code>.</li>
</ul>

<p>There are more built-ins:</p>

<ul>
<li>
<code>?</code>: Random bit, either <code>0</code> or <code>1</code>.</li>
<li>
<code>#</code>: Begins a line for comments.</li>
</ul>

<p>You can make extra things from these commands, like circuits and variables.</p>

<h2>
<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>

<h3>
<a id="circuits" class="anchor" href="#circuits" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Circuits</h3>

<p>To create a circuit, you have to do this:</p>

<p><code>circ circuit_name(arg1, arg2...)-&gt;{what the function does}</code></p>

<p><code>circ</code> is the circuit "declaration", and everything after the <code>-&gt;</code> is interpreted as code. </p>

<p>Normal circuits have 1 bit as output, but if more bits are required, use the <code>+</code> symbol to separate bits.</p>

<p>Like this:</p>

<p><code>circ circuit_name(arg1, arg2...)-&gt;{1st bit}+{2nd bit}+...</code></p>

<h3>
<a id="variables" class="anchor" href="#variables" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Variables</h3>

<p>To create a variable:</p>

<p><code>var var_name=value</code></p>

<p><code>var</code> is the variable declaration.</p>

<h3>
<a id="conditions" class="anchor" href="#conditions" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Conditions</h3>

<p>To create a condition:</p>

<p><code>cond arg-&gt;{executed if arg = 1}/{executed if arg = 0}</code></p>

<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>

<h2>
<a id="io" class="anchor" href="#io" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>I/O</h2>

<h3>
<a id="output" class="anchor" href="#output" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Output</h3>

<p>There is also output as well:</p>

<p><code>out out_value</code></p>

<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>

<h2>
<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>

<pre><code>circ xor(a,b)-&gt;(!(a&amp;b))&amp;(a|b)
var test=xor(1,1)
out !(test)

Output: 1
</code></pre>

<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>

<p>Then, the <code>out</code> outputs the NOT of <code>test</code>, which is <code>1</code>.</p>

<p>Expanding on the previous example:</p>

<pre><code>circ xor(a,b)-&gt;(!(a&amp;b))&amp;(a|b)
circ ha(a,b)-&gt;(a&amp;b)+(xor(a,b))
out ha(1,?)

Output: 10
</code></pre>

<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>

<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>

<footer class="site-footer">
<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>

<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>
</footer>

</section>


</body>
</html>
6 changes: 6 additions & 0 deletions params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Logicode",
"tagline": "An esoteric language based on logic gates.",
"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",
"note": "Don't delete this file! It's used internally to help with page regeneration."
}
124 changes: 124 additions & 0 deletions stylesheets/github-light.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
The MIT License (MIT)
Copyright (c) 2016 GitHub, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

.pl-c /* comment */ {
color: #969896;
}

.pl-c1 /* constant, variable.other.constant, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */,
.pl-s .pl-v /* string variable */ {
color: #0086b3;
}

.pl-e /* entity */,
.pl-en /* entity.name */ {
color: #795da3;
}

.pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */,
.pl-s .pl-s1 /* string source */ {
color: #333;
}

.pl-ent /* entity.name.tag */ {
color: #63a35c;
}

.pl-k /* keyword, storage, storage.type */ {
color: #a71d5d;
}

.pl-s /* string */,
.pl-pds /* punctuation.definition.string, string.regexp.character-class */,
.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
.pl-sr /* string.regexp */,
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */,
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ {
color: #183691;
}

.pl-v /* variable */ {
color: #ed6a43;
}

.pl-id /* invalid.deprecated */ {
color: #b52a1d;
}

.pl-ii /* invalid.illegal */ {
color: #f8f8f8;
background-color: #b52a1d;
}

.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
font-weight: bold;
color: #63a35c;
}

.pl-ml /* markup.list */ {
color: #693a17;
}

.pl-mh /* markup.heading */,
.pl-mh .pl-en /* markup.heading entity.name */,
.pl-ms /* meta.separator */ {
font-weight: bold;
color: #1d3e81;
}

.pl-mq /* markup.quote */ {
color: #008080;
}

.pl-mi /* markup.italic */ {
font-style: italic;
color: #333;
}

.pl-mb /* markup.bold */ {
font-weight: bold;
color: #333;
}

.pl-md /* markup.deleted, meta.diff.header.from-file */ {
color: #bd2c00;
background-color: #ffecec;
}

.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ {
color: #55a532;
background-color: #eaffea;
}

.pl-mdr /* meta.diff.range */ {
font-weight: bold;
color: #795da3;
}

.pl-mo /* meta.output */ {
color: #1d3e81;
}

Loading