There is a condition that you declare a two-dimensional array and put a number in it. Horizontal, vertical, and diagonal all have to be 3*3 arrays with a sum of 15. I don't know the process of putting it in using random function.
You have only created the current array.
def Create_array():
array = [[0 for col in range(10)] for row in range(10)]
for i in range(10):
array[i][i] = 1
I think you're talking about the horse defense problem just by listening to the explanation of the problem. Check out the following links.
© 2024 OneMinuteCode. All rights reserved.