Skip to content

Example code

Felipe Martínez edited this page Apr 9, 2020 · 10 revisions

Here are a couple snippets of LogicScript code to give you a feeling of the language:

# This script doesn't necessarily do anything useful

once
    out = 0
end

when in[0]
    # Store input in memory
    mem = in

    # Output number divided by 2
    out = in / 2'
end

any
    out[0] = and(in) | 100

    out = (in[3], in[2], in[1], in[0])
end

Simple counter:

when in[0] == 1
    mem = mem + 1'
    out = mem
end

Clone this wiki locally