|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『楼 主』:
523066680编辑区
使用 LLM 解释/回答一下
@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :funa na %inp%
call :funa nb %inp:* =%
set /a lpna=0,lpr=-1
:lpna
set /a lpna+=1,lpnb=0,lpr+=1,lp=lpr
:lpnb
set /a lpnb+=1,lp+=1
::::::::::::::::::::::::::
set /a cup%lp%+=na%lpna%*nb%lpnb%
set /a tlpa=lp,tlpb=tlpa+1
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)
::::::::::::::::::::::::::
if %lpnb% lss %nb% (goto :lpnb)
if %lpna% lss %na% (goto :lpna)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
echo,
echo,wscript.echo %inp: =*%>x.vbs
cscript //nologo x.vbs
pause>nul &exit
:funa
set %1=%2
set funaa=0
:funaa
set /a funaa+=1
set %1%funaa%=!%1:~-%funaa%,1!
if not "!%1:~%funaa%!"=="" (goto :funaa)
set /a %1=funaa
版本2
@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :naxnb %inp%
pause
:naxnb
set numa=%1
set numb=%2
set /a la=0,lpr=-1
:la
set /a la+=1,lb=0,lpr+=1,lp=lpr
:lb
set /a lb+=1,lp+=1,tlpa=lp,tlpb=lp+1
:::::::::::::::::::::::::
set /a cup%lp%+=!numa:~-%la%,1! * !numb:~-%lb%,1!
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)
::::::::::::::::::::::::::
if not "!numb:~%lb%!"=="" (goto :lb)
if not "!numa:~%la%!"=="" (goto :la)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
::::::::vbs验证一下:::::::::::
echo,
echo,wscript.echo %inp: =*%>x.vbs
cscript //nologo x.vbs
pause>nul &exit
Last edited by 523066680 on 2009-2-21 at 10:46 ]
@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :funa na %inp%
call :funa nb %inp:* =%
set /a lpna=0,lpr=-1
:lpna
set /a lpna+=1,lpnb=0,lpr+=1,lp=lpr
:lpnb
set /a lpnb+=1,lp+=1
::::::::::::::::::::::::::
set /a cup%lp%+=na%lpna%*nb%lpnb%
set /a tlpa=lp,tlpb=tlpa+1
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)
::::::::::::::::::::::::::
if %lpnb% lss %nb% (goto :lpnb)
if %lpna% lss %na% (goto :lpna)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
echo,
echo,wscript.echo %inp: =*%>x.vbs
cscript //nologo x.vbs
pause>nul &exit
:funa
set %1=%2
set funaa=0
:funaa
set /a funaa+=1
set %1%funaa%=!%1:~-%funaa%,1!
if not "!%1:~%funaa%!"=="" (goto :funaa)
set /a %1=funaa
Version 2
@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :naxnb %inp%
pause
:naxnb
set numa=%1
set numb=%2
set /a la=0,lpr=-1
:la
set /a la+=1,lb=0,lpr+=1,lp=lpr
:lb
set /a lb+=1,lp+=1,tlpa=lp,tlpb=lp+1
:::::::::::::::::::::::::
set /a cup%lp%+=!numa:~-%la%,1! * !numb:~-%lb%,1!
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)
::::::::::::::::::::::::::
if not "!numb:~%lb%!"=="" (goto :lb)
if not "!numa:~%la%!"=="" (goto :la)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
::::::::vbs验证一下:::::::::::
echo,
echo,wscript.echo %inp: =*%>x.vbs
cscript //nologo x.vbs
pause>nul &exit
Last edited by 523066680 on 2009-2-21 at 10:46 ]
|

综合型编程论坛
我的作品索引 |
|
2009-2-13 18:49 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
  『第 2 楼』:
