当前位置:首页>python>Python经典游戏:2048(Pygame+random)

Python经典游戏:2048(Pygame+random)

  • 2026-07-04 03:01:34
Python经典游戏:2048(Pygame+random)

Python,速成心法

敲代码,查资料,问度娘

练习,探索,总结,优化

博文创作不易,使用代码的过程中,如有疑问的地方,欢迎大家指正留言交流。喜欢的老铁可以多多点赞+收藏分享+置顶,小红牛在此表示感谢。

------Pygame经典游戏-------

Python经典游戏:中国象棋1.0(pygame)

Python经典游戏:扫雷(pygame+random)

Python经典游戏:贪吃蛇(pygame+random)

Python经典游戏:打砖块(pygame+math)

Python经典游戏:简化版的QQ种菜游戏

Python经典游戏:手动+自动版贪吃蛇Snake

Python经典游戏:太空飞机大战Space Plane Battle

Python经典游戏:扫雷

Python经典游戏:乒乓球对战(单人+双人模式)

Pygame经典游戏:消消乐Icehappy(安排!!)

Pygame经典游戏:坦克大战TankWar+五子棋人机对弈+俄罗斯方块(安排!!)

Python经典游戏:植物大战僵尸

Python经典游戏:像素鸟flappybird

Pygame经典游戏:微信飞机大战Wechatflying(初级版)

Python经典游戏:超级玛丽

Pygame经典游戏:贪吃蛇(普通版)

Pygame游戏:3*3/4*4/5*5智力宫格拼图

Python游戏:打地鼠(坤坤版)

Python游戏:吃金币Eating-coins

Python经典游戏:走迷宫,好烦呀,我到现在还没有走出去!!

Python游戏:滑雪+弹小球

Python游戏:外星人入侵

Pygame教程01:初识pygame游戏模块

Pygame教程02:图片的加载+缩放+旋转+显示操作

Pygame教程03:文本显示+字体加载+transform方法

Pygame教程04:draw方法绘制矩形、多边形、圆、椭圆、弧线、直线和线条等

Pygame教程05:帧动画原理+边界值检测,让小球来回上下运动

Pygame教程06:Event事件的类型+处理方法+监听鼠标事件

Pygame教程07:键盘常量+键盘事件的2种捕捉方式

Pygame教程08:使用键盘方向键,控制小球,上下左右移动。

Pygame教程09:font.render文本内容,如何自动换行显示

2048 是一款数字益智游戏,玩法简单但富有策略性。以下是核心规则和操作说明:
🎯 游戏目标:通过滑动合并相同数字,最终拼出 2048 方块(也可以继续挑战更高数字)。
🎮 基本玩法
网格:4×4 方格,初始有两个数字(2 或 4)。
移动:使用键盘 方向键(↑ ↓ ← →) 将所有方块同时向该方向滑动。
合并:移动时,相同数字的方块碰到一起会 合并成一个数字(数值相加,例如 2+2=4,4+4=8……)。
新方块:每次移动后,会在空白格随机生成一个 2(90%概率)或 4(10%概率)。
分数:每次合并得到的数字会累加到总分,例如合并出 8 就加 8 分。
结束条件:当所有格子都被填满,且 相邻(上下左右)没有相同数字 时,游戏结束。
💡 进阶提示:尽量把大数字 固定在一个角落(如左下角),便于控制合并方向。保持数字 单调递增(例如一行从大到小排列),避免小数字被卡在中间。不要随意打乱布局,优先向同一个方向滑动(如下滑、左滑)。
🔁 游戏控制(基于提供的代码)
方向键:移动并合并。
R 键:随时重新开始游戏。
达到 2048 后会显示胜利提示,但可以继续玩。
开始游戏后,试着规划每一步,让数字不断翻倍,直到达成 2048!

↓ 源码如下 ↓

