aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913
diff options
context:
space:
mode:
authorMatthew Strapp <msattr@gmail.com>2019-09-11 15:29:27 -0500
committerMatthew Strapp <msattr@gmail.com>2019-09-11 15:29:27 -0500
commit7b73c936cad0f343e391f79a145b172c536a79f3 (patch)
tree7315db5764dc47856df9102976c35e0802f48f9a /csci1913
parentStart lab (diff)
downloadhomework-7b73c936cad0f343e391f79a145b172c536a79f3.tar
homework-7b73c936cad0f343e391f79a145b172c536a79f3.tar.gz
homework-7b73c936cad0f343e391f79a145b172c536a79f3.tar.bz2
homework-7b73c936cad0f343e391f79a145b172c536a79f3.tar.lz
homework-7b73c936cad0f343e391f79a145b172c536a79f3.tar.xz
homework-7b73c936cad0f343e391f79a145b172c536a79f3.tar.zst
homework-7b73c936cad0f343e391f79a145b172c536a79f3.zip
Why do I even bother
Diffstat (limited to '')
-rw-r--r--csci1913/lab1/lab1_strap012.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/csci1913/lab1/lab1_strap012.py b/csci1913/lab1/lab1_strap012.py
index 43fd8ae..3873ba9 100644
--- a/csci1913/lab1/lab1_strap012.py
+++ b/csci1913/lab1/lab1_strap012.py
@@ -4,15 +4,28 @@ def op(exp):
return exp[1]
def right(exp):
return exp[2]
-def isInside(var, e):
- if left(e)==var or right(e)==var:
- return True
- else:
- return False
-
+def isInside(var, e):
+ if type(e) is tuple:
+ return isInside(var, left(e)) or isInside(var, right(e))
+ elif type(e) is str:
+ return var==e
+
+def solve(v, eqn):
+ if isInside(v, left(eqn)):
+ return solving(v, eqn)
+ elif isInside(v,right(eqn)):
+ #AHHHH
+ return 6
+ else:
+ return None
+def solving(v,q):
+ if v==q:
+ return q
+def solvingAdd(v,q):
+ print("Y")
#
# TESTS. Test the equation solver for CSci 1913 Lab 1.