From 216596c828f92324e5d2e1bd8bb5087cd266d547 Mon Sep 17 00:00:00 2001
From: "Nazim@misirlou" <nazim@internet.gestell>
Date: Sun, 23 Mar 2025 22:13:48 +0100
Subject: [PATCH] nzm

---
 p-endogamousDiploid/.gitignore       |  1 +
 p-endogamousDiploid/enumerateEndo.py | 51 +++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 4 deletions(-)
 create mode 100644 p-endogamousDiploid/.gitignore

diff --git a/p-endogamousDiploid/.gitignore b/p-endogamousDiploid/.gitignore
new file mode 100644
index 0000000..70ec196
--- /dev/null
+++ b/p-endogamousDiploid/.gitignore
@@ -0,0 +1 @@
+user.properties
diff --git a/p-endogamousDiploid/enumerateEndo.py b/p-endogamousDiploid/enumerateEndo.py
index f87109a..41efbc9 100644
--- a/p-endogamousDiploid/enumerateEndo.py
+++ b/p-endogamousDiploid/enumerateEndo.py
@@ -2,7 +2,7 @@ import sys
 
 
 TCODE=['A','B','C','D','E','F','G','H']
-TINDX=[0  , 1 , 4,  5,  2, 3, 6, 7]
+TINDX=[0  , 1 , 4 ,  5,  2,  3,  6, 7 ]
 
 NRULE=256
 REFLECTION=[0,4,2,6,1,5,3,7]
@@ -65,8 +65,9 @@ def exportList():
 
 #transECA(213)
 
-def transtionTabTcode(tcodef, tcodeg):
+def transtionTabTcode(tcodepair):
     """ transition table of the diploid in the T-code mode"""
+    (tcodef, tcodeg)=tcodepair
     tabtcode="["
     for i in range(8):
         ch= TCODE[i]
@@ -91,11 +92,53 @@ def run():
     exportList()
 
 def xcmd():
-    scanSpace()
+    
     for couple in CLIST:
         tabf,tabg=wcodeToTransitionTable(couple[0]),wcodeToTransitionTable(couple[1])
         tcodef,tcodeg=Tcode(tabf),Tcode(tabg)
         ttab=transtionTabTcode(tcodef, tcodeg)
         print("\\tabEndo{%d}{%d}{%s}{%s}{%s}\\\\"%(couple[0], couple[1], tcodef, tcodeg, ttab))
 
-xcmd()
\ No newline at end of file
+def pres(tcodepair, ch):
+    return ch in tcodepair[0] or ch in tcodepair[1]
+
+def filterZeroOnlyFP():
+    print("looking for ZERO.FP")
+    for couple in CLIST:
+        tabf,tabg=wcodeToTransitionTable(couple[0]),wcodeToTransitionTable(couple[1])
+        tcodepair=(Tcode(tabf),Tcode(tabg))
+        strttab=transtionTabTcode(tcodepair)
+        ttab=strttab.replace("[","").replace("]","").split(",")
+        #if ttab[0]=='0':
+        condA=pres(tcodepair, 'A')
+        condH=pres(tcodepair, 'H')
+        condDE=pres(tcodepair, 'D') or pres(tcodepair, 'E')
+        condBEC=pres(tcodepair, 'B') or pres(tcodepair, 'E') or pres(tcodepair, 'C')
+        condGDF=pres(tcodepair, 'G') or pres(tcodepair, 'D') or pres(tcodepair, 'F')
+        condBFGC=pres(tcodepair, 'B') or pres(tcodepair, 'F') or pres(tcodepair, 'G') or pres(tcodepair, 'C')
+        wordfp=""
+        if not condA:
+            wordfp+="a"
+        if not condH:
+            wordfp+="b"
+        if not condDE:
+            wordfp+="c"
+        if not condBEC:
+            wordfp+="d"
+        if not condGDF:
+            wordfp+="e"
+        if not condBFGC:
+            wordfp+="f"
+        if wordfp=="":
+            wordfp="n"                
+        print("wFP:%s  %3d-%3d %s,%s   %s"%(wordfp, couple[0], couple[1], tcodepair[0], tcodepair[1], strttab))
+        #if not condA and condH and condDE and condBEC and condGDF and condBFGC:
+        #    print("ZFP:%s  %d-%d %s,%s   %s"%(ttab[1], couple[0], couple[1], tcodepair[0], tcodepair[1], strttab))
+        
+
+
+
+
+scanSpace()
+#xcmd()
+filterZeroOnlyFP()
-- 
GitLab