代码

2048(python) 这是一个使用python语言写的基于dos窗口下的2048小游戏. 代码150行左右, 小巧轻便. 使用了pythoncom ,pyHook等包 立即下载

完整代码

#-*- coding:utf-8 -*-
import curses
from random import randrange, choice # generate and place new tile
from collections import defaultdict
letter_codes = [ord(ch) for ch in 'WASDRQwasdrq']
actions = ['Up', 'Left', 'Down', 'Right', 'Restart', 'Exit']
actions_dict = dict(zip(letter_codes, actions * 2))
def transpose(field):
    return [list(row) for row in zip(*field)]

def invert(field):
    return [row[::-1] for row in field]

class GameField(object):
    def __init__(self, height=4, width=4, win=2048):
        self.height = height
        self.width = width
        self.win_value = win
        self.score = 0
        self.highscore = 0
        self.reset()

    def reset(self):
        if self.score > self.highscore:
            self.highscore = self.score
        self.score = 0
        self.field = [[0 for i in range(self.width)] for j in range(self.height)]
        self.spawn()
        self.spawn()

    def move(self, direction):
        def move_row_left(row):
            def tighten(row): # squeese non-zero elements together
                new_row = [i for i in row if i != 0]
                new_row += [0 for i in range(len(row) - len(new_row))]
                return new_row

            def merge(row):
                pair = False
                new_row = []
                for i in range(len(row)):
                    if pair:
                        new_row.append(2 * row[i])
                        self.score += 2 * row[i]
                        pair = False
                    else:
                        if i + 1 < len(row) and row[i] == row[i + 1]:
                            pair = True
                            new_row.append(0)
                        else:
                            new_row.append(row[i])
                assert len(new_row) == len(row)
                return new_row
            return tighten(merge(tighten(row)))

        moves = {}
        moves['Left']  = lambda field:                              \
                [move_row_left(row) for row in field]
        moves['Right'] = lambda field:                              \
                invert(moves['Left'](invert(field)))
        moves['Up']    = lambda field:                              \
                transpose(moves['Left'](transpose(field)))
        moves['Down']  = lambda field:                              \
                transpose(moves['Right'](transpose(field)))

        if direction in moves:
            if self.move_is_possible(direction):
                self.field = moves[direction](self.field)
                self.spawn()
                return True
            else:
                return False

    def is_win(self):
        return any(any(i >= self.win_value for i in row) for row in self.field)

    def is_gameover(self):
        return not any(self.move_is_possible(move) for move in actions)

    def draw(self, screen):
        help_string1 = '(W)Up (S)Down (A)Left (D)Right'
        help_string2 = '     (R)Restart (Q)Exit'
        gameover_string = '           GAME OVER'
        win_string = '          YOU WIN!'
        def cast(string):
            screen.addstr(string + '\n')

        def draw_hor_separator():
            line = '+' + ('+------' * self.width + '+')[1:]
            separator = defaultdict(lambda: line)
            if not hasattr(draw_hor_separator, "counter"):
                draw_hor_separator.counter = 0
            cast(separator[draw_hor_separator.counter])
            draw_hor_separator.counter += 1

        def draw_row(row):
            cast(''.join('|{: ^5} '.format(num) if num > 0 else '|      ' for num in row) + '|')

        screen.clear()
        cast('SCORE: ' + str(self.score))
        if 0 != self.highscore:
            cast('HGHSCORE: ' + str(self.highscore))
        for row in self.field:
            draw_hor_separator()
            draw_row(row)
        draw_hor_separator()
        if self.is_win():
            cast(win_string)
        else:
            if self.is_gameover():
                cast(gameover_string)
            else:
                cast(help_string1)
        cast(help_string2)

    def spawn(self):
        new_element = 4 if randrange(100) > 89 else 2
        (i,j) = choice([(i,j) for i in range(self.width) for j in range(self.height) if self.field[i][j] == 0])
        self.field[i][j] = new_element

    def move_is_possible(self, direction):
        def row_is_left_movable(row): 
            def change(i): # true if there'll be change in i-th tile
                if row[i] == 0 and row[i + 1] != 0: # Move
                    return True
                if row[i] != 0 and row[i + 1] == row[i]: # Merge
                    return True
                return False
            return any(change(i) for i in range(len(row) - 1))

        check = {}
        check['Left']  = lambda field:                              \
                any(row_is_left_movable(row) for row in field)

        check['Right'] = lambda field:                              \
                 check['Left'](invert(field))

        check['Up']    = lambda field:                              \
                check['Left'](transpose(field))

        check['Down']  = lambda field:                              \
                check['Right'](transpose(field))

        if direction in check:
            return check[direction](self.field)
        else:
            return False
