gistlib
main.pyimport matplotlib.pyplot as plt import numpy as np # Create a 2D numpy array representing the level level = np.array([ [0, 1, 0, 1, 0], [1, 1, 1, 1, 1], [0, 1, 0, 1, 0], [1, 1, 1, 1, 1], [0, 1, 0, 1, 0] ]) # Display the level using imshow function plt.imshow(level, cmap='binary', interpolation='nearest') plt.axis('off') # Turn off axes plt.show() 372 chars17 lines
import matplotlib.pyplot as plt import numpy as np # Create a 2D numpy array representing the level level = np.array([ [0, 1, 0, 1, 0], [1, 1, 1, 1, 1], [0, 1, 0, 1, 0], [1, 1, 1, 1, 1], [0, 1, 0, 1, 0] ]) # Display the level using imshow function plt.imshow(level, cmap='binary', interpolation='nearest') plt.axis('off') # Turn off axes plt.show()
gistlibby LogSnag