AlgoML
FR
Coming soon

Playground

Write AlgoML in your browser, see the generated code as you type and run it. No installation needed. We are building it.

No errors
gcd.aml
1Algorithm Gcd
2version '1.0'
3language C
4
5function gcd(a : INT, b : INT) : INT
6 variable r : INT
7begin
8 while b <> 0 do
9 r <- a mod b
10 a <- b
11 b <- r
12 end while
13 return a
14end function
15
16variable x : INT
17variable y : INT
18
19begin
20 read(x)
21 read(y)
22 write("gcd = ", gcd(x, y), "\n")
23end
24end algorithm
1#include <stdio.h>
2
3int x;
4int y;
5
6int gcd(int a, int b);
7
8int gcd(int a, int b) {
9 int r;
10 while (b != 0) {
11 r = a % b;
12 a = b;
13 b = r;
14 }
15 return a;
16}
17
18int main() {
19 scanf("%d", &x);
20 scanf("%d", &y);
21 printf("gcd = %d\n", gcd(x, y));
22 return 0;
23}
Input 48 36Output gcd = 12

Errors as you type

Mistakes are underlined with a clear message, like in VS Code.

Every language side by side

Switch between the generated files with one click.

Run and share

Run your program with your own input, then share it with a link.

In the meantime

Install the VS Code extension: it already checks your code as you type and generates it in one click.

Download