A programming Language written in python. Runs file with extension as hit. Code In Place Submission
An educational aid for junior IT students for introduction of python.
Right now, no external modules are needed. You just need the Python programming language.
All you have to do is:
python execute.py <name-of-hit-file>You also have 2 other options:
hit <name-of-hit-file>./hit.sh <name-of-hit-file>I have an example.hit file in the root directory of this repository.
You can run it by running the following command in your terminal:
python execute.py example.hitor by using the other two options above: Windows, Mac or Linux.
The basic syntax for a Hit program is: name of function any arguments to be passed in to the function. That's a bit confusing. So for example, if you type say Hello, World!, say is the function and Hello, World! is the argument. To create a comment, use the # sign. For example: # This is a comment. It will be ignored by Hit.
The current functions for Hit are:
Description: Print to the console
Arguments:
- text: Text to print out to the console.
Example: say Hello, World!
Description: Creates a variable
Arguments:
- name: Variable name
- value: Variable value. Can be an existing variable or string.
Example: create_var test "This is a test"
Description: Creates a function
Arguments:
- name: Function name
Example:
create_function say_hello:
say "hello"
To execute a function:
# You just type the function's name
say_hello
Description: Imports a file into your current executing program.
Arguments:
- filename: The name of the file you want to import. Can end with .hit or not.
Example: import helloworld
Inside helloworld.hit, there is a function called testing_func. To run it, just type it in like usual.
import helloworld
testing_func
The import function will always import everything as of this commit.
Description: Runs a line of Python code in the Hit environment.
Arguments:
- query: The query that you want to run.
Example: run_python "print('Hello World!')"
This is meant for compatibility with Python.
For examples of all of these functions, consult the example.hit file.
Happy Coding !
