Skip to content

Commit d4f5983

Browse files
committed
0.0.1a8
1 parent 1bd36b1 commit d4f5983

File tree

88 files changed

+818
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+818
-154
lines changed

build/lib/eggdriver/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from eggdriver.resources.console import get, clearConsole, pg
2-
from eggdriver.resources.constants import *
2+
from eggdriver.resources.constants import white
33
from eggdriver.resources.modules import installFromRequests, upgrade, Repo
44
from eggdriver.resources.help import help
55
from eggdriver.resources.auth import login, register
@@ -29,7 +29,7 @@
2929
def eggConsole(condition: bool = True):
3030
"""Display the Egg Console"""
3131
print(white + "Egg Console is now running")
32-
logged=0
32+
logged = 0
3333
while condition:
3434
i = get("egg")
3535
if i == "$nqs":

build/lib/eggdriver/resources/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from eggdriver.resources.strings import *
1111
from eggdriver.resources.utils import *
1212
from eggdriver.resources.web import *
13-
from eggdriver.resources.algorithms import *
13+
from eggdriver.resources.math import *
1414

1515
author="eanorambuena"
1616
author_email="[email protected]"

build/lib/eggdriver/resources/console/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from eggdriver.resources.console.display import *
22
from eggdriver.resources.console.progress import *
3+
from eggdriver.resources.constants import white, blue, green
34

45
def get(tag: str):
56
i = input(blue + "$" + tag + "> " + green)

build/lib/eggdriver/resources/console/display.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import time, os, sys, subprocess
2-
from eggdriver.resources.constants import *
32

4-
def sleep(i: int =100):
3+
def sleep(i: int = 100):
54
time.sleep(i/1000)
65

76
def clearConsole():
@@ -18,7 +17,8 @@ def display(T, delta: int = 400, condition: bool = True):
1817

1918
def sysCommand(command: str):
2019
commands = command.split()
21-
temp = commands.reverse()
22-
temp.append(sys.executable)
23-
commands = temp.reverse()
20+
commands.reverse()
21+
# commands.append(sys.executable) Not works yet, instead:
22+
commands.append("py") # Just on Windows
23+
commands.reverse()
2424
subprocess.check_call(commands)
Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
from eggdriver.resources.utils import colour
22

3-
BLACK=30
4-
RED=31
5-
GREEN=32
6-
YELLOW=33
7-
BLUE=34
8-
PURPLE=35
9-
CYAN=36
10-
WHITE=37
3+
BLACK = 30
4+
RED = 31
5+
GREEN = 32
6+
YELLOW = 33
7+
BLUE = 34
8+
PURPLE = 35
9+
CYAN = 36
10+
WHITE = 37
1111

12-
black=colour(BLACK)
13-
red=colour(RED)
14-
green=colour(GREEN)
15-
yellow=colour(YELLOW)
16-
blue=colour(BLUE)
17-
purple=colour(PURPLE)
18-
cyan=colour(CYAN)
19-
white=colour(WHITE)
12+
black = colour(BLACK)
13+
red = colour(RED)
14+
green = colour(GREEN)
15+
yellow = colour(YELLOW)
16+
blue = colour(BLUE)
17+
purple = colour(PURPLE)
18+
cyan = colour(CYAN)
19+
white = colour(WHITE)
2020

2121
segment = "█"
2222
whiteSegment = "█"
@@ -26,7 +26,4 @@
2626

2727
square = 2 * segment
2828
whiteSquare = white + square
29-
blackSquare = black + square
30-
31-
inf = 1000000
32-
R = [-inf, inf]
29+
blackSquare = black + square
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from eggdriver.resources.math.algorithms import *
2+
from eggdriver.resources.math.theoric import *
3+
from eggdriver.resources.math.float import *
4+
from eggdriver.resources.math.functions import *
5+
from eggdriver.resources.math.linear import *
6+
from eggdriver.resources.math.polynomial import *
7+
from eggdriver.resources.math.constants import *
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from eggdriver.resources.math.algorithms.solver import *
2+
from eggdriver.resources.math.algorithms.limit import *
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from eggdriver.resources.math.constants import inf
2+
from eggdriver.resources.math.theoric import positiveInfinity, negativeInfinity, undefined
3+
4+
def lim(f, value):
5+
zero = 1 / inf
6+
below = f(value - zero)
7+
above = f(value + zero)
8+
if -zero <= below - above <= zero:
9+
result = (below + above) / 2
10+
else:
11+
return undefined.value
12+
if result >= inf:
13+
return positiveInfinity.value
14+
elif result <= -inf:
15+
return negativeInfinity.value
16+
elif -zero <= result <= zero:
17+
return 0
18+
return result
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from eggdriver.resources.structures.lists import Set
2+
from eggdriver.resources.math.algorithms.solver.dichotomy import root
3+
from eggdriver.resources.math.constants import R, inf
4+
5+
def solve(function, bias = 0, domain = R, accurancy = 16, degree = 1, alerts = True):
6+
roots = Set()
7+
count = 0
8+
customDomain = domain != R
9+
while roots.size < degree and count < inf:
10+
if not customDomain:
11+
domain = [- 2.0 ** int(count), 2.0 ** int(count)]
12+
r = root(function, -bias, domain, accurancy)
13+
roots.insert(str(r))
14+
if alerts:
15+
print(degree - roots.size, "solutions remaining")
16+
count += 1 / (2 * degree)
17+
return roots
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import random
2+
from eggdriver.resources.math.constants import R
3+
from eggdriver.resources.math.float import truncate
4+
5+
def root(function, bias = 0, domain = R, accurancy = 16):
6+
"""Gives a root of function(x) = bias, in a certain domain"""
7+
error = 10 ** (- accurancy - 100)
8+
while True:
9+
bound = [random.uniform(domain[0], domain[1]), random.uniform(domain[0], domain[1])]
10+
bound.sort()
11+
a, b = bound[0], bound[1]
12+
fa = function(a) - bias
13+
fb = function(b) - bias
14+
if fa * fb < 0:
15+
break
16+
for i in range(100):
17+
mean = (a + b) / 2
18+
fm = function(mean) - bias
19+
if abs(fm) < error:
20+
return round(mean, accurancy)
21+
if fa * fm < 0:
22+
b = mean
23+
else:
24+
a = mean
25+
return "There is not a root in this domain"

0 commit comments

Comments
 (0)