# -*- coding: utf-8 -*-# @Author : 小红牛# 微信公众号:wdPythonimport pygameimport randomimport sys# 初始化Pygamepygame.init()# 游戏配置WIDTH, HEIGHT = 450550          # 窗口宽度和高度GRID_SIZE = 4                     # 4x4网格CELL_SIZE = 80                    # 每个格子大小MARGIN = 10                       # 格子间距GRID_LEFT = (WIDTH - (GRID_SIZE * CELL_SIZE + (GRID_SIZE - 1) * MARGIN)) // 2GRID_TOP = 120                    # 网格顶部Y坐标# 颜色定义 (R, G, B)BG_COLOR = (250248239)        # 背景米色EMPTY_COLOR = (205193180)     # 空格子颜色# 数字对应的格子颜色TILE_COLORS = {    0: (205193180),    2: (238228218),    4: (237224200),    8: (242177121),    16: (24514999),    32: (24612495),    64: (2469459),    128: (237207114),    256: (23720497),    512: (23720080),    1024: (23719763),    2048: (23719446),}# 文字颜色 (深色/浅色)DARK_TEXT = (119110101)LIGHT_TEXT = (249246242)# 字体设置FONT_LARGE = pygame.font.SysFont("arial"36, bold=True)FONT_MEDIUM = pygame.font.SysFont("arial"28, bold=True)FONT_SMALL = pygame.font.SysFont("arial"24, bold=True)class Game2048:    """2048游戏核心逻辑"""    def __init__(self):        self.grid = [[0] * GRID_SIZE for _ in range(GRID_SIZE)]        self.score = 0        self.highscore = 0        self.game_over = False        self.reset()  # 初始化网格并添加两个起始数字    def reset(self):        """重置游戏(保留最高分)"""        self.grid = [[0] * GRID_SIZE for _ in range(GRID_SIZE)]        self.score = 0        self.game_over = False        self.add_random_tile()   # 第一个数字        self.add_random_tile()   # 第二个数字    def add_random_tile(self):        """在随机空格子添加新数字(2或4),90%概率为2,10%概率为4"""        empty_cells = [(r, c) for r in range(GRID_SIZE) for c in range(GRID_SIZE) if self.grid[r][c] == 0]        if empty_cells:            r, c = random.choice(empty_cells)            self.grid[r][c] = 2 if random.random() < 0.9 else 4            return True        return False    def get_max_tile(self):        """获取当前网格中的最大数字"""        return max(max(row) for row in self.grid)    def update_highscore(self):        """更新最高分"""        if self.score > self.highscore:            self.highscore = self.score    def is_game_over(self):        """检查游戏是否结束:没有空格子且任何方向都无法移动"""        # 如果有空格,游戏未结束        if any(self.grid[r][c] == 0 for r in range(GRID_SIZE) for c in range(GRID_SIZE)):            return False        # 检查是否还有相邻相同数字可以合并        for r in range(GRID_SIZE):            for c in range(GRID_SIZE):                val = self.grid[r][c]                if (c + 1 < GRID_SIZE and self.grid[r][c + 1] == val) or \                   (r + 1 < GRID_SIZE and self.grid[r + 1][c] == val):                    return False        return True    # ---------- 移动和合并核心算法 ----------    @staticmethod    def _merge_line(line):        """合并一行(向左),返回新行和本次合并获得的分数"""        # 过滤掉0,得到非零数字列表        filtered = [num for num in line if num != 0]        new_line = []        score_gain = 0        skip = False        for i in range(len(filtered)):            if skip:                skip = False                continue            # 如果下一个数字存在且相等,合并            if i + 1 < len(filtered) and filtered[i] == filtered[i + 1]:                merged = filtered[i] * 2                new_line.append(merged)                score_gain += merged                skip = True            else:                new_line.append(filtered[i])        # 补零至长度为GRID_SIZE        new_line += [0] * (GRID_SIZE - len(new_line))        return new_line, score_gain    def _move_left(self):        """向左移动所有行,返回新网格和总得分"""        new_grid = []        total_score = 0        for row in self.grid:            new_row, score = self._merge_line(row)            new_grid.append(new_row)            total_score += score        return new_grid, total_score    def _move_right(self):        """向右移动:每行反转 -> 左移合并 -> 反转回来"""        new_grid = []        total_score = 0        for row in self.grid:            reversed_row = row[::-1]            merged_row, score = self._merge_line(reversed_row)            new_grid.append(merged_row[::-1])            total_score += score        return new_grid, total_score    def _move_up(self):        """向上移动:矩阵转置 -> 左移 -> 转置回来"""        # 转置        transposed = [[self.grid[r][c] for r in range(GRID_SIZE)] for c in range(GRID_SIZE)]        new_trans, score = self._move_left()  # 在转置矩阵上执行左移        # 转置回来        new_grid = [[new_trans[r][c] for r in range(GRID_SIZE)] for c in range(GRID_SIZE)]        return new_grid, score    def _move_down(self):        """向下移动:转置 -> 右移 -> 转置回来"""        transposed = [[self.grid[r][c] for r in range(GRID_SIZE)] for c in range(GRID_SIZE)]        new_trans, score = self._move_right()        new_grid = [[new_trans[r][c] for r in range(GRID_SIZE)] for c in range(GRID_SIZE)]        return new_grid, score    def move(self, direction):        """        执行移动操作        direction: 'up', 'down', 'left', 'right'        返回是否移动成功(网格发生变化)        """        if self.game_over:            return False        # 保存当前状态,用于比较是否发生变化        old_grid = [row[:] for row in self.grid]        old_score = self.score        # 根据方向调用相应移动方法        if direction == 'left':            new_grid, score_gain = self._move_left()        elif direction == 'right':            new_grid, score_gain = self._move_right()        elif direction == 'up':            new_grid, score_gain = self._move_up()        elif direction == 'down':            new_grid, score_gain = self._move_down()        else:            return False        # 检查网格是否发生变化        if new_grid == old_grid:            return False        # 更新网格和分数        self.grid = new_grid        self.score += score_gain        self.update_highscore()        # 移动成功后添加随机新数字        self.add_random_tile()        # 检查游戏是否结束        if self.is_game_over():            self.game_over = True        return Truedef draw_tile(screen, value, x, y):    """绘制单个格子"""    # 选择颜色,如果值超过2048则使用2048颜色    color = TILE_COLORS.get(value, TILE_COLORS[2048])    rect = pygame.Rect(x, y, CELL_SIZE, CELL_SIZE)    pygame.draw.rect(screen, color, rect, border_radius=8)    pygame.draw.rect(screen, (187173160), rect, 2, border_radius=8)  # 边框    # 绘制数字    if value != 0:        # 根据数字大小选择字体和颜色        if value < 8:            text_color = DARK_TEXT        else:            text_color = LIGHT_TEXT        # 数字太大时缩小字体        if value >= 1000:            font = pygame.font.SysFont("arial"24, bold=True)        elif value >= 100:            font = pygame.font.SysFont("arial"28, bold=True)        else:            font = FONT_MEDIUM        text = font.render(str(value), True, text_color)        text_rect = text.get_rect(center=(x + CELL_SIZE // 2, y + CELL_SIZE // 2))        screen.blit(text, text_rect)def draw_game(screen, game):    """绘制整个游戏界面"""    screen.fill(BG_COLOR)    # 绘制标题    title = FONT_LARGE.render("2048"True, DARK_TEXT)    screen.blit(title, (GRID_LEFT, 20))    # 绘制分数面板    score_rect = pygame.Rect(WIDTH - 1402012050)    pygame.draw.rect(screen, (187173160), score_rect, border_radius=6)    score_text = FONT_SMALL.render("SCORE"True, LIGHT_TEXT)    score_value = FONT_MEDIUM.render(str(game.score), True, LIGHT_TEXT)    screen.blit(score_text, (WIDTH - 13025))    screen.blit(score_value, (WIDTH - 12545))    # 绘制最高分面板    high_rect = pygame.Rect(WIDTH - 1408012045)    pygame.draw.rect(screen, (187173160), high_rect, border_radius=6)    high_text = FONT_SMALL.render("BEST"True, LIGHT_TEXT)    high_value = FONT_MEDIUM.render(str(game.highscore), True, LIGHT_TEXT)    screen.blit(high_text, (WIDTH - 13085))    screen.blit(high_value, (WIDTH - 125105))    # 绘制游戏网格    for r in range(GRID_SIZE):        for c in range(GRID_SIZE):            x = GRID_LEFT + c * (CELL_SIZE + MARGIN)            y = GRID_TOP + r * (CELL_SIZE + MARGIN)            draw_tile(screen, game.grid[r][c], x, y)    # 游戏结束或胜利提示    if game.game_over:        # 半透明覆盖层        overlay = pygame.Surface((WIDTH, HEIGHT), pygame.SRCALPHA)        overlay.fill((000180))        screen.blit(overlay, (00))        # 游戏结束文字        game_over_text = FONT_LARGE.render("GAME OVER"True, (255255255))        restart_text = FONT_SMALL.render("Press R to restart"True, (255255255))        screen.blit(game_over_text, (WIDTH // 2 - game_over_text.get_width() // 2, HEIGHT // 2 - 40))        screen.blit(restart_text, (WIDTH // 2 - restart_text.get_width() // 2, HEIGHT // 2 + 20))    else:        # 检查是否胜利(达到2048)        if game.get_max_tile() >= 2048:            win_text = FONT_MEDIUM.render("You Win!"True, (2552150))            screen.blit(win_text, (GRID_LEFT, GRID_TOP - 35))    # 提示操作    hint = FONT_SMALL.render("Use arrow keys / R to restart"True, (119110101))    screen.blit(hint, (WIDTH // 2 - hint.get_width() // 2, HEIGHT - 30))def main():    """主函数:游戏循环"""    screen = pygame.display.set_mode((WIDTH, HEIGHT))    pygame.display.set_caption("2048")    clock = pygame.time.Clock()    game = Game2048()    running = True    while running:        for event in pygame.event.get():            if event.type == pygame.QUIT:                running = False                pygame.quit()                sys.exit()            elif event.type == pygame.KEYDOWN:                if event.key == pygame.K_r:                    game.reset()                elif not game.game_over:                    moved = False                    if event.key == pygame.K_LEFT:                        moved = game.move('left')                    elif event.key == pygame.K_RIGHT:                        moved = game.move('right')                    elif event.key == pygame.K_UP:                        moved = game.move('up')                    elif event.key == pygame.K_DOWN:                        moved = game.move('down')                    # 移动后更新显示(自动重绘)        draw_game(screen, game)        pygame.display.flip()        clock.tick(30)    pygame.quit()if __name__ == "__main__":    main()