def main(stdscr):
    def init():
        #重置游戏棋盘
        game_field.reset()
        return 'Game'
    def not_game(state):
        #画出 GameOver 或者 Win 的界面
        game_field.draw(stdscr)
        #读取用户输入得到action,判断是重启游戏还是结束游戏
        action = get_user_action(stdscr)
        responses = defaultdict(lambda: state) #默认是当前状态,没有行为就会一直在当前界面循环
        responses['Restart'], responses['Exit'] = 'Init', 'Exit' #对应不同的行为转换到不同的状态
        return responses[action]

    def game():
        #画出当前棋盘状态
        game_field.draw(stdscr)
        #读取用户输入得到action
        action = get_user_action(stdscr)

        if action == 'Restart':
            return 'Init'
        if action == 'Exit':
            return 'Exit'
        if game_field.move(action): # move successful
            if game_field.is_win():
                return 'Win'
            if game_field.is_gameover():
                return 'Gameover'
        return 'Game'


    state_actions = {
            'Init': init,
            'Win': lambda: not_game('Win'),
            'Gameover': lambda: not_game('Gameover'),
            'Game': game
        }
    curses.use_default_colors()
    game_field = GameField(win=32)
    state = 'Init'
    #状态机开始循环
    while state != 'Exit':
        state = state_actions[state]()
curses.wrapper(main)

 

 

欢迎加我的群626062078

Linux下C语言2048游戏代码 Linux下C语言实现2048小游戏 立即下载

相关推荐

Linux2048(详细注释版-验证可运行)

Linux2048(详细注释版-验证可运行)

2048Linux环境下Python实现源码

2048 python实现

char1024的博客 459

Linux-2048

Linux下使用readline库实现2048游戏

python2048代码分析_200行Python代码实现2048

python果然是实践性的语言,跟着教程将一个个函数实现,学到了不少python编程的小技巧小细节。很棒的实验贴一下自己的代码虽然没什么卵用,,但是太短不让发布/!#coding: utf-8import cursesfrom random import randrange,choicefrom collections import defaultdictactions = ['Up','Left...

weixin_29074409的博客 341

基于linux的2048小游戏

基于linux的4*4格子休闲益智的小游戏,LCD的的图片显示和触摸算法,以及线程同步的音效实现。还有什么应该没有了吧。

2048小游戏源代码Linux平台

VI中,使用C语言编写的2048小游戏完整步骤,运行无忧~~

python2048_【python】2048

import curses #?from random importrandrange, choicefrom collections importdefaultdictletter_codes= [ord(ch) for ch in 'WASDRQwasdrq']actions= ['Up','Left','Down','Right','Restart','Exit']actions_dict...

weixin_39888018的博客 146

RH850_U2A系列HSM安全核开启但是固件未烧录导致无法启动也无法再烧入固件废板问题分析解决

hsm核导致的安全锁死补救方案

u011941262的博客 1745

python 简单实现2048,一看就会

文章目录一、介绍二、代码1.初始化2.循环主体3.Control4.Movemovemap()moveup()moveleft()merge()5.Mapaddone()isend()三、心得 直接在cmd中执行 core.py 即可启动2048. 一、介绍 一共五个.py文件,三个模块+两个辅助 【交互】control:获取键盘按键 【逻辑】move:根据移动的方向,修改map 【界面】map:显示面板、生成新数字、判断当前面板还能否操作 core:启动游戏 direction:一个.

卷子的博客 2055

手把手教你用SysMax桥接软件搞定CANoe、INCA和刷写工具(附驱动配置避坑点)

本文详细介绍了如何使用SysMax PCAN FD桥接软件实现CANoe、INCA和刷写工具的无缝对接,提供从驱动配置到多软件协同的全链路指南。重点解析了驱动安装避坑点、CANoe配置技巧、INCA集成方法以及刷写工具链优化方案,帮助汽车电子工程师构建高效开发环境。

