@cyysu
2017-10-12T10:21:09.000000Z
字数 641
阅读 933
- 时间:2017年10月11日
- 作者:Kali
- 邮箱:cyysu.github.io@gmail.com/2869905223@qq.com/微信lwyx1413
- 版本:4.0
- 描述:批处理实战基础篇八,本次主要给出几个栗子。
Bat系列教程
@echo off&mode con cols=42 lines=20&color 0c
setlocal enabledelayedexpansion
title 数码雨-zw19750516
set code=1 2 3 4 5 6 7 8 9 a b c d e f 0 &set m=1&set v=1
:: 字符串替换操作 就是将空格替换为没有空格的
set code1=!code: =!
:begin
:: %random% 为变量 %%表示取余数
set /a a=%random%%%48
set a=!code:~%a%,1!
set str%m%=!str%m%!%a%
set /a n+=1
if %n% lss 40 goto begin
set /a x+=1
:: 条件满足替换颜色背景
if %x% equ 20 call :lp
cls
for /l %%i in (%m%,-1,%v%) do echo !str%%i!
set /a m+=1
if %m% geq 20 set /a v+=1
set n=0&goto begin
:: 更改颜色标签
:lp
set /a a=%random%%%15
:: 表示取code1中第%a%位置后的下一个字符
set a=!code1:~%a%,1!
color 0%a%&set x=0
支付宝 微信