mirror of
https://github.com/Open-Argon/Argon.git
synced 2026-10-28 09:43:38 +00:00
25f64a2eea113c20804c3bea3af7fb0b1ba9702b
Key Features of Argon
- easy to learn for new developers
- automatic type changing (e.g. INPUT:
'age: ' + 34OUTPUT:'age: 34') - boolean renamed from true and false to yes and no
- the syntax is very similar to python and javascript
- no floats and ints, only numbers
Examples
Hello world:
log("hello, world!")
Inputs:
input("name: ")
Variables:
const myConstant = "this can't change!"
var myVariable = "this can change!"
myOtherVariable = "this can also change!"
Addition:
const word1 = "hello"
const word2 = "world"
log(word1 + " " + word2)
If Statements:
const password = 'password123'
const guess = input('password: ')
if (password == guess) [
log('correct')
] else [
log('incorrect')
]
While Loops:
var i = 0
while (i <- 100) [
log(i)
i++
]
Logic (Boolean):
log("true is now", yes)
log("false is now", no)
log("none is now", unknown)
while (yes) [
log("Argon is EPIC!")
]
Items (Lists or Arrays):
[1, 2, 3]
const names = ["john", "joe", "bob"]
log(names[2])
Books (Dictionaries or Objects):
const user = {'name': "bob", 'age': 34, 'hobbies': ["Programming in Argon!", "Playing video games!"]}
log(user["name"])
Subs (Functions):
sub hello(username) [
return 'hello, ' + username + ', how are you?'
]
log(hello('bob'))
How do I run Argon?
Setup:
Run a file:
- make a file with the extention as
.arand put your Argon code inside that file - call the Argon executable with a parameter as the path to your
.arfile, (e.g.$ argon example)
Run the shell:
- run the Argon executable without any parameters, (e.g.
$ argon)
Languages
Python
99.9%
Batchfile
0.1%