weixin_30500105的博客 394

Claude Code教程(二) | Claude Code 核心信息与使用指南

Claude Code 核心信息与使用指南

qq_20236937的博客 2202

代码块(局部代码块、构造代码块、静态代码块)

代码块的概述 在Java中,使用{}括起来的代码被称为代码块 代码块的分类 根据位置和声明不同,可以分为局部代码块,构造代码块,静态代码块,同步代码块 局部代码块:在方法中出现,限定变量生命周期,及早释放,提高内存利用率 构造代码块(初始化块):在类中方法外出现 静态代码块:一般用于加载驱动 static{} 测试代码 public class face_code_questi...

清杉夫人 4911

WSL2深度学习环境搭建:CUDA与PyTorch配置指南

CUDA是NVIDIA的并行计算平台,通过显卡驱动直接调用GPU资源,为深度学习提供加速支持。在Windows系统中,WSL2以轻量级虚拟化技术运行完整Linux内核,实现GPU直通,让PyTorch等框架能高效利用本地显卡。这种方案避免了双系统切换,兼顾开发便利与计算性能,适用于图像分类、模型训练等场景。本文详细记录在WSL2中配置Ubuntu、CUDA Toolkit、cuDNN及PyTorch的完整流程,并分享常见问题排查与性能优化经验。

weixin_30522983的博客 221

【Java 学习】详讲代码块:控制流语句代码块、方法代码块、实例代码块(构造代码块)、静态代码块、同步代码块

学习Java编程语言时,理解代码块的概念是非常重要的。代码块是Java中的基本组成部分之一,它允许你将一组语句组织在一起,以便可以作为一个单元进行处理。控制流语句代码块用于定义特定条件下执行的代码,如if、for、while等。方法代码块是方法体内部的代码,执行具体任务。实例代码块(构造代码块)在对象创建时执行,用于初始化实例变量。静态代码块在类加载时执行,用于初始化静态变量。同步代码块使用synchronized关键字,确保多线程环境下的线程安全。这些代码块各有用途,控制程序流程和资源访问。

Code哈哈笑的博客 6209

什么是 Agent 的 Context Window?为什么它是 Agent 工程中最核心的约束之一?

什么是 Agent 的 Context Window?为什么它是 Agent 工程中最核心的约束之一?

我哎GIS博客 825

支付宝域名如何加入白名单(扫码老是弹窗)

支付宝扫码之后,遇到非支付宝官方网页,请确认是否继续访问弹窗,问题解决办法。本章教程提供解决办法,亲测有效。

猿小白的博客 9238

java 代码块(局部代码块、实例代码块、静态代码块、同步代码块)

1 引言 代码块是类的成分之一:成员变量,方法,构造器,代码块,内部类。 在Java中,使用 { } 括起来的代码被称为代码块(Code block) 1.1 代码块的分类 根据其位置和声明的不同,可以分为: 局部代码块:用于限定变量生命周期,及早释放,提高内存利用率。 静态代码块:主要用于对静态属性进行初始化。 实例(构造)代码块:调用构造方法都会执行,并且在构造方法前执行。 同步代码块:一种多线程保护机制。 2 局部代码块 在方法中出现,可以限定变量生命周期,及早释放,提高内存利用率。 2.1 示例

冰茶不冰的博客 1万+

Java数据可视化实战:基于JFreeChart的数学函数绘图工具开发

JFreeChart是一个开源的Java图表库,适用于Swing和JavaFX应用程序。折线图和面积图柱状图和饼图散点图和气泡图组合图表3D图表等实现自定义数学表达式解析:java复制下载throw new IllegalArgumentException("表达式不能为空");// 验证表达式try {}");throw new IllegalArgumentException("无效的数学表达式: " + e.getMessage());try {

2201_76125393的博客 371

【java】代码块详解,静态代码块与非静态代码块

如果成员变量想要初始化的值不是一个硬编码的常量值,而是需要通过复杂的计算或读取文件、或读取运行环境信息等方式才能获取的一些值,该怎么办呢?此时,可以考虑代码块(或初始化块)。一个类中代码块若有修饰符,则只能被static修饰,称为静态代码块(static block),没有使用static修饰的,为非静态代码块。

