JUGGLE

From Esolang
Jump to navigation Jump to search

JUGGLE is a Wikipedia: Group Theory based programming language that is the second generation of GTPS made by User:A() while also being inspired by Burro

What Is A Group Based Programming Language?

I could say that a group based programming Language defines a group with n elements and defines actions that map elements to other elements in aforementioned group, but there isn't enough esolangs so probably not.

Commands

Commands
Command Inverse Explanation
a: n1 → n2, n3...,n1 a': n1 → n3, n2...,n1 define an action that maps n1 to n2, etc.
a =: n a' =: n' define variable
*a{} (*a{})' While a is not it's original value
~n ~n' define group with n elements
[n] [n'] do n
#a=b{n} (#a=b{n})' if a = b, do n

Programs

Truth-machine

~2
c: 1 → 0
e: Do nothing
I =: 1 // either 0 or 1
c2 =: 1
[ c(c2) ]
#I=1
{
 *c2
 {
  [e]
 }
}
(#I=1
{
 *c2
 {
  [e]
 }
})'

A+B

~99
Inc: 1 → 2, 3, 4,..99,1
a =: 0
b =: 0
[Inc2(a)] // set a to 2
[Inc2(b)] // set b to 2
*b
{
 [Inc(a)]
 [Inc'(b)]
}
(*b
{
 [Inc(a)]
 [Inc'(b)]
})'

A-B

~99
Inc: 1 → 2, 3, 4,..99,1
a =: 0
b =: 0
[Inc2(a)] // set a to 2
[Inc2(b)] // set b to 2
*b
{
 [Inc'(a)]
 [Inc'(b)]
}
(*b
{
 [Inc'(a)]
 [Inc'(b)]
})'

A*B

~99
Inc: 1 → 2, 3, 4,..99,1
a =: 0
b =: 0
counter =: 0
store =: 0
[Inc2(a)] // change the two to any number
[Inc2(b)] // change the two to any number
*b
{
 *a
 {
  [Inc'(a)]
  [Inc(count)]
  [Inc(store)]
 }
 [Inc'(b)]
 *store
 {
  [Inc(a)]
  [Inc(count)]
 }
}
(*b
{
 *a
 {
  [Inc'(a)]
  [Inc(count)]
  [Inc(store)]
 }
 [Inc'(b)]
 *store
 {
  [Inc(a)]
  [Inc(count)]
 }
})'

And gate

~2
Not: 0 → 1, 0
a =: 1
b =: 1
condition =: 0 
bool =: 0
[Not(condition)]
#a=1
{
 #b=1
 {
  *condition
  {
   #bool=0
   {
    [Not(bool)]
   }
  }
 }
}
(#a=1
{
 #b=1
 {
  *condition
  {
   #bool=0
   {
    [Not(bool)]
   }
  }
 }
})'