使用 LLM 解释/回答一下
2016-09 Update link address:
Articles
Batch Rename's Bug
http://www.cn-dos.net/forum/viewthread.php?tid=45655
TalkAboutString
http://www.cn-dos.net/forum/viewthread.php?tid=45654
Improvement of Paragraph Redirection Method
http://www.cn-dos.net/forum/viewthread.php?tid=45409
2 times ping1 is not equal to 1 time ping2
http://www.cn-dos.net/forum/viewthread.php?tid=45410
%var% instead of statement execution
http://www.cn-dos.net/forum/viewthread.php?tid=45240
Snake Idea Analysis (23rd floor)
http://www.cn-dos.net/forum/viewthread.php?tid=43369
Establishing a Permanent Abnormal Drive Letter
http://www.cn-dos.net/forum/viewthread.php?tid=41796
Mathematics related:
Batch Processing to Calculate 24 Points
http://www.cn-dos.net/forum/viewthread.php?tid=45488
Square Root of Integers from 1 to 99
http://www.cn-dos.net/forum/viewthread.php?tid=43046
Applications:
Can the Process Name of a Batch Script be Changed? (The solution is found in the link on the 24th floor.)
http://www.cn-dos.net/forum/viewthread.php?tid=42169
How to Implement Standby and Open Screen Saver with Script?
http://www.cn-dos.net/forum/viewthread.php?tid=45522
Batch Script Packaging Tool
http://www.cn-dos.net/forum/viewthread.php?tid=44620
Shutdown After 1 Hour
http://www.cn-dos.net/forum/viewthread.php?tid=45242
Generate Test Scripts to be Written
http://www.cn-dos.net/forum/viewthread.php?tid=45250
List the Current Smallest and Largest bat Files
http://www.cn-dos.net/forum/viewthread.php?tid=41517
Batch Renaming in 001, 002, 003 Format
http://www.cn-dos.net/forum/viewthread.php?tid=41643
Entertainment, Special Effects:
Digital Matrix Appears Point by Point, Random
http://www.cn-dos.net/forum/viewthread.php?tid=45878
Batch Processing to Write Large Character Effect - New Year Greeting Card
http://www.cn-dos.net/forum/viewthread.php?tid=45411
Animation Special Effects: Drawing Circles, Bouncing Balls, Progress Bars, Rising and Falling, etc.
http://www.cn-dos.net/forum/viewthread.php?tid=42124
Pure Batch Processing Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43369
Gradually Larger Circle in the Middle
http://www.cn-dos.net/forum/viewthread.php?tid=44785
Spatial Random Walking Particles + Initial Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43059
【Visual Category】Advancing Road + Airplane and Cannon
http://www.cn-dos.net/forum/viewthread.php?tid=41333
【Visual Category】Square Frame Gradually Expanding from the Middle and Then Becoming Smaller + Changing Color
http://www.cn-dos.net/forum/viewthread.php?tid=40711
Clock - Italic + Milliseconds (Updated, Reduced CPU and Flicker)
http://www.cn-dos.net/forum/viewthread.php?tid=41833
After Diving for Several Days, Completed Self-Satisfied Digital Rain
http://www.cn-dos.net/forum/viewthread.php?tid=42113
【Considered Monthly Post】I Try to Minimize Flicker Batch Processing Large Clock
http://www.cn-dos.net/forum/viewthread.php?tid=41757
Running All the Way, Episode 1, Jump!
http://www.cn-dos.net/forum/viewthread.php?tid=41981
Made a Self-Satisfied Scrolling Subtitle
http://www.cn-dos.net/forum/viewthread.php?tid=39780
Replies:
【Challenge】Draw Square and Parabola with Batch Processing 14th floor 15th floor 18th floor
http://bbs.bathome.cn/thread-3537-2-1.html
Batch Processing Fun Mathematics of n-order Snake Matrix 28th floor
http://www.cn-dos.net/forum/viewthread.php?tid=42472
How to Generate a Pure Digital Password Dictionary 6th floor
http://www.cn-dos.net/forum/viewthread.php?tid=33139
Permutation and Combination 27th floor
http://www.cn-dos.net/forum/viewthread.php?tid=41243
Water Area:
Handmade Sudoku Matrix
http://www.cn-dos.net/forum/viewthread.php?tid=45817
Treat Discrimination with Discrimination
http://www.cn-dos.net/forum/viewthread.php?tid=45986
523066680 Quotes
http://www.cn-dos.net/forum/viewthread.php?tid=46304
Half Story
http://www.cn-dos.net/forum/viewthread.php?tid=45521
Lightspeed Contradiction
http://www.cn-dos.net/forum/viewthread.php?tid=44789
1=0.9999999……?
http://www.cn-dos.net/forum/viewthread.php?tid=43058
Articles
Batch Rename's Bug
http://www.cn-dos.net/forum/viewthread.php?tid=45655
TalkAboutString
http://www.cn-dos.net/forum/viewthread.php?tid=45654
Improvement of Paragraph Redirection Method
http://www.cn-dos.net/forum/viewthread.php?tid=45409
2 times ping1 is not equal to 1 time ping2
http://www.cn-dos.net/forum/viewthread.php?tid=45410
%var% instead of statement execution
http://www.cn-dos.net/forum/viewthread.php?tid=45240
Snake Idea Analysis (23rd floor)
http://www.cn-dos.net/forum/viewthread.php?tid=43369
Establishing a Permanent Abnormal Drive Letter
http://www.cn-dos.net/forum/viewthread.php?tid=41796
Mathematics related:
Batch Processing to Calculate 24 Points
http://www.cn-dos.net/forum/viewthread.php?tid=45488
Square Root of Integers from 1 to 99
http://www.cn-dos.net/forum/viewthread.php?tid=43046
Applications:
Can the Process Name of a Batch Script be Changed? (The solution is found in the link on the 24th floor.)
http://www.cn-dos.net/forum/viewthread.php?tid=42169
How to Implement Standby and Open Screen Saver with Script?
http://www.cn-dos.net/forum/viewthread.php?tid=45522
Batch Script Packaging Tool
http://www.cn-dos.net/forum/viewthread.php?tid=44620
Shutdown After 1 Hour
http://www.cn-dos.net/forum/viewthread.php?tid=45242
Generate Test Scripts to be Written
http://www.cn-dos.net/forum/viewthread.php?tid=45250
List the Current Smallest and Largest bat Files
http://www.cn-dos.net/forum/viewthread.php?tid=41517
Batch Renaming in 001, 002, 003 Format
http://www.cn-dos.net/forum/viewthread.php?tid=41643
Entertainment, Special Effects:
Digital Matrix Appears Point by Point, Random
http://www.cn-dos.net/forum/viewthread.php?tid=45878
Batch Processing to Write Large Character Effect - New Year Greeting Card
http://www.cn-dos.net/forum/viewthread.php?tid=45411
Animation Special Effects: Drawing Circles, Bouncing Balls, Progress Bars, Rising and Falling, etc.
http://www.cn-dos.net/forum/viewthread.php?tid=42124
Pure Batch Processing Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43369
Gradually Larger Circle in the Middle
http://www.cn-dos.net/forum/viewthread.php?tid=44785
Spatial Random Walking Particles + Initial Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43059
【Visual Category】Advancing Road + Airplane and Cannon
http://www.cn-dos.net/forum/viewthread.php?tid=41333
【Visual Category】Square Frame Gradually Expanding from the Middle and Then Becoming Smaller + Changing Color
http://www.cn-dos.net/forum/viewthread.php?tid=40711
Clock - Italic + Milliseconds (Updated, Reduced CPU and Flicker)
http://www.cn-dos.net/forum/viewthread.php?tid=41833
After Diving for Several Days, Completed Self-Satisfied Digital Rain
http://www.cn-dos.net/forum/viewthread.php?tid=42113
【Considered Monthly Post】I Try to Minimize Flicker Batch Processing Large Clock
http://www.cn-dos.net/forum/viewthread.php?tid=41757
Running All the Way, Episode 1, Jump!
http://www.cn-dos.net/forum/viewthread.php?tid=41981
Made a Self-Satisfied Scrolling Subtitle
http://www.cn-dos.net/forum/viewthread.php?tid=39780
Replies:
【Challenge】Draw Square and Parabola with Batch Processing 14th floor 15th floor 18th floor
http://bbs.bathome.cn/thread-3537-2-1.html
Batch Processing Fun Mathematics of n-order Snake Matrix 28th floor
http://www.cn-dos.net/forum/viewthread.php?tid=42472
How to Generate a Pure Digital Password Dictionary 6th floor
http://www.cn-dos.net/forum/viewthread.php?tid=33139
Permutation and Combination 27th floor
http://www.cn-dos.net/forum/viewthread.php?tid=41243
Water Area:
Handmade Sudoku Matrix
http://www.cn-dos.net/forum/viewthread.php?tid=45817
Treat Discrimination with Discrimination
http://www.cn-dos.net/forum/viewthread.php?tid=45986
523066680 Quotes
http://www.cn-dos.net/forum/viewthread.php?tid=46304
Half Story
http://www.cn-dos.net/forum/viewthread.php?tid=45521
Lightspeed Contradiction
http://www.cn-dos.net/forum/viewthread.php?tid=44789
1=0.9999999……?
http://www.cn-dos.net/forum/viewthread.php?tid=43058
Articles Batch Rename's Bug http://www.cn-dos.net/forum/viewthread.php?tid=45655 TalkAboutString http://www.cn-dos.net/forum/viewthread.php?tid=45654 Improvement of Paragraph Redirection Method http://www.cn-dos.net/forum/viewthread.php?tid=45409 2 times ping1 is not equal to 1 time ping2 http://www.cn-dos.net/forum/viewthread.php?tid=45410 %var% instead of statement execution http://www.cn-dos.net/forum/viewthread.php?tid=45240 Snake Idea Analysis (23rd floor) http://www.cn-dos.net/forum/viewthread.php?tid=43369 Establishing a Permanent Abnormal Drive Letter http://www.cn-dos.net/forum/viewthread.php?tid=41796 Mathematics related: Batch Processing to Calculate 24 Points http://www.cn-dos.net/forum/viewthread.php?tid=45488 Square Root of Integers from 1 to 99 http://www.cn-dos.net/forum/viewthread.php?tid=43046 Applications: Can the Process Name of a Batch Script be Changed? (The solution is found in the link on the 24th floor.) http://www.cn-dos.net/forum/viewthread.php?tid=42169 How to Implement Standby and Open Screen Saver with Script? http://www.cn-dos.net/forum/viewthread.php?tid=45522 Batch Script Packaging Tool http://www.cn-dos.net/forum/viewthread.php?tid=44620 Shutdown After 1 Hour http://www.cn-dos.net/forum/viewthread.php?tid=45242 Generate Test Scripts to be Written http://www.cn-dos.net/forum/viewthread.php?tid=45250 List the Current Smallest and Largest bat Files http://www.cn-dos.net/forum/viewthread.php?tid=41517 Batch Renaming in 001, 002, 003 Format http://www.cn-dos.net/forum/viewthread.php?tid=41643 Entertainment, Special Effects: Digital Matrix Appears Point by Point, Random http://www.cn-dos.net/forum/viewthread.php?tid=45878 Batch Processing to Write Large Character Effect - New Year Greeting Card http://www.cn-dos.net/forum/viewthread.php?tid=45411 Animation Special Effects: Drawing Circles, Bouncing Balls, Progress Bars, Rising and Falling, etc. http://www.cn-dos.net/forum/viewthread.php?tid=42124 Pure Batch Processing Version of Snake http://www.cn-dos.net/forum/viewthread.php?tid=43369 Gradually Larger Circle in the Middle http://www.cn-dos.net/forum/viewthread.php?tid=44785 Spatial Random Walking Particles + Initial Version of Snake http://www.cn-dos.net/forum/viewthread.php?tid=43059 【Visual Category】Advancing Road + Airplane and Cannon http://www.cn-dos.net/forum/viewthread.php?tid=41333 【Visual Category】Square Frame Gradually Expanding from the Middle and Then Becoming Smaller + Changing Color http://www.cn-dos.net/forum/viewthread.php?tid=40711 Clock - Italic + Milliseconds (Updated, Reduced CPU and Flicker) http://www.cn-dos.net/forum/viewthread.php?tid=41833 After Diving for Several Days, Completed Self-Satisfied Digital Rain http://www.cn-dos.net/forum/viewthread.php?tid=42113 【Considered Monthly Post】I Try to Minimize Flicker Batch Processing Large Clock http://www.cn-dos.net/forum/viewthread.php?tid=41757 Running All the Way, Episode 1, Jump! http://www.cn-dos.net/forum/viewthread.php?tid=41981 Made a Self-Satisfied Scrolling Subtitle http://www.cn-dos.net/forum/viewthread.php?tid=39780 Replies: 【Challenge】Draw Square and Parabola with Batch Processing 14th floor 15th floor 18th floor http://bbs.bathome.cn/thread-3537-2-1.html Batch Processing Fun Mathematics of n-order Snake Matrix 28th floor http://www.cn-dos.net/forum/viewthread.php?tid=42472 How to Generate a Pure Digital Password Dictionary 6th floor http://www.cn-dos.net/forum/viewthread.php?tid=33139 Permutation and Combination 27th floor http://www.cn-dos.net/forum/viewthread.php?tid=41243 Water Area: Handmade Sudoku Matrix http://www.cn-dos.net/forum/viewthread.php?tid=45817 Treat Discrimination with Discrimination http://www.cn-dos.net/forum/viewthread.php?tid=45986 523066680 Quotes http://www.cn-dos.net/forum/viewthread.php?tid=46304 Half Story http://www.cn-dos.net/forum/viewthread.php?tid=45521 Lightspeed Contradiction http://www.cn-dos.net/forum/viewthread.php?tid=44789 1=0.9999999……? http://www.cn-dos.net/forum/viewthread.php?tid=43058
Last edited by 523066680 on 2016-9-28 at 11:42 ]
|

