Python语言自动玩游戏的消消乐游戏程序代码3QZQ

import pygame
import sys
import random
import time
import math
from pygame.locals import *

# 初始化pygame
pygame.init()

# 游戏常量
SCREEN_WIDTH = 900
SCREEN_HEIGHT = 700
GRID_SIZE = 8
CELL_SIZE = 60
MARGIN = 50
FPS = 60

# 颜色定义
BACKGROUND = (40, 44, 52)
GRID_BACKGROUND = (30, 34, 42)
GRID_LINE = (56, 60, 74)
COLORS = [
(241, 76, 76), # 红色
(76, 173, 241), # 蓝色
(76, 241, 157), # 绿色
(241, 214, 76), # 黄色
(185, 76, 241), # 紫色
(241, 147, 76) # 橙色
]
TEXT_COLOR = (220, 220, 220)
HIGHLIGHT = (255, 255, 255, 100)
MATCH_HIGHLIGHT = (255, 255, 255, 150)

# 创建游戏窗口
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption("Match-3 游戏(按 A 切换AI模式,R 重置)")
clock = pygame.time.Clock()

# 字体 - 使用系统默认字体,确保兼容性
try:
# 尝试加载中文字体
font = pygame.font.SysFont("simhei,microsoftyahei,arial", 24)
small_font = pygame.font.SysFont("simhei,microsoftyahei,arial", 20)
except:
# 如果失败则使用默认字体
font = pygame.font.Font(None, 36)
small_font = pygame.font.Font(None, 24)


class Animation:
def __init__(self):
self.animations = []

def add_swap(self, cell1, cell2, duration=0.3):
i1, j1 = cell1
i2, j2 = cell2

# 计算屏幕坐标
x1 = MARGIN + j1 * CELL_SIZE + CELL_SIZE // 2
y1 = MARGIN + i1 * CELL_SIZE + CELL_SIZE // 2
x2 = MARGIN + j2 * CELL_SIZE + CELL_SIZE // 2
y2 = MARGIN + i2 * CELL_SIZE + CELL_SIZE // 2

self.animations.append({
'type': 'swap',
'cells': [cell1, cell2],
'start_pos': [(x1, y1), (x2, y2)],
'end_pos': [(x2, y2), (x1, y1)],
'progress': 0,
'duration': duration,
'start_time': time.time()
})

def add_fall(self, from_cell, to_cell, duration=0.4):
i1, j1 = from_cell
i2, j2 = to_cell

# 计算屏幕坐标
x1 = MARGIN + j1 * CELL_SIZE + CELL_SIZE // 2
y1 = MARGIN + i1 * CELL_SIZE + CELL_SIZE // 2
x2 = MARGIN + j2 * CELL_SIZE + CELL_SIZE // 2
y2 = MARGIN + i2 * CELL_SIZE + CELL_SIZE // 2

self.animations.append({
'type': 'fall',
'cell': to_cell, # 最终位置
'from_pos': (x1, y1),
'to_pos': (x2, y2),
'progress': 0,
'duration': duration,
'start_time': time.time()
})

