We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

MBPL

From Esolang
Jump to navigation Jump to search

MBPL [ɱⱱapɵl] (Matrix Based Programming Language) is a linear algebra based language made by Cool Fool!!!!.

matrix maker

Make your matrix. These have to be n×n, so let’s write Ɐ̊ & Ɐ̍ n (Ɐ for "for all" + ˚ for "column" + ι for "row"). We have to assign this a name, for example ‘A’, so we do that like Ɐ̊ & Ɐ̍ n => A. Then we can use this for equations by prefixing it with the variable sign $, making $A.

The matrix is initially all 0, so we can store integer I into matrix A as I ˚C ιR ~$A. Basically C is the column we wanna store it on and R is the row.

matrix operators

Matrices have 6 basic operators. You can use ,$A to get the determinant of A

You can use ;$A to get the rref of A

You can use ;$A to get the trace of A

You can use #$B$A to get the matrix product of B and A (iff B has the same dimensions as A) or 0 (iff B does not have the same dimensions as A)

You can use %$B$A to get the sum of B and A (iff B has the same dimensions as A) or 0 (iff B does not have the same dimensions as A)

You can use I!$A to get matrix A raised to some integer power I (A can be raised to a negative power iff it is invertible. If the inverse has non-integers, replace all non-integers with the closest integer.)

Use ? to get input as an Unicode value which will translate into an integer.

Use q$A to output the integers in A (left-to-right-top-to-bottom) as unicode

Use q(˚C, ιR, $A) to output the integer in position (R, C) and matrix A (left-to-right-top-to-bottom) as unicode.

Use h$A to output the integers in A (left-to-right-top-to-bottom) as hexadecimal

Use h(˚C, ιR, $A) to output the integer in position (R, C) and matrix A (left-to-right-top-to-bottom) as hexadecimal.

loops

⍫
 foobar

will loop foobar indefinitely

∇
 foobar

will loop foobar n times

wh
 foobar

will loop while foobar is true

un
 foobar

will loop while foobar is false

control flow

foo give 
 bar 

will preform bar if foo is true

foo take 
 bar 

will preform bar if foo is false

foo Z [bar]

will check if foo equals bar

programs

cat program

Ɐ̊ & Ɐ̍ 1 => A
? ˚1 ι1 ~$A
q$A

unicode to unicode value

Ɐ̊ & Ɐ̍ 1 => A
? ˚1 ι1 ~$A
h$A

truth machine

Ɐ̊ & Ɐ̍ 1 => A
Ɐ̊ & Ɐ̍ 1 => B
49 ˚1 ι1 ~$A
48 ˚1 ι1 ~$B
? Z [49] give 
 ⍫
  q$A
? Z [48] give 
 q$B

A+B problem

Ɐ̊ & Ɐ̍ 1 => A
Ɐ̊ & Ɐ̍ 1 => B
? ˚1 ι1 ~$A
? ˚1 ι1 ~$B
%$B$A