综合型编程论坛
我的作品索引 |
|
2009-2-13 18:50 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
|
2009-2-17 18:15 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :funa na %inp%
call :funa nb %inp:* =%
set /a lpna=0,lpr=-1
:lpna
set /a lpna+=1,lpnb=0,lpr+=1,lp=lpr
:lpnb
set /a lpnb+=1,lp+=1
::::::::::::::::::::::::::
set /a axb=na%lpna%*nb%lpnb%
set /a cup%lp%=axb+cup%lp%
if !cup%lp%! gtr 9 (set "do=") else (set do=::)
%do% set /a tlpa=lp,tlpb=tlpa+1
%do% :cuplp
%do% set /a cup%tlpa%=cup%tlpa%-10,cup%tlpb%+=1
%do% set /a tlpa+=1,tlpb=tlpa+1
%do% if !cup%tlpb%! gtr 9 (goto :cuplp)
::::::::::::::::::::::::::
if %lpnb% lss %nb% (goto :lpnb)
if %lpna% lss %na% (goto :lpna)
for /l %%a in (1,1,8) do echo !cup%%a!
set /a temp=1234*1234
echo %temp%
pause>nul &exit
:funa
set /a %1=%2,funaa=0
:funaa
set /a funaa+=1
set %1%funaa%=!%1:~-%funaa%,1!
if not "!%1:~%funaa%!"=="" (goto :funaa)
set /a %1=funaa
```
@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :funa na %inp%
call :funa nb %inp:* =%
set /a lpna=0,lpr=-1
:lpna
set /a lpna+=1,lpnb=0,lpr+=1,lp=lpr
:lpnb
set /a lpnb+=1,lp+=1
::::::::::::::::::::::::::
set /a axb=na%lpna%*nb%lpnb%
set /a cup%lp%=axb+cup%lp%
if !cup%lp%! gtr 9 (set "do=") else (set do=::)
%do% set /a tlpa=lp,tlpb=tlpa+1
%do% :cuplp
%do% set /a cup%tlpa%=cup%tlpa%-10,cup%tlpb%+=1
%do% set /a tlpa+=1,tlpb=tlpa+1
%do% if !cup%tlpb%! gtr 9 (goto :cuplp)
::::::::::::::::::::::::::
if %lpnb% lss %nb% (goto :lpnb)
if %lpna% lss %na% (goto :lpna)
for /l %%a in (1,1,8) do echo !cup%%a!
set /a temp=1234*1234
echo %temp%
pause>nul &exit
:funa
set /a %1=%2,funaa=0
:funaa
set /a funaa+=1
set %1%funaa%=!%1:~-%funaa%,1!
if not "!%1:~%funaa%!"=="" (goto :funaa)
set /a %1=funaa
```
|

