Circuit

From Esolang
Jump to navigation Jump to search

Circuit is a 2d esolang based on circuits. a basic circuit looks like this

>----:

the arrow(>) produces "electricity" and flows through the wires(-) and reaches the colon(:) ending the flow of "electricity".

Wire connections

-

will connect left to right

|

will connect bottom to top

\

will connect left and right to bottom

/

will connect left and right to top

+

will cross connect acting like a | and a -

will act like + without bottom

will act like + without top

will act like + without left

will act like + without right

x

+ but diagonal

Characters

symbol function
> produces "electricity" to the right
< produces "electricity" to the left
^ produces "electricity" upwards
v produces "electricity" downwards
- wire
: wire end
O outputs 1 when touching "electricity"
~ switch. asks for user input. if 1 then let "electricity" flow. if 0 then stop "electricity".
N inverter. turns 1 into 0 and 0 into 1
" marks a string. if "electricity" hits the quotation marks, the "electricity" will have the string inside of it and skips everything inside the quotation marks
X halts when "electricity" flows through it
() comments
& waits for "electricity" to go into it. takes every string inside each "electricity" current and concatenates them

Examples

&

>-"hello"---\
             &-O: (outputs "hello world")
>-" world"--/

hello world

>-"hello, world!"-O:

And gate

>~>~O: (just like the real thing)

Or gate

>~---\
      --O: (just like minecraft)
>~---/

Not gate

>~N-O:

NXOR

>~>~N---\
         \
>~---\    -N-O:
      ---/
>~---/

==