Skip to content

Commit 02528e1

Browse files
committed
Bug fixes
1 parent 089167e commit 02528e1

File tree

3 files changed

+13
-35
lines changed

3 files changed

+13
-35
lines changed

modules/Equations.py

+10-12
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,20 @@ def Ptgs(Opt):
3636
hip = round(u.sqrt((c1**2)+(c2**2)),s.FloatPrec)
3737
if Opt == '1': # Simples: calc raiz de hip
3838
print("c1 = ",c1,", c2 = ",c2,", hip = √")
39-
r = input()
4039
rs = (c1**2+c2**2)
41-
elif Opt == '2': # Normal: calcula hip
40+
elif Opt == '2': # Normal: calcula hip
4241
print("c1 = ",c1,", c2 = ",c2,", hip = ")
43-
r = input()
4442
rs = hip
43+
r = input()
4544
if u.CheckForFloat(r) == False:
4645
if r == 'exit': return 'exit'
4746
else: return 'Nula'
4847
else:
49-
if float(r) == rs:
48+
if float(r) == rs:
5049
print("Certo")
5150
return 'Certo'
52-
else:
53-
print("O certo seria ",rs)
51+
else:
52+
print("O certo seria ",rs,".")
5453
return 'Errado'
5554

5655
def BskrMenu():
@@ -88,10 +87,10 @@ def Bhaskara(Opt):
8887
r = input("Delta = ")
8988
if r == 'exit' and s.RCount == 0: return 'exit'
9089
if u.CheckForFloat(r) == False: l.append('Nula')
91-
elif r == Delta:
90+
elif float(r) == Delta: # P/ evitar diferença entre tipos de dados
9291
print("Certo")
9392
l.append('Certo')
94-
else:
93+
else:
9594
print("O correto seria ",Delta,".")
9695
l.append('Errado')
9796
elif Opt == '2':
@@ -101,12 +100,11 @@ def Bhaskara(Opt):
101100
for i in range(len(rs)):
102101
r = input(q[i]+" = ")
103102
if r == 'exit' and s.RCount == 0: return 'exit'
104-
if u.CheckForFloat(r) == False:
105-
l.append('Nula')
106-
elif r == rs[i]:
103+
if u.CheckForFloat(r) == False: l.append('Nula')
104+
elif float(r) == rs[i]:
107105
print("Certo")
108106
l.append('Certo')
109-
else:
107+
else:
110108
print("O correto seria ",rs[i],".")
111109
l.append('Errado')
112110
return l

modules/Functions.py

+2-22
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,10 @@ def QuadF():
3434
r = input(q[i]+" = ")
3535
if s.RCount == 0 and r == 'exit': return 'exit'
3636
if u.CheckForFloat(r) == False: l.append('Nula')
37-
elif r == rs[i]: # Caso certo
37+
elif float(r) == rs[i]:
3838
print("Certo")
3939
l.append('Certo')
40-
else: # Caso diferente
40+
else:
4141
print("O correto seria "+str(rs[i])+".")
4242
l.append('Errado')
4343
return l
44-
45-
def SimpleFMenu():
46-
u.clear()
47-
if u.MinSize() == True: u.ReadTxt((s.GameLogoPath+'function.txt')) # Mode logo
48-
else: print("< f(x) >")
49-
print("<'exit' para sair>")
50-
print("<Precisão de "+str(s.FloatPrec)+" decimal(is)>")
51-
while 1:
52-
if s.RCount == 0:
53-
Signal = SimpleF()
54-
if Signal == 'exit': return 0
55-
else:
56-
List = []
57-
for Count in range(s.RCount):
58-
List.insert(Count,SimpleF())
59-
print("-- Concluido --")
60-
for i in range(s.RCount):
61-
print(str((i+1))+" - "+', '.join(List[i]))
62-
u.getch()
63-
return 0

modules/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# # -*- encoding: utf-8 -*-
2-
# library for Mandrake | by vp1147
2+
# Library for Mandrake | by vp1147
33

44
# External libs
55
import os, math, sys

0 commit comments

Comments
 (0)