bf17 icon

Chess board total piece influence

bf17 | PRO | 11/11/25 04:52:25 AM UTC | 0 ⭐ | 10521 👁️ | Never ⏰ | []
Python |

4.91 KB

|

None

|

0 👍

/

0 👎

#pythonista 3
#chess engine based on piece influence
 
from array import array
 
n = 9
m = ""    #move string
#         0123456789012"
pieces = ".prnbqkPRNBQK"
adj = 0
x = y = 0
 
board = array('B')
board = [[0] * n for i in range(n)]
inf   = array('B')
inf   = [[0] * n for i in range(n+1)]
 
#king influence field
kf = [[-1,-1],[ 0,-1],[ 1,-1],
      [-1, 0],        [ 1, 0],
      [-1, 1],[ 0, 1],[ 1, 1]]
 
nf = [[-1,-2],[ 1,-2],
      [-2,-1],[ 2,-1],
      [-2, 1],[ 2, 1],
      [-1, 2],[ 1, 2]]
 
'''
#test board
board[8] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# R  8 - 2
board[7] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# N  9 - 3
board[6] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# B 10 - 4
board[5] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# Q 11 - 5
board[4] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# K 12 - 6
board[3] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# P  7 - 1
board[2] = [0, 0, 0, 0, 0, 0, 0, 0, 0]
board[1] = [0, 0, 0, 0, 0, 0, 0, 0, 0]
#              1  2  3  4  5  6  7  8
'''
 
#standard board                            W   B
board[8] = [0, 2, 3, 4, 5, 6, 4, 3, 2]# R  8 - 2
board[7] = [0, 1, 1, 1, 1, 1, 1, 1, 1]# N  9 - 3
board[6] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# B 10 - 4
board[5] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# Q 11 - 5
board[4] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# K 12 - 6
board[3] = [0, 0, 0, 0, 0, 0, 0, 0, 0]# P  7 - 1
board[2] = [0, 7, 7, 7, 7, 7, 7, 7, 7]
board[1] = [0, 8, 9,10,11,12,10, 9, 8]
 
def on(h,v): # on board
    return(int((h>0) and (h<9) and (v>0) and (v<9)))
 
def enter_move(m):
    m = input(":    ")
    if(len(m)==3):
        board[int(m[2])][int(m[1])] = pieces.find(m[0])
    if(len(m)==4):
        board[int(m[3])][int(m[2])] = board[int(m[1])][int(m[0])]
        board[int(m[1])][int(m[0])] = 0
 
def move_gen():
    pass
 
def disp_ascii(): # print out ascii representation
    print("\n          ascii board")
    for j in range(1,n):
        print(n-j,"| ", end="")
        for i in range(1,n):
            print(pieces[board[9-j][i]], end = "  ")
        print()
    print("  ","-"*22)
    print("    1  2  3  4  5  6  7  8")
 
def disp_board():#debug - display numeric board
    print("\n         numeric board")
    for j in range(1,n):
        for i in range(1,n):
            print("%02d" % board[9-j][i], end = " ")
        print()
        
def disp_inf():#debug - display numeric board
    print("\n           influence")
    for j in range(1,n):
        print(n-j,"| ", end="")
        for i in range(1,n):
            print("%02d" % inf[9-j][i], end = " ")
        print()
    print("  ","-"*22)
    print("    1  2  3  4  5  6  7  8")
    print("\ntotal influence: ", sum(sum(inf,[])))
 
def calc_inf():
#this part uses the on() function
#reset influence array
    for j in range(n):
        for i in range(n):
            inf[i][j] = 0
        total_inf = 0
 
    for j in range(1,n):
        for i in range(1,n):
            if(board[i][j]==12 or board[i][j]==6):#kings
                adj=int(board[i][j]==12) or int(not(board[i][j]==6))-1
                for w in range(len(kf)):# k-king
                    if(on(i+kf[w][0],j+kf[w][1])):inf[i+kf[w][0]][j+kf[w][1]]+=adj
 
            if(board[i][j]==9 or board[i][j]==3):#knights
                adj=int(board[i][j]==9) or int(not(board[i][j]==3))-1
                for w in range(len(nf)):# k-king
                    if(on(i+nf[w][0],j+nf[w][1])):inf[i+nf[w][0]][j+nf[w][1]]+=adj
 
            if(board[i][j]==7):#white pawn
                adj=1
                if(on(i+1,j-1)):inf[i+1][j-1]+=adj
                if(on(i+1,j+1)):inf[i+1][j+1]+=adj
                
            if(board[i][j]==1):#black pawn
                adj=-1
                if(on(i-1,j-1)):inf[i-1][j-1]+=adj
                if(on(i-1,j+1)):inf[i-1][j+1]+=adj
                
            if(board[i][j]==8 or board[i][j]==2):#rooks
                adj=int(board[i][j]==8) or int(not(board[i][j]==2))-1
                for w in range(-7,8):
                    if(on(i,j+w)):inf[i][j+w]+=adj
                    if(on(i+w,j)):inf[i+w][j]+=adj
                inf[i][j]-=2*adj
 
            if(board[i][j]==10 or board[i][j]==4):#bishops
                adj=int(board[i][j]==10) or int(not(board[i][j]==4))-1
                for w in range(-7,8):
                    if(on(i+w,j+w)):inf[i+w][j+w]+=adj
                    if(on(i+w,j-w)):inf[i+w][j-w]+=adj
                inf[i][j]-=2*adj
 
            if(board[i][j]==11 or board[i][j]==5):#queens
                adj=int(board[i][j]==11) or int(not(board[i][j]==5))-1
                for w in range(-7,8):
                    if(on(i,j+w)):inf[i][j+w]+=adj     #rook part
                    if(on(i+w,j)):inf[i+w][j]+=adj
                    if(on(i+w,j+w)):inf[i+w][j+w]+=adj #bishop part
                    if(on(i+w,j-w)):inf[i+w][j-w]+=adj
                inf[i][j]-=4*adj
 
calc_inf()
disp_inf()
disp_ascii()
while(True):
    enter_move(m)
    calc_inf()
    disp_inf()
    disp_ascii()
#    disp_board()

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Venzetis icon
    03/30/26 01:51:16 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