0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

.batでシューティングゲーム

0
Last updated at Posted at 2026-10-29

バッチでシューティングゲーム(もどき)を作りました。

なんか

偶に、球がすり抜けますが『仕様』です。

コード

@echo off
setlocal enabledelayedexpansion
set /a p=0
cls
for /L %%i in (1,1,8) do set /a queue%%i=111111111, line%%i=0
set /a me=10000
:loop

if !p! leq -1 pause >nul & goto :e

set /a queue1=111111111 + !me!

for /L %%i in (1,1,8) do set /a q%%i=!queue%%i! + !line%%i!

echo !p!
echo;

set "a=!q1:6=9!
set "a=!a:4=9!
if not "!q1!"=="!a!" pause >nul & goto :e

for %%i in (q8 q7 q6 q5 q4 q3 q2 q1) do (
set "tmp=!%%i!"
for /f "delims=" %%A in ("!tmp!") do (
set "display=%%A"
set "display=!display:6=#!"
set "display=!display:5=.!"
set "display=!display:4=↓!"
set "display=!display:3=↑!"
set "display=!display:2=@!"
set "display=!display:1=.!"
echo !display!
)
)

for /L %%i in (1,1,8) do (
set "qq%%i=!q%%i:6=1!"
if not "!qq%%i!"=="!q%%i!" set /a line%%i=0, p+=10
)

if !ef! equ 1 (
set /a random1=!random! %% 20, ene=1, zf=0
if not !random1! equ 0 (
for /L %%i in (1,1,!random1!) do set /a ene*=10
) else (
set /a zf=1
)
if !random1! geq 9 set /a zf=1
if !zf! equ 1 set /a ene=0

set /a line1=!line2!
set /a line2=!line3!
set /a line3=!line4!
set /a line4=!line5!
set /a line5=!line6!
set /a line6=!line7!
set /a line7=!line8!
set /a line8=!ene! * 3
set /a ef=0
) else (
set /a ef=1
)

set "que="
set /p que="choice: "
set "que=!que:~0,1!"

set /a queue8=!queue7!
set /a queue7=!queue6!
set /a queue6=!queue5!
set /a queue5=!queue4!
set /a queue4=!queue3!
set /a queue3=!queue2!
set /a queue2=111111111


if /i "!que!"=="r" set /a queue2=!queue2! + !me! * 2, p-=20
if not !me! equ 100000000 (
if /i "!que!"=="q" (
set /a queue2=!queue2! + !me! * 2, queue3=!queue3! + !me! * 2
set /a queue2=!queue2! + !me! * 20, queue3=!queue3! + !me! * 20
set /a queue2=!queue2! + !me! * 2 / 10, queue3=!queue3! + !me! / 10 * 2
set /a p-=150
)
)
if /i "!que!"=="x" (
set /a queue2+=222222222, queue2=!queue2! + 222222222, p-=200
)



if /i "!que!"=="a" set /a me*=10
if /i "!que!"=="d" set /a me/=10

set /a p+=10

cls
goto :loop
:e
for /L %%j in (1,1,3) do (
echo;
timeout /t 1 /nobreak >nul
)
echo (c)PYRROLINE
timeout /t 1 /nobreak >nul
goto:eof

不具合や改善案等がありましたら、コメントしていただけると幸いです。

ライセンス

私はこの記事に含まれるコードをCC BY-NC-SA 4.0 の下で提供します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?