八宫相逢数之计算

import numpy as np x1 = [1,2,3,4,5,6,7,8,9]; x2 = [1,8,3,4,9,2,7,6]; star = [1,26,3,4,45,38,7,24]; yuandan=[0,1,2,3,-1,5,7,8,9] pos1 = 0; pos2 = x2.index(x1[pos1]) for i in range(0,72): #九宫位置 pos3 = x1[(i+pos1)%9] pos4 = x2[(i+pos2)%8] # print (pos3,end=’,’) # print (pos4) if pos3==pos4: yuandan[pos3-1] = i+1 for index in range(1,9): pos1 = index if pos1==4: continue pos2 = x2.index(index+1) … 阅读全文 八宫相逢数之计算