-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.txt
34 lines (25 loc) · 853 Bytes
/
spec.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Spec for the Sophie esoteric programming language
This is a Finite State Machine equivalent language.
It's name is the Hebrew word for finite.
[] - loop until break
* - break loop
. - output accumultor as number
: - input number to accumulator
, - output accumulator as char
; - input char to accumulator
@c{}{} - if accumulator is c, do the first {} otherwise do the second {} (second {} optional)
@$n{}{} - if accumulator is n, do the first {} otherwise do the second {}
#c - load char constant c into accumulator
#$n - load number constant n into accumulator
& - halt
("$$" for '$')
Brackets without a condition will never get run. This can be used for comments.
Examples:
Hello world
#H,#e,#l,,#o,#,,# ,#W,#o,#r,#l,#d,#!,&
Truth Machine
;@1{[,]}{,&}
Take 2 inputs and XOR them
;@0{;@0{#0,}{#1,}}{;@0{#1,}{#0,}}&
Cat Program
[;@$0{&}{,}]