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.

!Matrix

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

!Matrix only uses matrices to store data, it was made by User:A().

Commands

This was made a long time ago and I don't have a doc. A() (talk) 22:29, 31 December 2025 (UTC)

Programs

Truth machine

1 MAKE NEW MATRIX WITH DIMENSIONS (1,1) CALLED ‘INPUT’
2 ACCEPT INPUT FROM USER AND FILL CELL AT (1,1) FROM MATRIX ‘INPUT’
3 GOTO LINE 5 IF < (<GET CELL FROM MATRIX ‘INPUT’ AT (1,1)>) IS (<1>) > IS TRUE
4 GOTO LINE 7 IF < NOT(< (<GET CELL FROM MATRIX ‘INPUT’ AT (1,1)>) IS 
  (<1>) >) > IS TRUE
5 PRINT MATRIX ‘INPUT’
6 GOTO LINE 3 IF <TRUE> IS TRUE 
7 PRINT MATRIX ‘INPUT’
8 END

Addition

1 MAKE NEW MATRIX WITH DIMENSIONS (2,1) CALLED 'INPUT'
2 ACCEPT INPUT FROM USER AND FILL CELL AT (1,1) FROM MATRIX ‘INPUT’ 
3 ACCEPT INPUT FROM USER AND FILL CELL AT (2,1) FROM MATRIX `INPUT’
4 MULTIPLY ROW 1 BY 1 FROM MATRIX 'INPUT' AND ADD IT TO ROW 2
5 PRINT GET CELL FROM MATRIX ‘INPUT’ AT (2,1)
6 END

Subtraction

1 MAKE NEW MATRIX WITH DIMENSIONS (2,1) CALLED 'INPUT'
2 ACCEPT INPUT FROM USER AND FILL CELL AT (1,1) FROM MATRIX ‘INPUT’ 
3 ACCEPT INPUT FROM USER AND FILL CELL AT (2,1) FROM MATRIX ‘INPUT’
4 MAKE NEW MATRIX WITH DIMENSIONS (2,1) CALLED 'NEG'
5 SUBTRACT 1 FROM CELL AT (1,1) FROM MATRIX 'INPUT'
6 ADD 1 FROM CELL AT (1,2) FROM MATRIX 'INPUT'
7 MAKE NEW MATRIX WITH DIMENSIONS (2,1) CALLED 'RESULT'
8 MULTIPLY MATRIX 'INPUT' BY MATRIX 'NEG' AND STORE RESULT USING 'RESULT'
9 MULTIPLY ROW 1 BY 1 FROM MATRIX 'RESULT' AND ADD IT TO ROW 2
10 PRINT GET CELL AT (2,1) FROM MATRIX 'RESULT'
11 END