完毕!!感谢您的收看

--------★历史博文集合★--------

Python入门篇  进阶篇  视频教程  Py安装

py项目Python模块 Python爬虫  Json

Xpath正则表达式SeleniumEtreeCss

Gui程序开发TkinterPyqt5 列表元组字典

数据可视化 matplotlib  词云图Pyecharts

海龟画图PandasBug处理电脑小知识

自动化脚本编程工具NumPy CSVWeb

Pygame  图像处理  机器学习数据库

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 04:21:34 HTTP/2.0 GET : https://f.mffb.com.cn/a/491207.html
  2. 运行时间 : 0.137169s [ 吞吐率:7.29req/s ] 内存消耗:4,563.34kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=1abd4331196177b87daf4ee496c0073f
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001013s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001686s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000782s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.012173s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001439s ]
  6. SELECT * FROM `set` [ RunTime:0.004151s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000581s ]
  8. SELECT * FROM `article` WHERE `id` = 491207 LIMIT 1 [ RunTime:0.002010s ]
  9. UPDATE `article` SET `lasttime` = 1783110094 WHERE `id` = 491207 [ RunTime:0.016470s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000330s ]
  11. SELECT * FROM `article` WHERE `id` < 491207 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.002935s ]
  12. SELECT * FROM `article` WHERE `id` > 491207 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.010318s ]
  13. SELECT * FROM `article` WHERE `id` < 491207 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.007250s ]
  14. SELECT * FROM `article` WHERE `id` < 491207 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002473s ]
  15. SELECT * FROM `article` WHERE `id` < 491207 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002395s ]
0.138658s