Skip to content
kev faust edited this page Jan 19, 2016 · 13 revisions

##Installing You need to have rthornton128/goncurses installed first.

Grab the package files: $ go get github.com/furryfaust/textelectronics

Build text electronics: $ go build textelectronics.go

##Circuit Creating/Simulation Create your first circuit: $ touch circuit.txt

Let's add our first component. Components are basically a pattern of characters in the x and y axis. Our first component will be an input component. A input component's pattern is a curly brace, then an id, then a closing curly brace. It allows the user to hard insert a value a component in the circuit.

{A}

Lets run it through Text Electronics: $ ./textelectronics circuit.txt

----------
Input ID: A Out: 0
{A}

The default value of an input component is 0 but we can set it:

$ ./textelectronics circuit.txt A:1
----------
Input ID: A Out: 1
{A}

Now if we want to do something with the output of the input component, we would have to open an output stream. Streams are marked by % followed by a letter which would signal the stream port. Let's connect the output of the input component to the input of a probe component.

{A}%O------I%(B)
$ ./textelectronics circuit.txt A:1
----------
Input ID: A Out: 1
Probe ID: B In: 1 Out: 1
{A}%O------I%(1)

As you can see it worked. The 1 from the output of the input component was passed into the input of the probe component. Now something special also happened here. If you look at the visual print of the circuit, the id of the probe component has been replaced by the actual output of the probe component. This is a special feature of the probe component as it was made by debugging.