Cleaning up complex if statements for Chess game
You can enhance the readability by extracting the conditons of your ifs to functions without chanceing the performance. Plus you can remove your duplicate code like positon.x +1 &lt; 8