From: Mart Lubbers Date: Sun, 1 Feb 2015 22:25:54 +0000 (+0100) Subject: test thing X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=29cbce9e43569f9530a3da95af8edc81d73c4cad;p=sws1-1415.git test thing --- diff --git a/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c b/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c index 3395d89..eee156f 100644 --- a/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c +++ b/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c @@ -25,21 +25,16 @@ int main(int argc, char* argv[]) { if(c == '\n') { - if(charsperline != 100) + if(charsperline != 100 || numlines > 500) return -1; numlines += 1; charsperline = 0; } else { - if(c == 'A') - occs[0] += 1; - else if(c == 'C') - occs[1] += 1; - else if(c == 'G') - occs[2] += 1; - else if(c == 'T') - occs[3] += 1; +/* Fancy polynome that translates A: 0, C: 1, G: 2, T: 3 */ + if(c == 'A' || c == 'C' || c == 'G' || c == 'T') + occs[(int)(.001657140781*c*c*c-0.3780662484*c*c+28.74757194*c-726.3545635)] += 1; else return -1; charsperline += 1;