I am currently designing a multi-tasking programming language. Called "Phava" It will be slightly based on the C programming language. It will compile the same, run the same, and will have some of the same syntax. I will show you a bit of syntax for defining functions, calling them, some simple programs, etc.
Comments are printed like this.
With the symbol at the beginning.
Before you can do anything i must explain something to you. Before you call any functions you must set the correct directory first! Example: The directory you must set to print output onto the screen is directory (string).
Heres a code example:
The "string" directory lets you print text onto the screen. and so on with math and different things. Example:If you wanted to add something or multiply it etc. then you would use (number) directory. Example:
In Phava you have to define functions before you can use them, which is printed like this.
Where "int" is the type of function, and "netvalue" is the name of the function.
Then to use the function would be printed like this.
Now here is a very simple "Hello, World!" program.
Here is a very simple adding program which really has absolutly no use at all except to show you how the (number) driectory is used.
Heres the code example:
This program prints the sum of 2+2 onto the screen along with "Can you add 2+2"
In "Phava" here are the symbol meanings...
+ :Add
= :Equals
* :Multiply
/ :Divide
- :Subtract
Heres another program that envolves "input"
This is all for now and dont hold your breath on this one because the chances of me accually creating and finishing this Programming Language are so slim that i have trouble even saying it but hey, its fun.
Plz reply and tell me what you think. I did not comment in my code but feel free to do so.
-Nebula
Comments are printed like this.
Code:
<This is a comment!
Before you can do anything i must explain something to you. Before you call any functions you must set the correct directory first! Example: The directory you must set to print output onto the screen is directory (string).
Heres a code example:
Code:
set >> directory(string)
Code:
set >> directory(number)
In Phava you have to define functions before you can use them, which is printed like this.
Code:
define function >> (printf)
Then to use the function would be printed like this.
Code:
call function >>
Now here is a very simple "Hello, World!" program.
Code:
set >> directory (String) main() { define function >> (printf) call function >> printf ("Hello, World!") sleep "5000" }
Heres the code example:
Code:
set >> directory(string) set >> directory(number) main() define function >> (printf) define function >> (int) call function >> printf("Can you add 2+2?") call function >> int "2+2" = sum call function >> printf(sum) sleep "5000" }
In "Phava" here are the symbol meanings...
+ :Add
= :Equals
* :Multiply
/ :Divide
- :Subtract
Heres another program that envolves "input"
Code:
set >> directory(string) main() { define function >> (printf) define function >> (input) call function >> input = age("How old are you?") If age => 18 then call function >> printf("You are legally aloud to vote, congrats!") else call function >> printf("I'm sorry, you are not able to vote!") sleep "5000" }
Plz reply and tell me what you think. I did not comment in my code but feel free to do so.
-Nebula
Comment