Skip to content

Instantly share code, notes, and snippets.

@TApplencourt
Created January 11, 2016 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TApplencourt/da9a3d2b34798efe0bf6 to your computer and use it in GitHub Desktop.
Save TApplencourt/da9a3d2b34798efe0bf6 to your computer and use it in GitHub Desktop.
For gamess programm, the order of primitive for the AO
def same_character(item1):
return item1==item1[0]* len(item1)
def compare_gamess_style(item1, item2):
if len(item1) < len(item2):
return -1
elif len(item1) > len(item2):
return 1
elif same_character(item1) and same_character(item2):
if item1 < item2:
return -1
else:
return 1
elif same_character(item1) and not same_character(item2):
return -1
elif not same_character(item1) and same_character(item2):
return 1
else:
return compare_gamess_style(item1[:-1],item2[:-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment