mirror of
https://github.com/Open-Argon/Argon.git
synced 2026-10-28 09:43:38 +00:00
README PLZZZZ!!!!1!11!!1!!!!1!
This commit is contained in:
1 parent
961f9c4e99
commit
99951bdf1f
1 file changed
+44
-24
@@ -16,36 +16,47 @@
|
||||
## Examples
|
||||
|
||||
Hello world:
|
||||
|
||||
```javascript
|
||||
log('hello, world!')
|
||||
log("hello, world!");
|
||||
```
|
||||
|
||||
Inputs:
|
||||
|
||||
```javascript
|
||||
input('name: ')
|
||||
input("name: ");
|
||||
```
|
||||
|
||||
Variables:
|
||||
|
||||
```javascript
|
||||
const myConstant = "this can't change!"
|
||||
var myVariable = "this can change!"
|
||||
myOtherVariable = "this can also change!"
|
||||
const myConstant = "this can't change!";
|
||||
var myVariable = "this can change!";
|
||||
myOtherVariable = "this can also change!";
|
||||
```
|
||||
|
||||
Addition:
|
||||
|
||||
```javascript
|
||||
const word1 = 'hello'
|
||||
const word2 = 'world'
|
||||
log(word1 + ' ' + word2)
|
||||
const word1 = "hello";
|
||||
const word2 = "world";
|
||||
log(word1 + " " + word2);
|
||||
```
|
||||
|
||||
If Statements:
|
||||
|
||||
```javascript
|
||||
const password = 'password123'
|
||||
const guess = input('password: ')
|
||||
if (password == guess) [
|
||||
log('correct')
|
||||
log('correct')
|
||||
] else [
|
||||
log('incorrect')
|
||||
]
|
||||
```
|
||||
|
||||
While Loops:
|
||||
|
||||
```javascript
|
||||
var i = 0
|
||||
while (i <- 100) [
|
||||
@@ -55,32 +66,38 @@ while (i <- 100) [
|
||||
```
|
||||
|
||||
Logic (Boolean):
|
||||
```javascript
|
||||
log('true is now', yes)
|
||||
log('false is now', no)
|
||||
log('none is now', unknown)
|
||||
|
||||
while (yes) [
|
||||
log('Argon is EPIC!')
|
||||
]
|
||||
```javascript
|
||||
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):
|
||||
```javascript
|
||||
[1, 2, 3]
|
||||
const names = ['john', 'joe', 'bob']
|
||||
|
||||
log(names[2])
|
||||
```javascript
|
||||
[1, 2, 3];
|
||||
const names = ["john", "joe", "bob"];
|
||||
|
||||
log(names[2]);
|
||||
```
|
||||
|
||||
Books (Dictionaries or Objects):
|
||||
```javascript
|
||||
const user = {'name': 'bob', 'age': 34, 'hobbies': ['Programming in Argon!', 'Playing video games!']}
|
||||
|
||||
log(user['name'])
|
||||
```javascript
|
||||
const user = {
|
||||
name: "bob",
|
||||
age: 34,
|
||||
hobbies: ["Programming in Argon!", "Playing video games!"],
|
||||
};
|
||||
|
||||
log(user["name"]);
|
||||
```
|
||||
|
||||
Subs (Functions):
|
||||
|
||||
```javascript
|
||||
sub hello(username) [
|
||||
return 'hello, ' + username + ', how are you?'
|
||||
@@ -91,11 +108,14 @@ log(hello('bob'))
|
||||
## How do I run Argon?
|
||||
|
||||
Setup:
|
||||
|
||||
- download the Argon executable for [Windows](https://github.com/Ugric/Argon/raw/main/dist/Windows/argon.exe), [MacOS](https://github.com/Ugric/Argon/raw/main/dist/macOS/argon) or [Linux](https://github.com/Ugric/Argon/raw/main/dist/Linux/argon)
|
||||
|
||||
Run a file:
|
||||
|
||||
- make a file with the extention as `.ar` and put your Argon code inside that file
|
||||
- call the Argon executable with a parameter as the path to your `.ar` file, (e.g. `$ argon example.ar`)
|
||||
- call the Argon executable with a parameter as the path to your `.ar` file, (e.g. `$ argon example`)
|
||||
|
||||
Run the shell:
|
||||
|
||||
- run the Argon executable without any parameters, (e.g. `$ argon`)
|
||||
Reference in new issue
Block a user