def add_match_highlight(self, cells, duration=0.5):
screen_cells = []
for cell in cells:
i, j = cell
x = MARGIN + j * CELL_SIZE + CELL_SIZE // 2
y = MARGIN + i * CELL_SIZE + CELL_SIZE // 2
screen_cells.append((x, y, CELL_SIZE // 2 - 5))

self.animations.append({
'type': 'match',
'cells': screen_cells,
'progress': 0,
'duration': duration,
'start_time': time.time(),
'alpha': 255
})

def add_new_gem(self, cell, duration=0.3):
i, j = cell
x = MARGIN + j * CELL_SIZE + CELL_SIZE // 2
y = MARGIN - CELL_SIZE // 2 # 从上方开始

final_y = MARGIN + i * CELL_SIZE + CELL_SIZE // 2

self.animations.append({
'type': 'new_gem',
'cell': cell,
'start_pos': (x, y),
'end_pos': (x, final_y),
'progress': 0,
'duration': duration,
'start_time': time.time()
})

def update(self):
current_time = time.time()
completed_animations = []

for i, anim in enumerate(self.animations):
elapsed = current_time - anim['start_time']
anim['progress'] = min(elapsed / anim['duration'], 1.0)

# 特殊处理匹配高亮动画
if anim['type'] == 'match':
# 脉冲效果
anim['alpha'] = int(128 + 127 * math.sin(anim['progress'] * math.pi * 4))

if anim['progress'] >= 1.0:
completed_animations.append(i)

# 移除完成的动画(从后往前避免索引问题)
for i in reversed(completed_animations):
self.animations.pop(i)

return len(self.animations) > 0

def draw(self, grid):
for anim in self.animations:
if anim['type'] == 'swap':
# 使用缓动函数使动画更自然
progress = self.ease_in_out(anim['progress'])

for idx, cell in enumerate(anim['cells']):
start_x, start_y = anim['start_pos'][idx]
end_x, end_y = anim['end_pos'][idx]

x = start_x + (end_x - start_x) * progress
y = start_y + (end_y - start_y) * progress

color_idx = grid[cell[0]][cell[1]]
radius = CELL_SIZE // 2 - 5

# 绘制移动中的宝石
pygame.draw.circle(screen, COLORS[color_idx], (int(x), int(y)), radius)
pygame.draw.circle(screen, HIGHLIGHT, (int(x - radius // 3), int(y - radius // 3)), radius // 2)

elif anim['type'] == 'fall':
progress = self.ease_out(anim['progress'])

start_x, start_y = anim['from_pos']
end_x, end_y = anim['to_pos']

x = start_x + (end_x - start_x) * progress
y = start_y + (end_y - start_y) * progress

color_idx = grid[anim['cell'][0]][anim['cell'][1]]
radius = CELL_SIZE // 2 - 5

pygame.draw.circle(screen, COLORS[color_idx], (int(x), int(y)), radius)
pygame.draw.circle(screen, HIGHLIGHT, (int(x - radius // 3), int(y - radius // 3)), radius // 2)

elif anim['type'] == 'match':
for x, y, radius in anim['cells']:
# 绘制高亮环
highlight_surface = pygame.Surface((radius * 2, radius * 2), pygame.SRCALPHA)
pygame.draw.circle(highlight_surface, (*MATCH_HIGHLIGHT[:3], anim['alpha']),
(radius, radius), radius, 4)
screen.blit(highlight_surface, (x - radius, y - radius))

elif anim['type'] == 'new_gem':
progress = self.ease_out(anim['progress'])

start_x, start_y = anim['start_pos']
end_x, end_y = anim['end_pos']

x = start_x + (end_x - start_x) * progress
y = start_y + (end_y - start_y) * progress

color_idx = grid[anim['cell'][0]][anim['cell'][1]]
radius = CELL_SIZE // 2 - 5

pygame.draw.circle(screen, COLORS[color_idx], (int(x), int(y)), radius)
pygame.draw.circle(screen, HIGHLIGHT, (int(x - radius // 3), int(y - radius // 3)), radius // 2)

def ease_in_out(self, t):
return 0.5 * (1 - math.cos(t * math.pi))

def ease_out(self, t):
return 1 - (1 - t) * (1 - t)


class Game:
def __init__(self):
self.grid = []
self.selected = None
self.score = 0
self.ai_mode = False
self.ai_thinking = False
self.animations = Animation()
self.state = "playing" # playing, animating, game_over
self.initialize_grid()

def initialize_grid(self):
# 创建初始网格
self.grid = []
for i in range(GRID_SIZE):
row = []
for j in range(GRID_SIZE):
row.append(random.randint(0, len(COLORS) - 1))
self.grid.append(row)

# 确保初始网格没有可消除的组合
while self.find_matches():
self.remove_matches()
self.fill_grid()

def draw(self):
# 绘制背景
screen.fill(BACKGROUND)

# 绘制网格背景
grid_rect = pygame.Rect(
MARGIN, MARGIN,
GRID_SIZE * CELL_SIZE,
GRID_SIZE * CELL_SIZE
)
pygame.draw.rect(screen, GRID_BACKGROUND, grid_rect)

# 绘制网格线
for i in range(GRID_SIZE + 1):
# 垂直线
pygame.draw.line(
screen, GRID_LINE,
(MARGIN + i * CELL_SIZE, MARGIN),
(MARGIN + i * CELL_SIZE, MARGIN + GRID_SIZE * CELL_SIZE),
2
)
# 水平线
pygame.draw.line(
screen, GRID_LINE,
(MARGIN, MARGIN + i * CELL_SIZE),
(MARGIN + GRID_SIZE * CELL_SIZE, MARGIN + i * CELL_SIZE),
2
)

# 绘制静态宝石(不在动画中的)
for i in range(GRID_SIZE):
for j in range(GRID_SIZE):
color_idx = self.grid[i][j]
if color_idx >= 0: # 确保是有效颜色索引
# 检查这个宝石是否在动画中
in_animation = False
for anim in self.animations.animations:
if anim['type'] in ['swap', 'fall', 'new_gem']:
if 'cell' in anim and anim['cell'] == (i, j):
in_animation = True
break
elif 'cells' in anim and (i, j) in anim['cells']:
in_animation = True
break

if not in_animation:
x = MARGIN + j * CELL_SIZE + CELL_SIZE // 2
y = MARGIN + i * CELL_SIZE + CELL_SIZE // 2
radius = CELL_SIZE // 2 - 5

# 绘制宝石主体
pygame.draw.circle(screen, COLORS[color_idx], (x, y), radius)

# 绘制高光效果
highlight_radius = radius // 2
pygame.draw.circle(screen, HIGHLIGHT, (x - radius // 3, y - radius // 3), highlight_radius)

# 绘制动画
self.animations.draw(self.grid)

# 绘制选中的宝石
if self.selected and self.state == "playing":
i, j = self.selected
rect = pygame.Rect(
MARGIN + j * CELL_SIZE + 2,
MARGIN + i * CELL_SIZE + 2,
CELL_SIZE - 4,
CELL_SIZE - 4
)
pygame.draw.rect(screen, HIGHLIGHT, rect, 4)

# 绘制分数
score_text = font.render(f"分数: {self.score}", True, TEXT_COLOR)
screen.blit(score_text, (SCREEN_WIDTH - 250, 20))

# 绘制模式指示器
mode_text = font.render(
"模式: AI自动" if self.ai_mode else "模式: 手动",
True, TEXT_COLOR
)
screen.blit(mode_text, (SCREEN_WIDTH - 250, 60))

# 绘制提示
hints = [
"按 A 切换AI模式",
"按 R 重置游戏",
"手动模式下点击宝石进行交换"
]

for i, hint in enumerate(hints):
hint_text = small_font.render(hint, True, TEXT_COLOR)
screen.blit(hint_text, (SCREEN_WIDTH - 350, SCREEN_HEIGHT - 120 + i * 25))

# 如果AI正在思考,显示提示
if self.ai_thinking:
thinking_text = font.render("AI正在思考...", True, TEXT_COLOR)
screen.blit(thinking_text, (SCREEN_WIDTH // 2 - 80, SCREEN_HEIGHT - 40))

# 如果正在播放动画,显示状态
if self.state == "animating":
anim_text = small_font.render("动画播放中...", True, TEXT_COLOR)
screen.blit(anim_text, (SCREEN_WIDTH // 2 - 60, 20))

def get_cell_at_pos(self, pos):
x, y = pos
# 检查是否在网格内
if (x < MARGIN or y < MARGIN or
x >= MARGIN + GRID_SIZE * CELL_SIZE or
y >= MARGIN + GRID_SIZE * CELL_SIZE):
return None

# 计算网格索引
j = (x - MARGIN) // CELL_SIZE
i = (y - MARGIN) // CELL_SIZE

return (i, j)

def select(self, cell):
if not cell or self.state != "playing":
self.selected = None
return

i, j = cell

if not self.selected:
self.selected = (i, j)
else:
# 检查是否相邻
si, sj = self.selected
if ((abs(i - si) == 1 and j == sj) or
(abs(j - sj) == 1 and i == si)):
# 添加交换动画
self.animations.add_swap(self.selected, (i, j))
self.state = "animating"

# 交换宝石(实际交换会在动画完成后进行)
self.swap((si, sj), (i, j))

# 检查是否有匹配
matches = self.find_matches()
if matches:
# 添加匹配高亮动画
match_cells = []
for match in matches:
i1, j1, i2, j2 = match
if i1 == i2: # 水平匹配
for j in range(j1, j2 + 1):
match_cells.append((i1, j))
else: # 垂直匹配
for i in range(i1, i2 + 1):
match_cells.append((i, j1))
self.animations.add_match_highlight(match_cells)
else:
# 如果没有匹配,稍后交换回来
pass

self.selected = None
else:
# 选择新的宝石
self.selected = (i, j)

def swap(self, cell1, cell2):
i1, j1 = cell1
i2, j2 = cell2
self.grid[i1][j1], self.grid[i2][j2] = self.grid[i2][j2], self.grid[i1][j1]

def find_matches(self):
matches = []

# 检查水平匹配
for i in range(GRID_SIZE):
for j in range(GRID_SIZE - 2):
if (self.grid[i][j] == self.grid[i][j + 1] == self.grid[i][j + 2] and
self.grid[i][j] != -1):
# 找到匹配,扩展到所有连续相同宝石
k = j + 3
while k < GRID_SIZE and self.grid[i][k] == self.grid[i][j]:
k += 1
matches.append((i, j, i, k - 1)) # 水平匹配

# 检查垂直匹配
for i in range(GRID_SIZE - 2):
for j in range(GRID_SIZE):
if (self.grid[i][j] == self.grid[i + 1][j] == self.grid[i + 2][j] and
self.grid[i][j] != -1):
# 找到匹配,扩展到所有连续相同宝石
k = i + 3
while k < GRID_SIZE and self.grid[k][j] == self.grid[i][j]:
k += 1
matches.append((i, j, k - 1, j)) # 垂直匹配

return matches

def remove_matches(self):
matches = self.find_matches()
if not matches:
return False

# 标记要移除的宝石
to_remove = [[False for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)]

for match in matches:
i1, j1, i2, j2 = match

# 水平匹配
if i1 == i2:
for j in range(j1, j2 + 1):
to_remove[i1][j] = True
# 垂直匹配
elif j1 == j2:
for i in range(i1, i2 + 1):
to_remove[i][j1] = True

# 移除标记的宝石并增加分数
removed_count = 0
for i in range(GRID_SIZE):
for j in range(GRID_SIZE):
if to_remove[i][j]:
self.grid[i][j] = -1
removed_count += 1

# 每移除一个宝石得10分
self.score += removed_count * 10

return True

def fill_grid(self):
# 宝石下落
falling_gems = []
for j in range(GRID_SIZE):
# 从底部向上移动宝石
empty_spaces = 0
for i in range(GRID_SIZE - 1, -1, -1):
if self.grid[i][j] == -1:
empty_spaces += 1
elif empty_spaces > 0:
# 记录下落动画
falling_gems.append(((i, j), (i + empty_spaces, j)))
self.grid[i + empty_spaces][j] = self.grid[i][j]
self.grid[i][j] = -1

# 添加下落动画
for from_cell, to_cell in falling_gems:
self.animations.add_fall(from_cell, to_cell)

# 填充顶部空位
new_gems = []
for j in range(GRID_SIZE):
for i in range(GRID_SIZE):
if self.grid[i][j] == -1:
self.grid[i][j] = random.randint(0, len(COLORS) - 1)
new_gems.append((i, j))

# 添加新宝石动画
for cell in new_gems:
self.animations.add_new_gem(cell)

# 检查是否有新的匹配
if self.find_matches():
# 添加匹配高亮动画
matches = self.find_matches()
match_cells = []
for match in matches:
i1, j1, i2, j2 = match
if i1 == i2: # 水平匹配
for j in range(j1, j2 + 1):
match_cells.append((i1, j))
else: # 垂直匹配
for i in range(i1, i2 + 1):
match_cells.append((i, j1))
self.animations.add_match_highlight(match_cells)

def find_best_move(self):
"""AI: 寻找最佳移动"""
best_score = 0
best_move = None

# 检查所有可能的交换
for i in range(GRID_SIZE):
for j in range(GRID_SIZE):
# 检查右侧交换
if j < GRID_SIZE - 1:
# 尝试交换
self.swap((i, j), (i, j + 1))

# 评估这个交换
matches = self.find_matches()
if matches:
# 计算这个交换的得分潜力
score_potential = 0
for match in matches:
i1, j1, i2, j2 = match
if i1 == i2: # 水平匹配
score_potential += (j2 - j1 + 1) * 10
else: # 垂直匹配
score_potential += (i2 - i1 + 1) * 10

# 如果这个交换更好,更新最佳移动
if score_potential > best_score:
best_score = score_potential
best_move = ((i, j), (i, j + 1))

# 交换回来
self.swap((i, j), (i, j + 1))

# 检查下方交换
if i < GRID_SIZE - 1:
# 尝试交换
self.swap((i, j), (i + 1, j))

# 评估这个交换
matches = self.find_matches()
if matches:
# 计算这个交换的得分潜力
score_potential = 0
for match in matches:
i1, j1, i2, j2 = match
if i1 == i2: # 水平匹配
score_potential += (j2 - j1 + 1) * 10
else: # 垂直匹配
score_potential += (i2 - i1 + 1) * 10

# 如果这个交换更好,更新最佳移动
if score_potential > best_score:
best_score = score_potential
best_move = ((i, j), (i + 1, j))

# 交换回来
self.swap((i, j), (i + 1, j))

return best_move

def ai_play(self):
"""AI: 执行一步移动"""
if self.ai_thinking or self.state != "playing":
return

self.ai_thinking = True

# 寻找最佳移动
move = self.find_best_move()

if move:
# 添加交换动画
self.animations.add_swap(move[0], move[1])
self.state = "animating"

# 执行移动
self.swap(move[0], move[1])

# 检查是否有匹配
matches = self.find_matches()
if matches:
# 添加匹配高亮动画
match_cells = []
for match in matches:
i1, j1, i2, j2 = match
if i1 == i2: # 水平匹配
for j in range(j1, j2 + 1):
match_cells.append((i1, j))
else: # 垂直匹配
for i in range(i1, i2 + 1):
match_cells.append((i, j1))
self.animations.add_match_highlight(match_cells)

self.ai_thinking = False

def update(self):
# 更新动画
has_animations = self.animations.update()

if has_animations:
self.state = "animating"
else:
if self.state == "animating":
# 动画结束,检查是否需要进一步处理
self.state = "playing"

# 检查是否有匹配需要消除
if self.remove_matches():
self.fill_grid()
self.state = "animating" # 继续播放填充动画
else:
# 检查交换后是否有匹配,如果没有匹配则交换回来
if not self.find_matches():
# 查找最近的一次交换
for anim in reversed(self.animations.animations):
if anim['type'] == 'swap' and anim['progress'] >= 1.0:
# 交换回来
self.swap(anim['cells'][0], anim['cells'][1])
break


def main():
game = Game()
last_ai_move_time = 0
ai_move_delay = 2.0 # AI每次移动的延迟(秒)

# 游戏主循环
while True:
current_time = time.time()

# 处理事件
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()

elif event.type == KEYDOWN:
if event.key == K_a:
# 切换AI模式
game.ai_mode = not game.ai_mode
game.selected = None
elif event.key == K_r:
# 重置游戏
game = Game()

elif event.type == MOUSEBUTTONDOWN and not game.ai_mode and game.state == "playing":
# 手动模式下的鼠标点击
if event.button == 1: # 左键
cell = game.get_cell_at_pos(event.pos)
game.select(cell)

# 更新游戏状态
game.update()

# AI模式下的自动移动
if (game.ai_mode and
current_time - last_ai_move_time > ai_move_delay and
game.state == "playing" and
not game.ai_thinking):
game.ai_play()
last_ai_move_time = current_time

# 绘制游戏
game.draw()

# 更新显示
pygame.display.flip()
clock.tick(FPS)


if __name__ == "__main__":
main()

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/925239.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

希爱力双效片副作用seo做的最好的十个网站

<!DOCTYPE html> <html><head><meta charset"UTF-8"><title>音频引入</title></head><body><!--audio:在网页中引入音频IE8以及之前版本不支持属性名和属性值一样&#xff0c;可以只写属性名src属性:指定音频文件…

python语言手势控制音乐播放器代码QZQ

# pip install opencv-python mediapipe pygame numpy pillow# pip install pyinstaller# pyinstaller --onefile --icon=1.ico main.py import cv2import mediapipe as mpimport pygameimport osimport numpy as npim…

地方门户网站建设方案秦皇岛市海港区建设局网站

文章目录 1、什么是DES2、DES的基本概念3、DES的加密流程4、DES算法步骤详解4.1 初始置换(Initial Permutation&#xff0c;IP置换)4.2 加密轮次4.3 F轮函数4.3.1 拓展R到48位4.3.2 子密钥K的生成4.3.3 当前轮次的子密钥与拓展的48位R进行异或运算4.3.4 S盒替换&#xff08;Sub…

做网站关键词加到什么位置企业网企业网站制作

夏天天气炎热&#xff0c;电脑机箱内温度也较高&#xff0c;温度过高会影响电脑性能出现死机等问题&#xff0c;甚至影响硬件寿命。所以给机箱装风扇来散热是非常重要的。那么&#xff0c;机箱风扇怎么装合理呢?机箱风扇的电源线怎么接呢?下面分享一下机箱风...夏天天气炎热&…

新服务器做网站如何配置聊天直播软件开发

简介上篇文章我们介绍了Spring boot的fat jar/war包&#xff0c;jar/war包都可以使用 java -jar 命令来运行&#xff0c;而maven也提供了mvn spring-boot:run 命令来运行应用程序&#xff0c;下面我们看看两者有什么不同。Spring Boot Maven Plugin上篇文章我们提到了Spring Bo…

Python语言自动玩游戏的数字拼图游戏程序代码ZXQMQZQ

import pygameimport sysimport randomimport timefrom queue import PriorityQueuefrom pygame.locals import * # 初始化pygamepygame.init() # 游戏常量WIDTH, HEIGHT = 400, 500GRID_SIZE = 3TILE_SIZE = 100MARGI…

如何找出集合的两个子集使得和相等?

给定一个大小为 \(n\) 的整数集合 \(S\subseteq [0,V]\),找出他的两个子集 \(s_1,s_2\) 使得其元素的和相等,或报告无解。对于所有的 \(T\subseteq S\),\(T\) 中元素的和满足 \(0\le \sum_{x\in T} x\le V|T|\)。 所…

Python语言自动玩游戏的俄罗斯方块游戏程序代码QZQ

import randomimport mathimport sysimport numpy as npimport pygame # -------------------- 常量 --------------------CELL = 30 # 像素COLS, ROWS = 10, 20SCREEN_W, SCREEN_H = 20 * CELL, ROWS * CELLFPS = 60…

Spring AI(七)Spring AI 的RAG搭建集合火山向量模型+阿里云Tair(企业版)

Spring AI(七)Spring AI 的RAG搭建集合火山向量模型+阿里云Tair(企业版)pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-fami…

sw网站建设合肥网站seo服务

前言-什么是数据幻觉&#xff1f;它到底有什么危害呢 我们直接来举例&#xff1a; 我是金银花一区的&#xff0c;附近有什么小学&#xff1f; 此时RAG带出如下信息&#xff1a; 金银花小区一区、二区、三区附近教育资源有&#xff1a;银树大学、建设小学金银花校区、金树高…

Python语言自动玩游戏的数字拼图游戏程序代码QZQ

import sysimport randomimport pygame # 初始化pygamepygame.init() # 游戏常量SIZE = 3 # 3x3 拼图CELL = 120 # 每个格子的像素大小WIDTH = CELL * SIZEHEIGHT = CELL * SIZEEMPTY = SIZE * SIZE # 空格的表示值…

温州网站开发培训北京网站制作外包

http://blog.csdn.net/dandelion_gong/article/details/51673085 Unix下可用的I/O模型一共有五种&#xff1a;阻塞I/O 、非阻塞I/O 、I/O复用 、信号驱动I/O 、异步I/O。此处我们主要介绍第三种I/O符复用。 I/O复用的功能&#xff1a;如果一个或多个I/O条件满足&#xff08;输…

看动漫什么网站好企业网站的分类有哪三种

目录&#xff1a;系统学习 Java IO---- 目录&#xff0c;概览 PipedInputStream 类使得可以作为字节流读取管道的内容。 管道是同一 JVM 内的线程之间的通信通道。 使用两个已连接的管道流时&#xff0c;要为每个流操作创建一个线程&#xff0c; read() 和 write() 都是阻塞方法…

浙江自己如何做网站鹰潭手机网站建设

xin3721网络学院为广大学员&#xff0c;准备了丰富了教学视频。为了更好的让大学配合视频进行学习&#xff0c;拓展学员的知识面&#xff0c;我站特整理了大量的&#xff0c;技术文章&#xff0c;供学员参考。因此本教案需配合视频教程学习&#xff0c;视频教程地址为&#xff…

赛前训练4 字符串哈希

A 显然长度具有单调性,于是二分长度+map存储哈希值判断即可。实现 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <…

wordpress企业网站建设智慧农业项目方案

EventBus是android 下高效的发布/订阅事件总线机制&#xff0c;可以代替传统的Intent&#xff0c;Handler&#xff0c;BroadCast 或者Fragment&#xff0c;Activity&#xff0c;Service&#xff0c;线程之间传递数据&#xff0c;是一种发布订阅设计模式&#xff08;观察者模式&…

上海著名的网站制作公司杭州网站商场开发

美术教案第三课:曲曲直直(三年级美术下册教案)教学目标:认知目标:能够认识生活中的各种曲线和直线,说说曲线、直线给自己的感受.能力目标:能够用绘画、剪贴等方法表现曲线和直线的画面,培养学生自主探究的能力和创造能力.情感目标:通过收集不同直线、曲线材料进行创作,培养学生…

处处吻

你爱热吻却永不爱人 练习为乐但是怕熟人 你爱路过去索取见闻 陌路人变得必有份好感 你热爱别离 再合再离 似花瓣献技 叫花粉遍地 噢噢 你在播弄这穿线游戏 跟他结束 他与她再一起 你小心 一吻便颠倒众生 一吻便救一个人…

ThreadLocal原理与使用详解

ThreadLocal原理与使用详解 一、ThreadLocal 介绍 1.1 定义与核心特性定义:Java 官方文档描述,ThreadLocal 类用于提供线程内部的局部变量,多线程环境下通过 get() 和 set() 方法访问时,能保证各线程变量相对独立于…