import numpy as np
import matplotlib.pyplot as plt
from skimage import data,io,filters
A=np.zeros((8,8))
A[0,0]=187
A[0,2]=187
A[0,4]=187
A[0,6]=187
A[0,1]=255
A[0,3]=255
A[0,5]=255
A[0,7]=255
A[1,0]=255
A[1,2]=255
A[1,4]=255
A[1,6]=255
A[1,1]=187
A[1,3]=187
A[1,5]=187
A[1,7]=187
A[2,0]=187
A[2,2]=187
A[2,4]=187
A[2,6]=187
A[2,1]=255
A[2,3]=255
A[2,5]=255
A[2,7]=255
A[3,1]=187
A[3,3]=187
A[3,5]=187
A[3,7]=187
A[3,0]=255
A[3,2]=255
A[3,4]=255
A[3,6]=255
A[4,0]=187
A[4,2]=187
A[4,4]=187
A[4,6]=187
A[4,1]=255
A[4,3]=255
A[4,5]=255
A[4,7]=255
A[5,0]=255
A[5,2]=255
A[5,4]=255
A[5,6]=255
A[5,1]=187
A[5,3]=187
A[5,5]=187
A[5,7]=187
A[6,0]=187
A[6,2]=187
A[6,4]=187
A[6,6]=187
A[6,1]=255
A[6,3]=255
A[6,5]=255
A[6,7]=255
A[7,0]=255
A[7,2]=255
A[7,4]=255
A[7,6]=255
A[7,1]=187
A[7,3]=187
A[7,5]=187
A[7,7]=187
print A
print "satranç tahtası"
io.imshow(A,cmap="gray")
io.show()
import matplotlib.pyplot as plt
from skimage import data,io,filters
A=np.zeros((8,8))
A[0,0]=187
A[0,2]=187
A[0,4]=187
A[0,6]=187
A[0,1]=255
A[0,3]=255
A[0,5]=255
A[0,7]=255
A[1,0]=255
A[1,2]=255
A[1,4]=255
A[1,6]=255
A[1,1]=187
A[1,3]=187
A[1,5]=187
A[1,7]=187
A[2,0]=187
A[2,2]=187
A[2,4]=187
A[2,6]=187
A[2,1]=255
A[2,3]=255
A[2,5]=255
A[2,7]=255
A[3,1]=187
A[3,3]=187
A[3,5]=187
A[3,7]=187
A[3,0]=255
A[3,2]=255
A[3,4]=255
A[3,6]=255
A[4,0]=187
A[4,2]=187
A[4,4]=187
A[4,6]=187
A[4,1]=255
A[4,3]=255
A[4,5]=255
A[4,7]=255
A[5,0]=255
A[5,2]=255
A[5,4]=255
A[5,6]=255
A[5,1]=187
A[5,3]=187
A[5,5]=187
A[5,7]=187
A[6,0]=187
A[6,2]=187
A[6,4]=187
A[6,6]=187
A[6,1]=255
A[6,3]=255
A[6,5]=255
A[6,7]=255
A[7,0]=255
A[7,2]=255
A[7,4]=255
A[7,6]=255
A[7,1]=187
A[7,3]=187
A[7,5]=187
A[7,7]=187
print A
print "satranç tahtası"
io.imshow(A,cmap="gray")
io.show()
import numpy as np
YanıtlaSilimport matplotlib.pyplot as plt
satranç_tahtası = np.zeros((8,8))
satranç_tahtası[1::2, 0::2] = 1
satranç_tahtası[0::2, 1::2] = 1
plt.imshow(satranç_tahtası, cmap='binary')
for i in cift:
YanıtlaSilfor j in cift:
satrancTahtasi[i,j]=187
for i in tek:
for j in tek:
satrancTahtasi[i,j]=255