Board logo

标题: [游戏娱乐] 批处理 7 段数码管 [打印本页]

作者: neorobin    时间: 2014-9-30 17:02     标题: 批处理 7 段数码管

本帖最后由 neorobin 于 2014-10-1 20:15 编辑
  1. @echo off & setlocal enabledelayedexpansion & color 0a
  2. set LF=^
  3. for /l %%i in () do (
  4.     set /a "t=!time:~-4,1!" & set /a "t ^= x, x ^= t"
  5.     if !t! neq 0 (
  6.         set /a "c = ^!^!(x-2)"
  7.         set /a "b = ^!^!(x-5)&^!^!(x-6)"
  8.         set /a "a = (^!^!(x-1) & ^!^!(x-4)) << 1"
  9.         set /a "d = (a >> 1 & ^!^!(x-7)) << 1"
  10.         set /a "g = ^!(^!x | ^!(x-1) | ^!(x-7)) << 1"
  11.         set /a "f = (^!(x&3) | ^!^!(x&~3)) & ^!^!(x-7)"
  12.         set /a "e = ~x & 1 & ^!^!(x-4)"
  13.         set "O= !a!!LF!!f! !b!!LF! !g!!LF!!e! !c!!LF! !d!"
  14.         set "O=!O:1=|!" & set "O=!O:2=-!" & cls & echo !O:0= !
  15.     )
  16. )
复制代码
数码管时钟
  1. set "_c="c = !!(x-2)""
  2. set "_b="b = !!(x-5)^&!!(x-6)""
  3. set "_a="a = (!!(x-1) ^& !!(x-4)) ^<^< 1""
  4. set "_d="d = (!!(x-1) ^& !!(x-4) ^& !!(x-7)) ^<^< 1""
  5. set "_g="g = !(!x ^| !(x-1) ^| !(x-7)) ^<^< 1""
  6. set "_f="f = (!(x^&3) ^| !!(x^&~3)) ^& !!(x-7)""
  7. set "_e="e = ~x ^& 1 ^& !!(x-4)""
  8. @echo off & setlocal enabledelayedexpansion & color 0a & mode 33,5
  9. set "__=0" & set "_= "
  10. for /l %%i in () do (
  11.     set /a "t=!time:~-2,1!" & set /a "t ^= z, z ^= t"
  12.     if !t! neq 0 (
  13.         set "O=" & set "i=0"
  14.         for %%L in ("_ a _" "f _ b" "_ g _" "e _ c" "_ d _") do (
  15.             for %%d in (0 _ 1 _ : _ 3 _ 4 _ : _ 6 _ 7 _ : _ 9) do (
  16.                 if "%%d" geq "0" (
  17.                     set "tm=!time: =0!" & set "x=!tm:~%%d,1!"
  18.                     for %%_ in (%%~L) do set /a !_%%_! & set "O=!O!!%%_!"
  19.                 ) else if "!i!%%d"=="1:" (set "O=!O!.") else set "O=!O! "
  20.             )
  21.             set /a "i^=1"
  22.         )
  23.         set "O=!O:1=|!" & set "O=!O:2=-!" & cls & set "O=!O:0= !"
  24.         <nul set /p=!O:~0,-1!
  25.     )
  26. )
复制代码

作者: Linuxer    时间: 2014-9-30 18:30

漂亮~~~效果不错啊。。。看起来好难理解。。
作者: 523066680    时间: 2014-9-30 19:56

回复 2# Linuxer


    我们欣赏就可以了
作者: CrLf    时间: 2014-10-1 21:43

回复 3# 523066680


    卧槽,为毛你能加 6 技术分!我只有 +1 的选项,填其他的就超过限制
作者: 523066680    时间: 2014-10-1 21:55

回复 4# CrLf


    因为我是两个区的斑竹……
作者: CrLf    时间: 2014-10-1 22:09

回复 5# 523066680


    噢,原来是这样啊,好吧
管理以下版块: BAT求助&讨论, 原创BAT代码, PowerShell
作者: 523066680    时间: 2014-10-1 22:12

回复 6# CrLf


    还有注册时间……
作者: CrLf    时间: 2014-10-1 22:35

回复 7# 523066680


    妈蛋,早出生了不起啊,拼爹呢这是
作者: xxpinqz    时间: 2014-10-2 01:11

我觉得这个号注册时间也很早的,为啥连pb都加不了。。。。
作者: CrLf    时间: 2014-10-2 17:29

回复 9# xxpinqz


    速度申请斑竹、贵宾或技术组之类的任意头衔
    我说咱几个是不是跑题了
作者: xxpinqz    时间: 2014-10-2 22:14

回复 10# CrLf


    跑题不要紧,只要心意真。


天书啊,完全看不懂。




欢迎光临 批处理之家 (http://bathome.net./) Powered by Discuz! 7.2