Skip to content

Commit

Permalink
dear god
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua committed Dec 13, 2019
1 parent aed8aab commit c6f9195
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 11 deletions.
5 changes: 4 additions & 1 deletion lilypond/attempt2/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ def __repr__(self):

# Consider producing graphs that show the distribution of radii pyplot.hist
def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

n = 0
grains = []
dimX, dimY, dimT = (math.inf, -math.inf), (math.inf, -math.inf), (0, 0)
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), \
Expand Down
5 changes: 4 additions & 1 deletion lilypond/attempt2/approxlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __repr__(self):
# Consider producing graphs that show the distribution of radii pyplot.hist
def main():
""" This is the main function """
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

n = 0
grains = []
Expand All @@ -91,6 +91,9 @@ def main():
dimX, dimY = (math.inf, -math.inf), (math.inf, -math.inf)
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), \
Expand Down
6 changes: 4 additions & 2 deletions lilypond/attempt2/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ def __repr__(self):
return "%f,%f,%f,%f,%f,%d" % (self.x, self.y, self.t, self.v, self.r, self.i)

def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

dupCircle = Circle(-11.0,1.0,0,0,0,0)
circles = set()
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = round(float(x)), round(float(y)), \
Expand Down
5 changes: 4 additions & 1 deletion lilypond/attempt2/samebirth.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ def __repr__(self):
return "%f,%f,%f,%f,%f,%d" % (self.x, self.y, self.t, self.v, self.r, self.i)

def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

circles = []
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), \
Expand Down
5 changes: 4 additions & 1 deletion lilypond/attempt2/samegrowth.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ def __repr__(self):
return "%f,%f,%f,%f,%f,%d" % (self.x, self.y, self.t, self.v, self.r, self.i)

def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

circles = []
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), \
Expand Down
5 changes: 4 additions & 1 deletion lilypond/attempt2/sameradius.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ def __repr__(self):
return "%f,%f,%f,%f,%f,%d" % (self.x, self.y, self.t, self.v, self.r, self.i)

def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

circles = set()
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), \
Expand Down
5 changes: 4 additions & 1 deletion lilypond/attempt2/savevisual.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ def __repr__(self):
% (self.id, *self.xy, self.t, self.v, self.r, self.i)

def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

circles = []
dimX, dimY, dimT = (math.inf, -math.inf), (math.inf, -math.inf), (0, 0)
n = 0 # this is the index of the next circle
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), abs(float(t)), abs(float(v)), abs(float(r)), abs(int(i))
Expand Down
Binary file modified lilypond/attempt2/solvelp
Binary file not shown.
2 changes: 1 addition & 1 deletion lilypond/attempt2/solvelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void solve(int argc, char **argv) {
}

for (int i = 0; i < 10; i++) {
putchar('-');
putchar('X');
}
putchar('\n');

Expand Down
5 changes: 4 additions & 1 deletion lilypond/attempt2/staticvisualiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ def __repr__(self):
% (self.id, *self.xy, self.t, self.v, self.r, self.i)

def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

circles = []
dimX, dimY, dimT = (math.inf, -math.inf), (math.inf, -math.inf), (0, 0)
n = 0 # this is the index of the next circle
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), abs(float(t)), abs(float(v)), abs(float(r)), abs(int(i))
Expand Down
5 changes: 4 additions & 1 deletion lilypond/attempt2/visualiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ def __repr__(self):
% (self.id, *self.xy, self.t, self.v, self.r, self.i)

def main():
reader = csv.reader(row for row in fileinput.input() if not row.startswith("#"))
reader = csv.reader(row for row in fileinput.input() if not row.startswith('#'))

circles = []
dimX, dimY, dimT = (math.inf, -math.inf), (math.inf, -math.inf), (0, 0)
n = 0 # this is the index of the next circle
try: # parsing
for row in reader:
# Alphabet characters are used to halt parsing
if row[0].isalpha():
break
x, y, t, v, r, i = row # see example.lp for these values
# perform a very forgiving parse of the file
x, y, t, v, r, i = float(x), float(y), abs(float(t)), abs(float(v)), abs(float(r)), abs(int(i))
Expand Down

0 comments on commit c6f9195

Please sign in to comment.