综合型编程论坛
我的作品索引 |
|
2009-2-17 18:42 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
@echo off &setlocal enabledelayedexpansion
title code by 523066680
set /p inp="输入两个乘数 空格隔开: "
call :naxnb %inp%
pause
:naxnb
set numa=%1
set numb=%2
set /a la=0,lb=0,lp=0
:la
set /a la+=1,lb+=1,lp+=1
set /a lb+=1,tlpa=lp,tlpb=lp+1
:::::::::::::::::::::::::
set /a cup%lp%+=!numa:~-%la%,1! + !numb:~-%lb%,1!
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)
::::::::::::::::::::::::::
if not "!numb:~%lb%!"=="" (goto :la)
if not "!numa:~%la%!"=="" (goto :la)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
::::::::vbs验证一下:::::::::::
echo,
echo,wscript.echo %inp: =+%>x.vbs
cscript //nologo x.vbs
pause>nul &exit
Last edited by 523066680 on 2009-2-21 at 11:29 ]
@echo off &setlocal enabledelayedexpansion
title code by 523066680
set /p inp="Enter two multipliers, separated by space: "
call :naxnb %inp%
pause
:naxnb
set numa=%1
set numb=%2
set /a la=0,lb=0,lp=0
:la
set /a la+=1,lb+=1,lp+=1
set /a lb+=1,tlpa=lp,tlpb=lp+1
:::::::::::::::::::::::::
set /a cup%lp%+=!numa:~-%la%,1! + !numb:~-%lb%,1!
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)
::::::::::::::::::::::::::
if not "!numb:~%lb%!"=="" (goto :la)
if not "!numa:~%la%!"=="" (goto :la)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
::::::::vbs verification:::::::::::
echo,
echo,wscript.echo %inp: =+%>x.vbs
cscript //nologo x.vbs
pause>nul &exit
Last edited by 523066680 on 2009-2-21 at 11:29 ]
|

