Python - Tablero ajedrez

 
Vista:

Tablero ajedrez

Publicado por Geomata (21 intervenciones) el 12/01/2021 09:44:50
Tablero de ajedrez

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import skimage.io as io
 
import numpy as np
 
import matplotlib.pyplot as plt
 
tablero = np.zeros((8,8))
 
plt.matshow(tablero,cmap='gray')
 
print (tablero.shape, tablero.dtype)
 
tablero[::2,1::2]=1
 
plt.matshow(tablero,cmap='gray')
 
tablero[1::2,::2]=1
 
plt.matshow(tablero,cmap='gray')

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder