Commit 3db02e09 by BellCodeEditor

auto save

parent 5402f3f8
Showing with 19 additions and 15 deletions
import pygame def selection_sort(arr):
from pygame import locals n = len(arr)
for i in ran range(n):
min_index = i
for j in range (i+1,n):
if arr[j] < arr[min_index]
min_index = j
arr[i],arr[min_index] = arr[min_index],arr[i]return arr
arr = [64, 25, 12, 22, 11]
sorted_arr = selection_sory(arr)
print("vhserhetheteth:",sortedarr)
def sort_matrix(matrix)
for i in ran range(len(matrix))
matrix[i] = selection_sort(matrix[i])
return matrix
matrix = [
[64, 25, 12],
[22, 11, 99],
[45, 56, 89]
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
screen = pyg.ame.display.set_mode((660,480), 0, 32)
while True:
for event in pygame.get():
if event.Type == locals.QUIT
background = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('food.png')
body = pygame.image.load('body.png')
\ No newline at end of file

2.05 KB | W: | H:

2.16 KB | W: | H:

up.png
up.png
up.png
up.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment