Skip to content

Commit be3de39

Browse files
committed
codons should be in 3s, not overlapping
1 parent 626eb0f commit be3de39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CCSPiJ/src/chapter2/Gene.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public int compareTo(Codon other) {
4949
private ArrayList<Codon> codons = new ArrayList<>();
5050

5151
public Gene(String geneStr) {
52-
for (int i = 0; i < geneStr.length() - 3; i++) {
52+
for (int i = 0; i < geneStr.length() - 3; i += 3) {
5353
// Take every 3 characters in the String and form a Codon
5454
codons.add(new Codon(geneStr.substring(i, i + 3)));
5555
}

0 commit comments

Comments
 (0)