彩票种类很多,先来一个福彩3d走势图的批处理。数据源来自乐彩网。
代码经过极度优化,几乎可在3秒内就能绘制完全部十几年的3D走势图,txt打开禁用自动换行,效果蛮不错,提供了试机号、销售详情、和值、路线等多种参考数值。- @echo off&title
- setlocal enabledelayedexpansion
- mode con cols=45 lines=12
- color 0f
-
-
- :main
- echo 福彩·3D 走势绘制
- echo ...
-
-
- ::开始计时
- set t1=!time:~-5!
-
-
- ::设置走势图变量
- set "0=0 "
- set "1=■1 "
- set "2=■■2 "
- set "3=■■■3 "
- set "4=■■■■4 "
- set "5=■■■■■5 "
- set "6=■■■■■■6 "
- set "7=■■■■■■■7 "
- set "8=■■■■■■■■8 "
- set "9=■■■■■■■■■9"
-
-
- (
- echo _________________________________________________________________________________________________________________________________________________________________________________________________________
- echo 丨 期号 丨 日期 丨 试机号丨 机丨 开奖号 丨 百位 丨 十位 丨 个位 丨和值 丨 路线 丨 销售金额 丨 中奖详情
- echo _________________________________________________________________________________________________________________________________________________________________________________________________________
- echo _________________________________________________________________________________________________________________________________________________________________________________________________________
- for /f "tokens=1-17" %%h in (3d.TXT) do (
- set "dis= "
- set "sdis= "
- set "ye=%%i"
- set/a "num=%%u+%%w,sum=%%j+%%k+%%l,pan=(%%j-%%k)*(%%k-%%l)*(%%l-%%j),span=%%j+%%k-2*%%l,sin1=%%j%%2,sin2=%%k%%2,sin3=%%l%%2,road1=%%j%%3,road2=%%k%%3,road3=%%l%%3,pan2=sin1+sin2-2*sin3"
- if !sum! lss 10 (set "sum= !sum!")
- if !pan! equ 0 (set "dis=*" &if !span! equ 0 (set "sdis=豹"))
- if !pan2! equ 0 (if !sin1! equ 0 (set nis=偶) else (set nis=奇)) else (set "nis= ")
- if "!ye:~5,1!"=="0" (set "mon= !ye:~6,1!") else (set "mon=!ye:~5,2!")
- if "!ye:~-2,1!"=="0" (set "da= !ye:~-1!") else (set "da=!ye:~-2!")
- if %%r lss 100000 (set "x1="&set "x2="&set "x3=") else (set x1=总计%%r元 &set x2=单选%%s注 &set x3=组选!num!注)
- echo 丨第 %%h 期丨 !mon!月!da!日 丨(%%m%%n%%o)丨%%p-%%q丨!nis!!sdis! %%j%%k%%l !dis!丨百!%%j! 丨十!%%k! 丨个!%%l! 丨和 !sum!丨 !road1!,!road2!,!road3! 丨 !x1! !x2! !x3!
- )
- echo _________________________________________________________________________________________________________________________________________________________________________________________________________
- )>3db
-
-
- for /f %%a in ('find /c /v ""^<3d.TXT') do (set/a i=%%a,l=i-1)
- for /f "tokens=1" %%a in ('more +!l! 3d.TXT') do (set/a head2=%%a)
- (set /p head1=)<3d.TXT
-
-
- (
- echo 福彩3D开奖数据
- echo;
- echo 第!head1:~0,7!期 ~ 第!head2!期 共计!i!期 *代表组三
- )>3dh © /b 3dh+3db 福彩3D走势图.txt 1>NUL 2>NUL
-
-
- ::毫秒计时器
- set t2=!time:~-5! &set/a "t=1!t2:.=!-1!t1:.=!" &if !t! lss 0 (t+=6000)
- echo 用时!t:~0,-2!秒!t:~-2!0毫秒
-
-
- start 福彩3D走势图.txt
- del 3dh &del 3db
- set/p=
复制代码 绘制完的走势图过于庞大,不便查询,于是用批处理模拟数据库,实现了包括关键字查询、子查询等功能。- @echo off
- title 3D Speed
- setlocal enabledelayedexpansion
- mode con cols=45 lines=12
- color 0f
-
- :main
- set i=0
- set tp=%0
- set ctp=%0
- set "tx="
-
- :mainA
- cls
- echo ■■ ■■ %date%
- echo ■ ■ ■
- echo ■ ■ ■
- echo ■ ■ ■ ____________________
- echo ■■ D■■ 丨Copyright2016~2018
- echo ________________!tx!
- set "str="
- set /a i+=1
- set /p str=第!i!级查询:
- if "!str!"=="sys" (
- echo [系统信息] %date%>.\sysinfo.ini
- echo __________________________________________________________________________________>>.\sysinfo.ini
- systeminfo>>.\sysinfo.ini
- start .\sysinfo.ini
- goto main
- )
- if "!str!"=="" goto main
- set "tp=!ctp!"
- set "tx=!tx!!str!’"
- if "!str!"=="0" (goto main)
- if "!str!"=="." (set "str=奇"&goto search)
- if "!str!"==".." (set "str=偶"&goto search)
- if "!str!"=="..." (set "str=豹"&goto search)
- if "!str:~1,1!"=="," (goto search)
- if "!str:~0,1!"=="." (set "str=(!str:~1,3!)"&goto search)
- if "!str:~1,1!"=="." (set "str=和 !str:~0,1!"&goto search)
- if "!str:~2,1!"=="." (set "str=和 !str:~0,2!"&goto search)
- if "!str:~1,1!"=="" (set "str=!str!月"&goto search)
- if "!str:~2,1!"=="" (set "str=!str!月"&goto search)
- if "!str:~3,1!"=="" (set "str= !str! "&goto search)
- if "!str:~7,1!"=="" (set "str=第 !str!"&goto search)
-
- :search
- if not exist .\logs (md .\logs)
- set ctp=.\logs\"!i!Src!str!.txt"
- if exist !ctp! (if "!i!"=="1" (goto last))
- echo !i!级查询:"!str!">!ctp!
- echo ___________________________________________________________________________________________________________________________________________________________ _________________________________>>!ctp!
- echo 丨 期号 丨 日期 丨 试机号丨 机丨 开奖号 丨 百位 丨 十位 丨 个位 丨和值 丨 路线 丨丨 销售金额 丨 中出 >>!ctp!
- echo ___________________________________________________________________________________________________________________________________________________________ _________________________________>>!ctp!
- echo ___________________________________________________________________________________________________________________________________________________________ _________________________________>>!ctp!
- find "!str!" <!tp!>>!ctp!
- echo ___________________________________________________________________________________________________________________________________________________________ _________________________________>>!ctp!
-
- :last
- start !ctp!
- goto mainA
- 丨第 2002001 期丨 1月 1日 丨(526)丨2-2丨 073 丨百0 丨十■■■■■■■7 丨个■■■3 丨和 10丨 0,1,0 丨
- 丨第 2002002 期丨 1月 2日 丨(203)丨1-1丨 237 丨百■■2 丨十■■■3 丨个■■■■■■■7 丨和 12丨 2,0,1 丨
- REM 后边省略5000行数据,可由上一个批处理得到。
- ...
复制代码 这个查询的大致用法是- 3D速查用法,查期数、年数、月数、开奖号码等直接输入数字即可查询;
- 查试机号需要在前面加个点,比如需要查询试机号为315的期数,应输入 ".315"
- 查和值在数字后加个.比如需要查询和值为9的期数,应输入 "9."
- 查全奇号输入"."
- 查全偶号输入".."
- 查豹子号输入"..."
- 3D速查(自动递归)版,无需回车直接层层递归查询,无内容回车直接回到一级查询
- 3D速查则需要输入回车才能进入下一级查询,输入0才能回到一级查询
- 输入"sys"可以查看当前系统信息
复制代码 最后照猫画虎,改出双色球走势图的绘制bat复制代码 |