摘要:
from random import random def printIntro(): print("这个程序模拟两个选手A和B的乒乓球比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(input("请输入选手A的能
阅读全文
摘要:
import pygame import random import sys 初始化pygame pygame.init() 定义颜色 WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BL
阅读全文
摘要:
import jieba from collections import Counter import re with open('xiyouji.txt', 'r', encoding='utf-8') as f: text = f.read() words = jieba.lcut(text)
阅读全文
摘要:
import pygame import random import sys 初始化pygame pygame.init() 游戏常量 SCREEN_WIDTH, SCREEN_HEIGHT = 800, 600 GRID_SIZE = 80 LANES = 5 COLUMNS = 9 FPS =
阅读全文