diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ed2a6b8..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_pycache_ diff --git a/README.md b/README.md deleted file mode 100644 index c7307c5..0000000 --- a/README.md +++ /dev/null @@ -1,14 +0,0 @@ -########################################## -# BCODE - LICENSED UNDER THE MIT LICENSE # -########################################## -# Copyright (c) 2024 BubuCode -# See LICENSE file in root folder for full details. -########################################## - -BCode (BubuCode) - -BCode, also known as BubuCode, is a simple, easy-to-use interpreted programming language. BCode's syntax is designed to be minimal, intuitive, and beginner-friendly. - -BCode is mainly written with the intention to help beginners start their programming journey, or for programmers who are just bored and want to learn a simple new language :D - -Read the official full documentation of BCode: diff --git a/bcodeicon.png b/bcodeicon.png new file mode 100644 index 0000000..d2bf1fe Binary files /dev/null and b/bcodeicon.png differ diff --git a/index.html b/index.html index 10ddd6d..65f683a 100644 --- a/index.html +++ b/index.html @@ -1 +1,161 @@ -Hello! + + +
+ + + +Declare variables using the VAR keyword.
+VAR name = "Bubu" +VAR number = 42 ++ +
Define functions with FUN. Use RETURN to exit with a value.
+FUN add(a, b)
+ RETURN a + b
+END
+
+FUN greet(name)
+ PRINT("Hello, " + name)
+END
+
+
+ Use IF, THEN, and ELSE for conditionals.
+IF condition THEN
+ PRINT("Condition is true")
+END
+
+IF condition <= 10 THEN
+ PRINT("Less or equal to 10")
+ELIF condition == 74
+ PRINT("Equal to 74")
+ELSE
+ PRINT("Other value")
+END
+
+
+ Use the PRINT() function to display text in the output.
+PRINT("Hello, BCode!")
+
+
+ Create loops with FOR and TO.
+FOR i = 1 TO 10 THEN + PRINT(i) +END ++ +
Add comments using the # symbol. They are ignored during execution.
+# This is a comment in BCode +# I <3 BCODE ++ +
Example of a single-line function with the joining feature.
++FUN oopify(prefix) -> prefix + "oop" ++ +
Here's a more complex example using various features of BCode:
+
+# This is a very cool example
+
+FUN oopify(prefix) -> prefix + "oop"
+
+FUN join(elements, separator)
+ VAR result = ""
+ VAR len = LEN(elements)
+
+ FOR i = 0 TO len THEN
+ VAR result = result + elements/i
+ IF i != len - 1 THEN
+ VAR result = result + separator
+ END
+ END
+
+ RETURN result
+END
+
+FUN map(elements, func)
+ VAR new_elements = []
+
+ FOR i = 0 TO LEN(elements) THEN
+ APPEND(new_elements, func(elements/i))
+ END
+
+ RETURN new_elements
+END
+
+PRINT("Greetings universe!")
+
+FOR i = 0 TO 5 THEN
+ PRINT(join(map(["l", "sp"], oopify), ", "))
+END
+
+
+
+