综合型编程论坛
我的作品索引 |
|
2009-2-20 18:49 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
@echo off&setlocal enabledelayedexpansion
set /a sa=63456,sb=61426
:a
echo, %sb:~1,1%
echo,%sa:~1,3%
echo, %sb:~3,1%
echo,
echo, %sb:~0,1%
echo,&echo,
set /p inp="(w a s d): "
echo,
if %inp% equ w (
set sb=%sb:~1%%sb:~1,1%
)
if %inp% equ s (
set sb=%sb:~3,1%%sb:~0,4%
)
if %inp% equ a (
set sa=%sa:~1%%sa:~1,1%
)
if %inp% equ d (
set sa=%sa:~3,1%%sa:~0,4%
)
goto :a
@echo off&setlocal enabledelayedexpansion
set /a sa=63456,sb=61426
:a
echo, %sb:~1,1%
echo,%sa:~1,3%
echo, %sb:~3,1%
echo,
echo, %sb:~0,1%
echo,&echo,
set /p inp="(w a s d): "
echo,
if %inp% equ w (
set sb=%sb:~1%%sb:~1,1%
)
if %inp% equ s (
set sb=%sb:~3,1%%sb:~0,4%
)
if %inp% equ a (
set sa=%sa:~1%%sa:~1,1%
)
if %inp% equ d (
set sa=%sa:~3,1%%sa:~0,4%
)
goto :a
|

