summaryrefslogtreecommitdiff
path: root/comp/work/47
diff options
context:
space:
mode:
Diffstat (limited to 'comp/work/47')
-rw-r--r--comp/work/47/flatten.py10
-rw-r--r--comp/work/47/ispal.py5
-rw-r--r--comp/work/47/matrix17
3 files changed, 32 insertions, 0 deletions
diff --git a/comp/work/47/flatten.py b/comp/work/47/flatten.py
new file mode 100644
index 0000000..2e1958c
--- /dev/null
+++ b/comp/work/47/flatten.py
@@ -0,0 +1,10 @@
+def flatten(l):
+ out = []
+ for i in l:
+ if hasattr(i, "__len__"):
+ for j in flatten(i): out.append(j)
+ else: out.append(i)
+
+ return out
+
+print(flatten([1, [[4, 6], 5], 2]))
diff --git a/comp/work/47/ispal.py b/comp/work/47/ispal.py
new file mode 100644
index 0000000..92111a4
--- /dev/null
+++ b/comp/work/47/ispal.py
@@ -0,0 +1,5 @@
+def ispal(word):
+ if word[::-1] == word: return True;
+ else: return False
+
+print(ispal("racecar"))
diff --git a/comp/work/47/matrix b/comp/work/47/matrix
new file mode 100644
index 0000000..3569f93
--- /dev/null
+++ b/comp/work/47/matrix
@@ -0,0 +1,17 @@
+0 5 1
+1 6 2
+2 10 5
+5 2 0
+5 7 4
+4 12 7
+4 5 6
+6 5 4
+5 4 3
+2 3 3
+each node has at most 2 child nodes, the nodes are unweighted and directional
+mouse -> fox -> cat -> dog
+mouse -> fox -> goat
+but can yours work on a reciet role
+ed was made for running on paper teletypes
+and all of original unix was made with it
+emacs wasnt a thing until 85