标题: [其他] 批处理电子钟表 [打印本页]
作者: canyuexiaolang 时间: 2012-5-19 18:00 标题: 批处理电子钟表
跟neorobin比起来无论是效率还是代码长度都差了很多。。我擦又让炎凉了。。
- ::Code by Canyuexiaolang 2012-5-15
-
- @echo off & setlocal enabledelayedexpansion &mode con:cols=81 lines=5 & title 电子表 By Canyuexiaolang & color F
- (
- set "char0=1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1"
- set "char1=2 1 2 2 1 2 2 1 2 2 1 2 2 1 2"
- set "char2=1 3 1 3 1 1 1 3 1 1 1 3 1 3 1"
- set "char3=1 3 1 3 1 1 1 3 1 3 1 1 1 3 1"
- set "char4=1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 1 3 1 1"
- set "char5=1 3 1 1 1 3 1 3 1 3 1 1 1 3 1"
- set "char6=1 3 1 1 1 3 1 3 1 1 1 1 1 1 1 3 1"
- set "char7=1 3 1 3 1 1 3 1 1 3 1 1 3 1 1"
- set "char8=1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1"
- set "char9=1 3 1 1 1 1 1 1 1 3 1 3 1 1 1 3 1"
- set "char10=5 2 1 2 5 2 1 2 5"
- )
- for /l %%u in (0 0 0) do (
- (
- setlocal
- set "str=!time!"
- if "!str:~0,1!"==" " set "str=0!str:~1,7!"
- )
- (
- for /l %%i in (0 1 7) do (
- set "char=!str:~%%i,1!"
- for /l %%x in (0 1 9) do (
- if "!char!"=="%%x" (
- set "num=1"
- for %%y in (!char%%x!) do (
- set /a temp+=%%y
- call set "line!num!=%%line!num!%% %%y"
- if !temp! equ 5 set /a temp=0,num+=1
- )
- )
- )
- if "!char!"==":" (
- set "num=1"
- for %%y in (!char10!) do (
- set /a temp+=%%y
- call set "line!num!=%%line!num!%% %%y"
- if !temp! equ 5 set /a temp=0,num+=1
- )
- )
- )
- for /l %%i in (1 1 5) do (
- for %%j in (!line%%i!) do (
- set /a temp+=%%j,borw+=1
- set /a bw=borw%%2
- if !bw! equ 1 for /l %%z in (1 1 %%j) do set "lines=!lines!■"
- if !bw! equ 0 for /l %%z in (1 1 %%j) do set "lines=!lines! "
- if !temp! equ 5 set /a temp=0,borw=0
- )
- )
- )
- (
- for /l %%i in (0 1 1000) do ver>nul
- set /p=!lines!<nul
- endlocal
- )
- )
复制代码
这个是我的。。我顺便把neorobin也发过来吧。。。
- @echo off & setlocal enabledelayedexpansion & mode con cols=54 lines=6 & color 0a
- for %%a in (4 1 2 1 2 1 4 2 1 2 1 2 1 2 1 2 4 2 5 2 6 2 4 2 5 1 2
- 1 4 2 1 2 5 2 3 2 8 2 4 1 7 2 1 2 1 2 1 2 5 1 5 1 8 1 4 2 4) do (
- set /a cc=~cc
- for /l %%i in (1,1,%%a) do (if !cc!==0 (set dgts=!dgts! ) else (set dgts=!dgts!■))
- )
- for /l %%z in (0 0 0) do (
- if "!time:~7,1!" neq "!sec!" (
- set "sec=!time:~7,1!" & set "oc="
- for /l %%h in (0,1,4) do (
- for %%d in (0 sp 1 sp : sp 3 sp 4 sp : sp 6 sp 7) do (
- if "%%d"==":" (set /a tt=%%h*5&if "!tt:~-1!"=="0" (set oc=!oc! ) else set oc=!oc!●) else (
- if "%%d"=="sp" (set oc=!oc! ) else (
- set "timeP=!time: =0!"&set /a s=!timeP:~%%d,1!*15+%%h*3
- for %%o in (!s!) do set "oc=!oc!!dgts:~%%o,3!"
- ))))&cls & set /p=!oc!<nul))
复制代码
- - 郁闷了
作者: 0123456789 时间: 2013-1-15 16:10
要是带闹钟的功能就好了。。。
作者: nhygvfr 时间: 2013-1-25 17:34
回复 2# 0123456789
把它稍稍修改一下,可以变成“两条代码的奇迹”…
作者: 522235677 时间: 2013-4-3 10:57
牛掰,佩服。
作者: Roxx 时间: 2024-4-10 23:07
显示有问题啊
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |