Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rewrite rule to be more general.
  • Loading branch information
johnmay committed Apr 25, 2017
1 parent c5d8f92 commit c4aeb0e
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -498,8 +498,14 @@ boolean hasPriority(int focus, int i, int j) {
int jElem = jAtom.getAtomicNumber();

// rank carbon's last
if (iElem == 6 && iDegree >= jDegree) iElem = 256;
if (jElem == 6 && jDegree >= iDegree) jElem = 256;
if (iElem == 6) iElem = 256;
if (jElem == 6) jElem = 256;

// terminal atoms are always best
if (iDegree == 1 && jDegree > 1)
return true;
if (jDegree == 1 && iDegree > 1)
return false;

// prioritise by atomic number, H < N < O < ... < C
if (iElem < jElem)
Expand Down

0 comments on commit c4aeb0e

Please sign in to comment.