-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuccess_only_problems.py
170 lines (121 loc) · 4.78 KB
/
success_only_problems.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import math
import os
import sys
def print_prog(program):
for element in program:
print element
#maybe change this to make each list a file
def success_only():
inputfiles = ["C:/Users/livel/Desktop/Research/cat_best_programs.csv", "C:/Users/livel/Desktop/Research/fly_best_programs.csv"]
verbose = True
if(len(sys.argv) > 1):
verbose = False
all_programs = []
number_io = []
checksum = []
collatz_numbers = []
compare_string_lengths = []
count_odds = []
digits = []
double_letters = []
even_squares = []
for_loop_index = []
grade = []
last_index_of_zero = []
median = []
mirror_image = []
negative_to_zero = []
pig_latin = []
replace_space_with_newline = []
scrabble_score = []
small_or_large = []
smallest = []
string_differences = []
string_lengths_backwards = []
sum_of_squares = []
super_anagrams = []
syllables = []
vector_average = []
vectors_summed = []
wallis_pi = []
word_stats = []
x_word_lines = []
final = [all_programs, number_io, checksum, collatz_numbers, compare_string_lengths, count_odds, digits, double_letters, even_squares, for_loop_index, grade, last_index_of_zero, median, mirror_image, negative_to_zero, pig_latin, replace_space_with_newline, scrabble_score, small_or_large, smallest, string_differences, string_lengths_backwards, sum_of_squares, super_anagrams, syllables, vector_average, vectors_summed, wallis_pi, word_stats, x_word_lines]
prob = ""
for inputfile in inputfiles:
f = open(inputfile)
tags = []
for line in f:
#print line
if line[0] == "[":
prob = line[2:-3] #change this
#print prob
if line.startswith("Successful"):
#print line
print prob
program = line[:-1].split(",")[1:]
all_programs.append(program)
#print_prog(program)
if prob == "number-io":
number_io.append(program)
if prob == "checksum":
checksum.append(program)
if prob == "collatz-numbers":
collatz_numbers.append(program)
if prob == "compare-string-lengths":
compare_string_lengths.append(program)
if prob == "count-odds":
count_odds.append(program)
if prob == "digits":
digits.append(program)
if prob == "double-letters":
double_letters.append(program)
if prob == "even-squares":
even_squares.append(program)
if prob == "for-loop-index":
for_loop_index.append(program)
if prob == "grade":
grade.append(program)
if prob == "last-index-of-zero":
last_index_of_zero.append(program)
if prob == "median":
median.append(program)
if prob == "mirror-image":
mirror_image.append(program)
if prob == "negative-to-zero":
negative_to_zero.append(program)
if prob == "pig-latin":
pig_latin.append(program)
if prob == "replace-space-with-newline":
replace_space_with_newline.append(program)
if prob == "scrabble-score":
scrabble_score.append(program)
if prob == "small-or-large":
small_or_large.append(program)
if prob == "smallest":
smallest.append(program)
if prob == "string-differences":
string_differences.append(program)
if prob == "string-lengths-backwards":
string_lengths_backwards.append(program)
if prob == "sum-of-squares":
sum_of_squares.append(program)
if prob == "super-anagrams":
super_anagrams.append(program)
if prob == "syllables":
syllables.append(program)
if prob == "vector-average":
vector_average.append(program)
if prob == "vectors-summed":
vectors_summed.append(program)
if prob == "wallis-pi":
wallis_pi.append(program)
if prob == "word-stats":
word_stats.append(program)
if prob == "x-word-lines":
x_word_lines.append(program)
return final
def main():
categorized_programs = success_only()
if __name__ == '__main__':
main()