我修了后面部分(这次总算能看懂代码来修改了……)
@echo off&rem Code by netbenton from BatHome
pushd "%~dp0"
start cmd /c debug.exe ^<"%~nx0"
:zz
if not exist tt.tmp goto :zz
ren tt.tmp tt.exe
set ech=!e00!!e01!!e02!!e03!!e04!!e05!!e06!!e07!!e08!!e09!
set ech=%ech%%ech:e0=e1%
set ech=%ech:!!=!!cr!!%!cr!
set #=00
set v=0
set fen=40
title BatHome
start "批处理赛车 控制台" cmd.exe /c mode con:cols=26 lines=2^&set/p=A左 D右 Ctrl+c退出^<nul^&tt.exe^&del tt.exe
color 0d&set cr=^
:restart
setlocal enabledelayedexpansion
set x=17
set "hey="
set/a r=13,rn=1,rm=0,live=20,tp=0
for /l %%a in (1,1,10) do set "spac= !spac!"
for /l %%a in (1,1,20) do (
set ech=!ech:~-9!!ech:~0,-9!
set !ech:~1,3!=!spac:~0,%r%!^|.........^|
)
:loop
set/a n+=1,nn=n%%20+100
set m=!nn:~-2!
set ech=!ech:~-9!!ech:~0,-9!
set !ech:~1,3!=!spac:~0,%r%!^|.........^|
set /a y=x+3
set che=!%ech:~-17,3%:~0,%x%!o0o!%ech:~-17,3%:~%y%!
set %ech:~-17,3%=!che!
set %ech:~-8,3%=!%ech:~-8,3%:~0,%x%!oXo!%ech:~-8,3%:~%y%!
(
cls&echo %ech%!cr! BAT-F3 BP:!live! TP:!tp! !hey!
if "!che:.......=!" neq "!che!" (
set/a live-=1
set "hey=碰壁了, 注意 live - !live!"
) else (set hey=)
if !live! lss 0 goto ver
for /l %%a in (1,1,120) do (
ver >nul
set ##=!#!&set #=00
if !##! equ 64 set /a x+=1
if !##! equ 61 set /a x-=1
if !##! equ 71 exit/b
if !##! equ 3 exit/b
)
set/a rk-=1
if !rk! lss 0 (
set/a rn=rn-1,r=r+rm,rk=!random!%%3
if !r! lss 0 set/a r=0,rn=-1
if !r! gtr 60 set/a r=60,rn=-1
)
if !rn! lss 0 (
set /a rm=!random!%%3-1,rn=!random!%%8,tp=tp+1
if !rm! equ 0 set/a rn-=5
)
for /l %%a in (1,1,250) do ver >nul
goto :loop)
:over
echo GAME OVER^! Press any key to continue...
:o_loop
for /l %%a in (1,1,5200) do ver >nul
if !#! equ 00 goto :o_loop
if !#! equ 3 exit/b
endlocal&goto :restart
开个玩笑,跑道来个这样的曲线- @echo off
- setlocal enabledelayedexpansion
- title 蜿蜒曲线2
- rem Author: XXXX
- for /l %%a in (1,1,80) do (set spc= !spc!)
- set /a xadd=1,xaddadd=1
-
- :a
- echo,!spc:~0,%x%!*
- set /a i=0,x+=xadd,xadd+=xaddadd
- if %xadd:-=% gtr 7 (set /a xaddadd=-xaddadd)
- ping -n 1 127.0.0.1>nul
- goto :a
复制代码
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
[ 本帖最后由 PakTC 于 2010-1-27 20:13 编辑 ] |