共同学习,共同成长 3296

14、网络切片技术:原理、应用与挑战

本文详细探讨了网络切片技术的原理、应用场景及其在5G网络中的重要性。网络切片作为一种关键的网络架构技术,能够在同一物理网络上创建多个独立的逻辑网络,以满足不同应用对安全性、可靠性和性能的多样化需求。文章深入分析了网络切片在5G、SDN/NFV等技术背景下的发展与挑战,并探讨了其在制造业、交通运输、零售等多个行业的实际应用。此外,还介绍了网络切片的部署流程、未来发展趋势以及相关技术难点,为读者全面了解网络切片技术提供了有价值的参考。

palm99的专栏 262

vb 6.0并口开发操作实例

vb6并口开发,简体中文,试例内有inpout32.dll动态链接库

什么是美的代码和丑的代码?

在软件开发领域,代码不仅是实现功能的工具,也是程序员之间沟通的桥梁。代码的美学,即代码的整洁度、可读性和可维护性,对于项目的长期成功至关重要。本节将探讨美与丑代码的定义,并强调代码美学在软件开发中的重要性。美的代码通常指的是那些结构清晰、逻辑简洁、命名规范、风格一致且注释充分的代码。这样的代码不仅易于阅读和理解,也便于其他开发者进行维护和扩展。美的代码就像是一首精心编排的交响乐,每个部分都和谐地协同工作,共同创造出优美的程序。相反,丑的代码。

Python老吕的博客 1680

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

代码之美——代码整洁之道

代码之美有很多方面,可以谈高级编程语言以及各语言的框架/类库,也可以聊算法和数据结构,还可以谈操作系统内核或是层出不穷的中间件,不过这里我们看最不起眼的代码整洁之道。

京东零售技术的博客 2876

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

好代码 ,坏代码:你的代码和其他工程师的代码

如果你以团队一员的身份编写代码,你所编写的代码很可能建立在其他工程师编写的代码层次的基础上,其他人也可能以你的代码为基础构建新的代码层次。如果你在工作期间解决了各种各样的子问题,并将其分解为清晰的抽象层次,其他工程师也有可能重用其中一些代码,去解决你可能没有考虑过的、完全不同的问题。

人邮异步社区 1713

低代码专题:什么是低代码,什么是零代码,二者的区别与联系

从企业规模来看——中小企业/轻量级业务:闭眼选简道云,省钱+够用。中大型企业/复杂流程:轻流(舍得花钱)或织信Informat(有IT团队)。钉钉深度用户:奥哲氚云,别折腾。技术导向型公司:华为AppCube或得帆,灵活性高。从功能要求来看——要复杂系统→织信Informat(私有部署+生态强)要钉钉集成→氚云(深度捆绑省心)要数据分析→简道云(BI血统碾压)要极致流程→轻流(审批流天花板)要财务专业→用友(老牌ERP基因)要华为生态→AppCube(硬件联动爽)

weixin_52213728的博客 1353

什么样的代码才是优秀的代码

一,什么样的代码才是优秀的代码 许多去 Google 参观的人,用完洗手间后,都会惊奇而略带羞涩地问:“你们马桶前面的门上,贴着的 Python 编程规范,是用来搞笑的吗?”。搞不搞笑不知道,但是可以看出Google 对编码规范的要求极其严格。今天,我们就来聊聊编程规范这件事儿。 当然了,搞定编程规范写出优秀的代码之前我们得先搞清一个问题,那就是什么样的代码才是优秀的代码?代码又是写给谁的?代码不规范会有什么问题吗?我相信不管是新手还是老鸟可能都有一些这样的疑问,甚至很多新人对于代码规范这个事抱有很多不

关注后厂程序员 2926

驱动代码、桩代码、MOCK代码

驱动函数、桩函数、MOCK函数 欢迎使用Markdown编辑器 你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。 新的改变 功能快捷键 撤销:Ctrl/Command + Z 重做:Ctrl/Command + Y 加粗:Ctrl/Command + B 斜体:Ctrl/Command + I 标题:Ctrl/Command + Shift + H 无序列表:Ctrl/Command

阿may的博客 4016
上一篇: Python实现小游戏--2048
下一篇: Python数据分析之读取文件
敲代码的猴
博客等级 码龄10年 126粉丝 61原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址