ArthurSonzogni / Diagon
Programming Languages
Projects that are alternatives of or similar to Diagon
Diagon
Diagon is an interactive interpreter. It transforms markdown-style expression into an ascii-art representation.
It is written in C++ and use WebAssembly, HTML and CSS to make a Web Application.
https://arthursonzogni.com/Diagon/
Table of content
Generators
Mathematic Expression
input:
f(x) = 1 + x / (1 + x)
output (Unicode):
x
f(x) = 1 + โโโโโ
1 + x
input:
sqrt(1+sqrt(1+x/2))
output (Unicode)
_____________
โฑ _____
โฑ โฑ x
โฑ 1 + โฑ 1 + โ
โฒโฑ โฒโฑ 2
input:
f(x) = 1 + x^2 + x^3 + x^(1+1/2)
output (Unicode):
โ 1โ
โ1 + โโ
2 3 โ 2โ
f(x) = 1 + x + x + x
input:
sum(i^2,i=0,n) = n^3/2+n^2/2+n/6
output (Unicode):
n
___ 3 2
โฒ 2 n n n
โฑ i = โโ + โโ + โ
โพโพโพ 2 2 6
i = 0
input:
int(x^2/2 * dx ,0,1) = 1/6
output (Unicode):
1
โ 2
โฎ x 1
โฎ โโ โ
dx = โ
โก 2 6
0
input:
[a;b] + [c;d] = [a+c; b+d]
output (Unicode):
โaโ โcโ โa + cโ
โ โ + โ โ = โ โ
โbโ โdโ โb + dโ
input:
[1,2;3,4] * [x;y] = [1*x+2*y; 3*x+4*y]
โ1 2โ โxโ โ1 โ
x + 2 โ
yโ
โ โ โ
โ โ = โ โ
โ3 4โ โyโ โ3 โ
x + 4 โ
yโ
Sequence Diagram
input
Alice -> Bob: Hello Bob!
Alice <- Bob: Hello Alice!
Output (Unicode)
โโโโโโโ โโโโโ
โAliceโ โBobโ
โโโโฌโโโ โโโฌโโ
โ โ
โ Hello Bob! โ
โโโโโโโโโโโโ>โ
โ โ
โHello Alice!โ
โ<โโโโโโโโโโโโ
โโโโดโโโ โโโดโโ
โAliceโ โBobโ
โโโโโโโ โโโโโ
Input
Renderer -> Browser: BeginNavigation()
Browser -> Network: URLRequest()
Browser <- Network: URLResponse()
Renderer <- Browser: CommitNavigation()
Renderer -> Browser: DidCommitNavigation()
Output (Unicode)
โโโโโโโโโโ โโโโโโโโโ โโโโโโโโโ
โRendererโ โBrowserโ โNetworkโ
โโโโโฌโโโโโ โโโโโฌโโโโ โโโโโฌโโโโ
โ โ โ
โ BeginNavigation() โ โ
โโโโโโโโโโโโโโโโโโโโโ>โ โ
โ โ โ
โ โURLRequest() โ
โ โโโโโโโโโโโโโ>โ
โ โ โ
โ โURLResponse()โ
โ โ<โโโโโโโโโโโโโ
โ โ โ
โ CommitNavigation() โ โ
โ<โโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โDidCommitNavigation()โ โ
โโโโโโโโโโโโโโโโโโโโโ>โ โ
โโโโโดโโโโโ โโโโโดโโโโ โโโโโดโโโโ
โRendererโ โBrowserโ โNetworkโ
โโโโโโโโโโ โโโโโโโโโ โโโโโโโโโ
Input
1) Renderer -> Browser: Message 1
2) Renderer <- Browser: Message 2
Renderer: 1<2
Browser: 2<1
Output (Unicode)
โโโโโโโโโโโโโโโโโโโ
โRendererโโBrowserโ
โโโโโฌโโโโโโโโโโฌโโโโ
โ โ
โโโโ โ
โMessage 2โ
โ<โโโโโโโโโ
โ โ โ
โMessage 1โ
โ โโโโโโ>โ
โโโโโดโโโโโโโโโโดโโโโ
โRendererโโBrowserโ
โโโโโโโโโโโโโโโโโโโ
Tree
Input
Linux
Android
Debian
Ubuntu
Lubuntu
Kubuntu
Xubuntu
Xubuntu
Mint
Centos
Fedora
Output (Style Unicode 1)
Linux
โโAndroid
โโDebian
โ โโUbuntu
โ โ โโLubuntu
โ โ โโKubuntu
โ โ โโXubuntu
โ โ โโXubuntu
โ โโMint
โโCentos
โโFedora
Output (Style ASCII 2)
Linux
+--Android
+--Debian
| +--Ubuntu
| | +--Lubuntu
| | +--Kubuntu
| | +--Xubuntu
| | `--Xubuntu
| `--Mint
+--Centos
`--Fedora
Output (Style Unicode right top)
โโโLinuxโโฌโAndroid
โโDebianโโฌโUbuntuโโฌโLubuntu
โ โ โโKubuntu
โ โ โโXubuntu
โ โ โโXubuntu
โ โโMint
โโCentos
โโFedora
Output (Style Unicode right center)
โโAndroid
โ โโLubuntu
โ โโKubuntu
โโDebianโโฌโUbuntuโโผโXubuntu
โโโLinuxโโค โ โโXubuntu
โ โโMint
โโCentos
โโFedora
Frame
Input
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
Output
โโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ1โ#include <iostream> โ
โ2โusing namespace std; โ
โ3โ โ
โ4โint main() โ
โ5โ{ โ
โ6โ cout << "Hello, World!";โ
โ7โ return 0; โ
โ8โ} โ
โโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Table
Input
Column 1,Column 2,Column 3
C++,Web,Assembly
Javascript,CSS,HTML
Output (Style Unicode)
โโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
โColumn 1 โColumn 2โColumn 3โ
โโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
โC++ โWeb โAssemblyโ
โโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
โJavascriptโCSS โHTML โ
โโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
Planar graph
Input
if -> "then A" -> end
if -> "then B" -> end
end -> loop -> if
Output (Unicode)
โโโโโโโโโโโโ
โ if โ
โโณโโฌโโโโโโโฌโ
โ โ โโฝโโโโโโ
โ โ โthen Aโ
โ โ โโฌโโโโโโ
โโโฝโโโโโโโ
โโthen Bโโ
โโโฌโโโโโโโ
โโโฝโโโโโโโฝโโ
โโ end โ
โโโฌโโโโโโโโโ
โโดโโฝโโ
โloopโ
โโโโโโ
Command line interface
Diagon is also usable as a command line tool. For instance:
echo ""1+1/2 + sum(i,0,10) = 112/2" | diagon Math
10
___
1 โฒ 112
1 + โ + โฑ i = โโโ
2 โพโพโพ 2
0
To use it, you can either compile it from source or use the precompiled binaries published on the snapstore:
sudo snap install diagon
Thanks
This project has been possible thanks to these great projects