TokenCraft is a programming language tool that helps you write and understand code better. It takes your code written in PLT (Programming Language TokenCraft) and turns it into a clear, visual representation that shows how your program is structured.
# Clone the repository
git clone https://github.com/Cri5tiann/TokenCraft.git
# Navigate to project directory
cd java
# Build the project
run the Main class and see what a great small project I built))
Every program needs:
function main()
declaration- Semicolons (
;
) after statements - Curly braces (
{}
) for blocks
If-Else Statement
if (x > 0) {
output_int(x);
} else {
output_int(0);
}
For Loop
for (i = 0; i < 10; i++) {
output_int(i);
}
|
|
Math
|
+
,
-
,
*
,
/
,
%
|
|
Comparison
|
<
,
<=
,
>
,
>=
,
==
|
|
Logic
|
&&
(and), || (or)
|
|
Assignment
|
=
|
|
Increment/Decrement
|
++
,
--
|
Calculator Program
function main() {
x = input_int();
y = input_int();
output_int(x + y); // Addition
output_int(x * y); // Multiplication
}
Number Checker
function main() {
num = input_int();
if (num > 0) {
output_int(1);
} else {
if (num < 0) {
output_int(-1);
} else {
output_int(0);
}
}
}
How do I input multiple numbers?
Use input_int()
multiple times:
x = input_int();
y = input_int();
Why doesn't my program work?
Check for:
- Missing semicolons (
;
) - Missing curly braces (
{}
) - Mismatched parentheses
[Documentation][docs]
Made with student passion by Cristian