Skip to content
Snippets Groups Projects
Commit f3f88346 authored by scschwa's avatar scschwa
Browse files

test

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #
File added
I love algorithms! Analyzing algorithmic complexities is my favorite field of CS.
This is a file with only one use of the word algorithm.
I hate algorithms!
I dislike algorithms so much that I have written this treatise against algorithms.
proj 0 → 100755
File added
int main(){
return 0;
}
import subprocess
try:
subprocess.call(["gcc","proj.cpp", "-o","proj"])
subprocess.check_call(["gcc","proj.cpp", "-o","proj"])
a = subprocess.check_output(["ls"])
test_files= []
for line in a.split("\n"):
if 'test' in line and '.cpp' in line:
test_files.append(line)
worked = 0
failed = 0
for line in test_files:
output = line.split(".")[0]
subprocess.check_call(["gcc",line, "-o",output])
ret = subprocess.call(["./"+output])
if ret == 0:
worked = worked+1
else:
failed = failed +1
print(worked, " files succeesed and", failed, " files failed")
except subprocess.CalledProcessError:
print("Compilation error")
run.py 0 → 100644
import glob
import topic_part2
searcher = topic_part2.Searcher()
for filename in searcher.search('algorithm', 2, glob.glob('*.txt')):
print(filename)
test_five 0 → 100755
File added
int main(){
return 1;
}
test_four 0 → 100755
File added
int main(){
return 6;
}
test_one 0 → 100755
File added
int main(){
return 0;
}
File added
int main(){
return 1;
}
test_two 0 → 100755
File added
int main(){
return 0;
}
topic.py 0 → 100644
import sys
num = len(sys.argv)
word_we_want = sys.argv[1]
amount = sys.argv[2]
files = sys.argv[3:num]
for x in files:
i = 0
with open(x,'r') as openfile:
for line in openfile:
for word in line.split():
if word_we_want in word:
i= i+1
if int(amount) <= i:
print x
openfile.close()
topic.pyc 0 → 100644
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment