Skip to content

Commit

Permalink
a lot
Browse files Browse the repository at this point in the history
  • Loading branch information
hg0428 committed Sep 3, 2020
1 parent 13f5bb7 commit c8f7a40
Show file tree
Hide file tree
Showing 24 changed files with 192 additions and 730 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ To get started with your first output do: `output('hello world!\n')`. There you

## Running Files
To run files all you need to do is run `#include file-to-run` this imports all aspects of a file and runs them directly to the terminal.
[![Run on Repl.it](https://repl.it/badge/github/hg0428/Aardvark)](https://repl.it/github/hg0428/Aardvark)
Binary file added __pycache__/Aardvark.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/File.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/boolean.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/dictionaries.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/list.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/none.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/number.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/stringtype.cpython-38.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion db.json
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
{"data": "is cool"},{"key": "data"}{"ayy": "cool"}{"key": "abc"}{"key": "some db value"}
18 changes: 10 additions & 8 deletions db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
from Aardvark import *
import json

data = open('db.json').read()

@Aardvark.function('addKey')
def add(name, key, value, file='db.json'):
data = {}
try:
data = eval(open(file).read())
except:
error("JSONError", 0, f"addKey({key}, {value}, {file})", "The specified file is not in a valid format.")
data[f'{key}'] = f'{value}'
json_data = json.dumps(data)
with open(file, 'a') as database:
with open(file, 'w+') as database:
database.write(json_data)
print(f'Data stored!\nData: {json_data}')

@Aardvark.function('loadData')
def loadData(name):
def loadData(name, file="db.json"):
data=open(file).read()
print('Data:\n' + data)
return data
'''
data['key'] = 'value'
json_data = json.dumps(data)
'''

#i want the user to be able to choose if they want a different file, okay cool. so it defaults to db.json
#Yes
16 changes: 0 additions & 16 deletions example.adk

This file was deleted.

7 changes: 7 additions & 0 deletions f.adk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include anr
funct foo() {
if 1 == 1 {
output('1')
}
}
foo()
8 changes: 5 additions & 3 deletions fib.adk
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ funct Fib(n) {
if number(n) < 0 {
output('invalid input')
}

if number(n) == 1 {
return 0
}

if number(n) == 2 {
return 1
}

if number(n) > 2 {
n=number(n)
x=Fib(n-2)
a=Fib(n-1)
return a+x
}
}
a = input("Enter a number to do Fib on: ")

output(Fib(a))
a = fib(30)
output(a)
7 changes: 7 additions & 0 deletions iffunc.adk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
funct myF() {
if 1==1 {
output('e')
}
}

myF()
Binary file added language/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
95 changes: 0 additions & 95 deletions nlp.py

This file was deleted.

0 comments on commit c8f7a40

Please sign in to comment.