综合型编程论坛
我的作品索引 |
|
2009-3-7 06:27 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
typedef struct
{
int fa,fb;
} fraction;
char axb;
fraction arr;
fraction outvar;
int whox;
int overa;
void arrangement(int a,int n);
void next(fraction a,int n);
void count(fraction a,int x,fraction b,int n);
main()
{
int i,ma;
for (i=0;i<4;i++) arr.fb=1;
while (1)
{
printf("______________________\nPress = Quit \n\n");
printf("Input 4 numbers,such as: 3 3 8 8 : ");
scanf("%d %d %d %d",&ma,&ma,&ma,&ma);
overa=0;
arrangement(ma,4);
if (overa==0) printf("\n Not result!\n\n");
}
getch();
}
void arrangement(int a,int n)
{
int temp;
int i,j,k;
if (n==0)
{
next(arr,4);
return;
}
for (i=0;i<n;i++)
{ k=0;
arr.fa=a;
for (j=0;j<n;j++) {if (i!=j) temp=a;}
arrangement(temp,n-1);
}
}
void next(fraction a,int n)
{
int i,j;
fraction temp;
if ((overa==0)&&(n==1)&&(a.fa==24*a.fb))
{printf("\n ");
if (whox==0)
{
if (whox==0)
{printf(" %c %d",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==1)
{printf(" %c %d",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==2)
{printf("(%d %c %d) %c (%d %c %d)",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
}
else
{
if (whox==0)
{printf("(%d %c %d) %c (%d %c %d)",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==1)
{printf("%d %c ",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==2)
{printf("%d %c ",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
}
printf(" = 24 \n\n");
overa=1;
return;
}
for (i=0;i<n-1;i++)
{
whox=i;
for (j=0;j<n;j++){temp.fa=a.fa;temp.fb=a.fb;}
for (j=i+1;j<n-1;j++){temp.fa=temp.fa;temp.fb=a.fb;}
for (j=0;j<4;j++)
{
count(a,j,a,n);
temp.fa=outvar.fa;
temp.fb=outvar.fb;
if (outvar.fb!=0) next(temp,n-1);
}
}
}
void count(fraction a,int x,fraction b,int n)
{
if (x==0)
{
axb='+';
outvar.fa=(a.fa*b.fb)+(b.fa*a.fb);
outvar.fb=a.fb*b.fb;
}
else if (x==1)
{
axb='-';
outvar.fa=(a.fa*b.fb)-(b.fa*a.fb);
outvar.fb=a.fb*b.fb;
}
else if (x==2)
{
axb='*';
outvar.fa=a.fa*b.fa;
outvar.fb=a.fb*b.fb;
}
else if (x==3)
{
axb='/';
outvar.fa=a.fa*b.fb;
outvar.fb=a.fb*b.fa;
}
}
```c
typedef struct
{
int fa,fb;
} fraction;
char axb;
fraction arr;
fraction outvar;
int whox;
int overa;
void arrangement(int a,int n);
void next(fraction a,int n);
void count(fraction a,int x,fraction b,int n);
main()
{
int i,ma;
for (i=0;i<4;i++) arr.fb=1;
while (1)
{
printf("______________________\nPress = Quit \n\n");
printf("Input 4 numbers,such as: 3 3 8 8 : ");
scanf("%d %d %d %d",&ma,&ma,&ma,&ma);
overa=0;
arrangement(ma,4);
if (overa==0) printf("\n Not result!\n\n");
}
getch();
}
void arrangement(int a,int n)
{
int temp;
int i,j,k;
if (n==0)
{
next(arr,4);
return;
}
for (i=0;i<n;i++)
{ k=0;
arr.fa=a;
for (j=0;j<n;j++) {if (i!=j) temp=a;}
arrangement(temp,n-1);
}
}
void next(fraction a,int n)
{
int i,j;
fraction temp;
if ((overa==0)&&(n==1)&&(a.fa==24*a.fb))
{printf("\n ");
if (whox==0)
{
if (whox==0)
{printf(" %c %d",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==1)
{printf(" %c %d",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==2)
{printf("(%d %c %d) %c (%d %c %d)",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
}
else
{
if (whox==0)
{printf("(%d %c %d) %c (%d %c %d)",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==1)
{printf("%d %c ",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==2)
{printf("%d %c ",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
}
printf(" = 24 \n\n");
overa=1;
return;
}
for (i=0;i<n-1;i++)
{
whox=i;
for (j=0;j<n;j++){temp.fa=a.fa;temp.fb=a.fb;}
for (j=i+1;j<n-1;j++){temp.fa=temp.fa;temp.fb=a.fb;}
for (j=0;j<4;j++)
{
count(a,j,a,n);
temp.fa=outvar.fa;
temp.fb=outvar.fb;
if (outvar.fb!=0) next(temp,n-1);
}
}
}
void count(fraction a,int x,fraction b,int n)
{
if (x==0)
{
axb='+';
outvar.fa=(a.fa*b.fb)+(b.fa*a.fb);
outvar.fb=a.fb*b.fb;
}
else if (x==1)
{
axb='-';
outvar.fa=(a.fa*b.fb)-(b.fa*a.fb);
outvar.fb=a.fb*b.fb;
}
else if (x==2)
{
axb='*';
outvar.fa=a.fa*b.fa;
outvar.fb=a.fb*b.fb;
}
else if (x==3)
{
axb='/';
outvar.fa=a.fa*b.fb;
outvar.fb=a.fb*b.fa;
}
}
```
附件
1: COUNT24B.rar (2009-6-3 05:26, 7.78 KiB, 下载附件所需积分 1 点
,下载次数: 1)
|

综合型编程论坛
我的作品索引 |
|
2009-6-3 05:24 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 8 楼』:
二维管道
使用 LLM 解释/回答一下
#include "Conio.h"
#include "graphics.h"
#include "stdlib.h"
#define closegr closegraph
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int a,b,x,y,i,j;
randomize();
initgr(); /* BGI初始化 */
x=y=200;
for (i=1;i<=15;i++)
{
a=rand()%600+1;b=rand()%400+20;
putpixel(x,y,4);
while (x!=a||y!=b)
{
if (x<a)
x++;
else if (x>a)
x--;
else
{
if (y<b)
y++;
else if (y>b)
y--;
}
for (j=0;j<=100;j++) delay(10);
putpixel(x,y,i);
}
}
rectangle(x-5,y-5,x+5,y+5);
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
```cpp
#include "Conio.h"
#include "graphics.h"
#include "stdlib.h"
#define closegr closegraph
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int a,b,x,y,i,j;
randomize();
initgr(); /* BGI initialization */
x=y=200;
for (i=1;i<=15;i++)
{
a=rand()%600+1;b=rand()%400+20;
putpixel(x,y,4);
while (x!=a||y!=b)
{
if (x<a)
x++;
else if (x>a)
x--;
else
{
if (y<b)
y++;
else if (y>b)
y--;
}
for (j=0;j<=100;j++) delay(10);
putpixel(x,y,i);
}
}
rectangle(x-5,y-5,x+5,y+5);
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
|

综合型编程论坛
我的作品索引 |
|
2009-7-7 23:33 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 9 楼』:
随机游蛇
使用 LLM 解释/回答一下
#include "Conio.h"
#include "graphics.h"
#include "stdlib.h"
#define closegr closegraph
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int a,b,x,y,i,j,dtl=50,dtn=0;
int dot;
randomize();
initgr(); /* BGI初始化 */
x=y=200;
dot=dot=200;
for (i=1;i<dtl;i++) {dot=0;dot=0;}
for (i=1;i<=15;i++)
{
a=rand()%600+1;b=rand()%400+20;
putpixel(x,y,4);
while (x!=a||y!=b)
{
if (x<a)
x++;
else if (x>a)
x--;
else
{
if (y<b)
y++;
else if (y>b)
y--;
}
for (j=0;j<=100;j++) delay(10);
putpixel(x,y,i);
if (dtn<(dtl-1)) dtn++;
else dtn=0;
if (dot!=0) putpixel(dot,dot,0);
dot=x;dot=y;
}
}
rectangle(x-5,y-5,x+5,y+5);
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
```cpp
#include "Conio.h"
#include "graphics.h"
#include "stdlib.h"
#define closegr closegraph
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int a, b, x, y, i, j, dtl = 50, dtn = 0;
int dot;
randomize();
initgr(); /* BGI initialization */
x = y = 200;
dot = dot = 200;
for (i = 1; i < dtl; i++) { dot = 0; dot = 0; }
for (i = 1; i <= 15; i++)
{
a = rand() % 600 + 1; b = rand() % 400 + 20;
putpixel(x, y, 4);
while (x != a || y != b)
{
if (x < a)
x++;
else if (x > a)
x--;
else
{
if (y < b)
y++;
else if (y > b)
y--;
}
for (j = 0; j <= 100; j++) delay(10);
putpixel(x, y, i);
if (dtn < (dtl - 1)) dtn++;
else dtn = 0;
if (dot != 0) putpixel(dot, dot, 0);
dot = x; dot = y;
}
}
rectangle(x - 5, y - 5, x + 5, y + 5);
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
|

综合型编程论坛
我的作品索引 |
|
2009-7-7 23:57 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 10 楼』:
多条随机游动的snake
使用 LLM 解释/回答一下
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NSNK 5
#define LONG 60
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int i,j;
struct {
int a,b,x,y,dtl,dtn,dot;
} snk;
initgr(); /* BGI初始化 */
for (i=0;i<NSNK;i++) {
snk.a=snk.b=snk.x=snk.y=snk.dot=snk.dot=200;
snk.dtl=LONG;
snk.dtn=0;
for (j=1;j<LONG;j++) {snk.dot=snk.dot=0;}
}
randomize();
while (!kbhit())
{
for (i=0;i<150;i++) delay(10);
for (i=0;i<NSNK;i++){
putpixel(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NSNK;i++){
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
if (snk.dtn<(snk.dtl-1)) snk.dtn++;
else snk.dtn=0;
if (snk.dot.dtn]!=0) putpixel(snk.dot.dtn],snk.dot.dtn],0);
snk.dot.dtn]=snk.x;
snk.dot.dtn]=snk.y;
}
}
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
NLine
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NSNK 5
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int i,j;
struct {
int a,b,x,y;
} snk;
initgr(); /* BGI初始化 */
for (i=0;i<NSNK;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
for (i=0;i<150;i++) delay(10);
for (i=0;i<NSNK;i++){
putpixel(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NSNK;i++){
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
5RandDot
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 5
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void func(int x,int y,int c)
{
putpixel(x,y,c);
putpixel(x+1,y,c);
putpixel(x,y+1,c);
putpixel(x+1,y+1,c);
}
int main(void)
{
int i,j,whi=0;
struct {
int a,b,x,y,tx,ty;
} snk;
initgr(); /* BGI初始化 */
for (i=0;i<NDOT;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
if (whi<4) whi++; else whi=0;
for (i=0;i<150;i++) delay(10);
for (i=0;i<NDOT;i++){
func(snk.tx,snk.ty,0);
func(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NDOT;i++){
snk.tx=snk.x;
snk.ty=snk.y;
if (whi>i) continue;
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
Last edited by 523066680 on 2009-7-13 at 22:18 ]
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NSNK 5
#define LONG 60
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int i,j;
struct {
int a,b,x,y,dtl,dtn,dot;
} snk;
initgr(); /* BGI initialization */
for (i=0;i<NSNK;i++) {
snk.a=snk.b=snk.x=snk.y=snk.dot=snk.dot=200;
snk.dtl=LONG;
snk.dtn=0;
for (j=1;j<LONG;j++) {snk.dot=snk.dot=0;}
}
randomize();
while (!kbhit())
{
for (i=0;i<150;i++) delay(10);
for (i=0;i<NSNK;i++){
putpixel(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NSNK;i++){
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
if (snk.dtn<(snk.dtl-1)) snk.dtn++;
else snk.dtn=0;
if (snk.dot.dtn]!=0) putpixel(snk.dot.dtn],snk.dot.dtn],0);
snk.dot.dtn]=snk.x;
snk.dot.dtn]=snk.y;
}
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
NLine
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NSNK 5
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int i,j;
struct {
int a,b,x,y;
} snk;
initgr(); /* BGI initialization */
for (i=0;i<NSNK;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
for (i=0;i<150;i++) delay(10);
for (i=0;i<NSNK;i++){
putpixel(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NSNK;i++){
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
5RandDot
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 5
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void func(int x,int y,int c)
{
putpixel(x,y,c);
putpixel(x+1,y,c);
putpixel(x,y+1,c);
putpixel(x+1,y+1,c);
}
int main(void)
{
int i,j,whi=0;
struct {
int a,b,x,y,tx,ty;
} snk;
initgr(); /* BGI initialization */
for (i=0;i<NDOT;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
if (whi<4) whi++; else whi=0;
for (i=0;i<150;i++) delay(10);
for (i=0;i<NDOT;i++){
func(snk.tx,snk.ty,0);
func(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NDOT;i++){
snk.tx=snk.x;
snk.ty=snk.y;
if (whi>i) continue;
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
Last edited by 523066680 on 2009-7-13 at 22:18 ]
|

综合型编程论坛
我的作品索引 |
|
2009-7-13 00:07 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 11 楼』:
变幻的三角形
使用 LLM 解释/回答一下
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 3
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void delta(int xa,int ya,int xb,int yb,int xc,int yc,int c)
{
setcolor(c);
line(xa,ya,xb,yb);
line(xa,ya,xc,yc);
line(xb,yb,xc,yc);
}
int main(void)
{
int i,j,whi=0;
struct {
int a,b,x,y,tx,ty;
} snk;
initgr(); /* BGI初始化 */
for (i=0;i<NDOT;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
if (whi<3) whi++; else whi=0;
for (i=0;i<200;i++) delay(10);
delta(snk.tx,snk.ty,snk.tx,snk.ty,snk.tx,snk.ty,0);
delta(snk.x,snk.y,snk.x,snk.y,snk.x,snk.y,2);
for (i=0;i<NDOT;i++){
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NDOT;i++){
snk.tx=snk.x;
snk.ty=snk.y;
if (whi>i) continue;
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
```c
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 3
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void delta(int xa,int ya,int xb,int yb,int xc,int yc,int c)
{
setcolor(c);
line(xa,ya,xb,yb);
line(xa,ya,xc,yc);
line(xb,yb,xc,yc);
}
int main(void)
{
int i,j,whi=0;
struct {
int a,b,x,y,tx,ty;
} snk;
initgr(); /* BGI initialization */
for (i=0;i<NDOT;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
if (whi<3) whi++; else whi=0;
for (i=0;i<200;i++) delay(10);
delta(snk.tx,snk.ty,snk.tx,snk.ty,snk.tx,snk.ty,0);
delta(snk.x,snk.y,snk.x,snk.y,snk.x,snk.y,2);
for (i=0;i<NDOT;i++){
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NDOT;i++){
snk.tx=snk.x;
snk.ty=snk.y;
if (whi>i) continue;
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
|

综合型编程论坛
我的作品索引 |
|
2009-7-13 22:31 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 12 楼』:
变幻的四面体
使用 LLM 解释/回答一下
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 4
typedef struct
{
int a,b,x,y;
} DotInf;
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void delta(DotInf dot,int c)
{
int i,j;
setcolor(c);
for (i=0;i<NDOT;i++)
for (j=i+1;j<NDOT;j++) line(dot.x,dot.y,dot.x,dot.y);
}
int main(void)
{
int i,j,whi=0;
DotInf snk,everdot;
initgr(); /* BGI初始化 */
for (i=0;i<NDOT;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
delta(snk,2);
randomize();
while (!kbhit())
{
if (whi<4) whi++; else whi=0;
for (i=0;i<600;i++) delay(10);
delta(everdot,0);
delta(snk,2);
for (i=0;i<NDOT;i++){
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NDOT;i++){
everdot.x=snk.x;
everdot.y=snk.y;
if (whi>i) continue;
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
Last edited by 523066680 on 2009-8-23 at 07:13 ]
```cpp
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 4
typedef struct
{
int a, b, x, y;
} DotInf;
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void delta(DotInf dot, int c)
{
int i, j;
setcolor(c);
for (i = 0; i < NDOT; i++)
for (j = i + 1; j < NDOT; j++) line(dot.x, dot.y, dot.x, dot.y);
}
int main(void)
{
int i, j, whi = 0;
DotInf snk, everdot;
initgr(); /* BGI initialization */
for (i = 0; i < NDOT; i++) {
snk.a = snk.b = snk.x = snk.y = 200;
}
delta(snk, 2);
randomize();
while (!kbhit())
{
if (whi < 4) whi++; else whi = 0;
for (i = 0; i < 600; i++) delay(10);
delta(everdot, 0);
delta(snk, 2);
for (i = 0; i < NDOT; i++) {
if ((snk.x == snk.a) && (snk.y == snk.b)) {
snk.a = rand() % 600 + 1;
snk.b = rand() % 400 + 20;
}
}
for (i = 0; i < NDOT; i++) {
everdot.x = snk.x;
everdot.y = snk.y;
if (whi > i) continue;
if (snk.x > snk.a)
snk.x--;
else if (snk.x < snk.a)
snk.x++;
else
{
if (snk.y > snk.b)
snk.y--;
else if (snk.y < snk.b)
snk.y++;
}
}
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
Last edited by 523066680 on 2009-8-23 at 07:13 ]
|

综合型编程论坛
我的作品索引 |
|
2009-7-13 23:07 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 13 楼』:
密密麻麻的虫子……
使用 LLM 解释/回答一下
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int i,j;
initgr(); /* BGI初始化 */
randomize();
while (!kbhit())
{
for (j=200;j<=300;j++)
{
putpixel(rand()%400+1,j,4);
putpixel(rand()%400+1,j,0);
}
for (j=0;j<200;j++) delay(10);
}
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
狂轰滥炸的感觉~ 乱弄出来的
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void func(int x,int y,int c)
{ setcolor(c);
rectangle(x-4,y-4,x+4,y+4);
}
int main(void)
{
int i,j;
initgr(); /* BGI初始化 */
randomize();
while (!kbhit())
{
for (i=1;i<=30;i++)
{
for (j=1;j<=30;j++) if (rand()%30>20) func(j*10,i*10,1);
for (j=1;j<=30;j++) if (rand()%30>10) func(j*5,i*5,0);
}
for (j=0;j<500;j++) delay(20);
}
getch();
closegr(); /* 恢复TEXT屏幕模式 */
return 0;
}
Last edited by 523066680 on 2009-7-14 at 03:26 ]
```cpp
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int i,j;
initgr(); /* BGI initialization */
randomize();
while (!kbhit())
{
for (j=200;j<=300;j++)
{
putpixel(rand()%400+1,j,4);
putpixel(rand()%400+1,j,0);
}
for (j=0;j<200;j++) delay(10);
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
Feels like a barrage~ Randomly made
```cpp
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
void func(int x,int y,int c)
{ setcolor(c);
rectangle(x-4,y-4,x+4,y+4);
}
int main(void)
{
int i,j;
initgr(); /* BGI initialization */
randomize();
while (!kbhit())
{
for (i=1;i<=30;i++)
{
for (j=1;j<=30;j++) if (rand()%30>20) func(j*10,i*10,1);
for (j=1;j<=30;j++) if (rand()%30>10) func(j*5,i*5,0);
}
for (j=0;j<500;j++) delay(20);
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
Last edited by 523066680 on 2009-7-14 at 03:26 ]
|

综合型编程论坛
我的作品索引 |
|
2009-7-14 03:06 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Last edited by 523066680 on 2009-8-2 at 10:09 ]
Last edited by 523066680 on 2009-8-2 at 10:09 ]
|

综合型编程论坛
我的作品索引 |
|
2009-8-2 10:06 |
|
|
523066680
银牌会员
     SuperCleaner
积分 2362
发帖 1133
注册 2008-2-2
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
看来不合格的文本操作代码,我自个儿先留着。 处理的文本为text.txt
过80字节转一行,字符处理可以,效率不好。
@echo off
err>result.x 2>nul
set /a x=0
for /f "delims= eol=#" %%a in (text.txt) do (
set /a x+=1
set /a seta=0,setb=80
echo, %%a>x.x
call :func
)
start result.x
pause
exit
:func
echo,Sentence%x%
type x.x>temp.x
fsutil file setzerodata offset=0 length=%seta% temp.x >nul
fsutil file setzerodata offset=%setb% length=10000 temp.x >nul
(for /f "delims= eol=#" %%c in ('more temp.x') do (echo,%%c>temp.x))||goto :eof
for /f "tokens=3" %%a in ('dir temp.x /-c ^|find "个文件"') do (set num=%%a)
set /a seta=seta+num-2,setb=seta+80 &type temp.x>>result.x &goto :func
goto :eof
Last edited by 523066680 on 2009-8-18 at 09:41 ]
It seems that the text - operation code that doesn't meet the requirements, I'll keep it for myself. The text to be processed is text.txt.
If it exceeds 80 bytes, it will be converted to one line. The character processing is okay, but the efficiency is not good.
@echo off
err>result.x 2>nul
set /a x=0
for /f "delims= eol=#" %%a in (text.txt) do (
set /a x+=1
set /a seta=0,setb=80
echo, %%a>x.x
call :func
)
start result.x
pause
exit
:func
echo,Sentence%x%
type x.x>temp.x
fsutil file setzerodata offset=0 length=%seta% temp.x >nul
fsutil file setzerodata offset=%setb% length=10000 temp.x >nul
(for /f "delims= eol=#" %%c in ('more temp.x') do (echo,%%c>temp.x))||goto :eof
for /f "tokens=3" %%a in ('dir temp.x /-c ^|find "个文件"') do (set num=%%a)
set /a seta=seta+num-2,setb=seta+80 &type temp.x>>result.x &goto :func
goto :eof
Last edited by 523066680 on 2009-8-18 at 09:41 ]
|

综合型编程论坛
我的作品索引 |
|
2009-8-18 09:39 |
|
|