~cpp 
def xorTriangle(current, lineNum, list):
    newList = []
    for i in range(0, current) :
        if i==0 or i==current-1 :
            newList.append(1)
        else :
            newList.append( list[i-1]^list[i] )
            
    print newList
    
    if current<lineNum:
        xorTriangle(current+1, lineNum, newList)
    else :
        return

xorTriangle(1, 8, list)


Retrieved from http://wiki.zeropage.org/wiki.php/XOR삼각형/임인택
last modified 2021-02-07 05:28:27