黑客数字雨代码(黑客数字雨代码教程)

http://www.itjxue.com  2023-02-05 22:02  来源:未知  点击次数: 

如何实现c语言程序各颜色数字雨代码

#includestdio.h

#includetime.h

#includewindows.h

typedef struct

{

int x,y;

char ch;

}STU;

STU st[100];

//出现位置?

void gotoxy(int x, int y)

{

? HANDLE hout;

? COORD pos;

? pos.X = x;

? pos.Y = y;

? hout = GetStdHandle(STD_OUTPUT_HANDLE);

? SetConsoleCursorPosition(hout, pos);

}

/*隐藏光标*/

void show_cursor(int hide)

{

? CONSOLE_CURSOR_INFO cciCursor;

? HANDLE hout;

? hout = GetStdHandle(STD_OUTPUT_HANDLE);

? if(GetConsoleCursorInfo(hout, cciCursor))

? {

? ? ? cciCursor.bVisible = hide;

? ? ? SetConsoleCursorInfo(hout, cciCursor);

? }

}

/*设置颜色*/

void set_color(int color)

{

? SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);

}

main()

{

int i,j;

show_cursor(0);

srand(time(NULL));

//初始化结构体

for (i=0;i100;i++)

{

st[i].x = rand()%80;

st[i].y = rand()%20;

st[i].ch = rand()%(49-47)+48;

}

while (1)

{

for (i=0;i100;i++)

{

gotoxy(st[i].x,st[i].y);

set_color(0x2);//最先出现的颜色;

putchar(st[i].ch);

gotoxy(st[i].x,st[i].y-5);

putchar(' ');

st[i].y++;

st[i].ch = rand()%(49-47)+48;

if (st[i].y-5=18)

{

gotoxy(st[i].x,st[i].y-1);

putchar(' ');

gotoxy(st[i].x,st[i].y-2);

putchar(' ');

gotoxy(st[i].x,st[i].y-3);

putchar(' ');

gotoxy(st[i].x,st[i].y-4);

putchar(' ');

gotoxy(st[i].x,st[i].y-4);

putchar(' ');

}

if (st[i].y 23)

{

st[i].x = rand()%80;

st[i].y = rand()%20;

}

gotoxy(st[i].x,st[i].y);

set_color(0xA);//由前一个颜色渐变成的颜色

putchar(st[i].ch);

}

Sleep(120);

}

}

????color(0);???printf("黑色\n");??????color(1);???printf("蓝色\n");??????color(2);???printf("绿色\n");???????color(3);???printf("湖蓝色\n");??????color(4);???printf("红色\n");??????color(5);???printf("紫色\n");??????color(6);???printf("黄色\n");???????color(7);???printf("白色\n");??????color(8);???printf("灰色\n");??????color(9);???printf("淡蓝色\n");??????color(10);??printf("淡绿色\n");??????color(11);??printf("淡浅绿色\n");???????color(12);??printf("淡红色\n");??????color(13);??printf("淡紫色\n");??????color(14);??printf("淡黄色\n");??????color(15);??printf("亮白色\n")

几个基本的颜色;

网页数字雨的代码

html

head

title数字下掉黑客帝国效果/title

/headBODY BGCOLOR=#000000

script language="JavaScript"

!--

if (document.all){

Cols=26;//列数

Cl=28;

Cs=40;//间距

Ts=10;

Tc='#008800';

Tc1='#00ff00';

MnS=20;

MxS=30;

I=Cs;

Sp=new Array();S=new Array();Y=new Array();

C=new Array();M=new Array();B=new Array();

RC=new Array();E=new Array();Tcc=new Array(0,1);//数字显示组

document.write("div id='Container' style='position:absolute;top:0;left:-"+Cs+"'");

document.write("div style='position:relative'");

for(i=0; i Cols; i++){

S[i]=I+=Cs;

document.write("div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"

+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden'/div");

}

document.write("/div/div");

for(j=0; j Cols; j++){

RC[j]=1+Math.round(Math.random()*Cl);

Y[j]=0;

Sp[j]=Math.round(MnS+Math.random()*MxS);

for(i=0; i RC[j]; i++){

B[i]='';

C[i]=Math.round(Math.random()*1)+' ';

M[j]=B[0]+=C[i];

}

}

function Cycle(){

Container.style.top=window.document.body.scrollTop;

for (i=0; i Cols; i++){

var r = Math.floor(Math.random()*Tcc.length);

E[i] = 'font color='+Tc1+''+Tcc[r]+'/font';

Y[i]+=Sp[i];

if (Y[i] window.document.body.clientHeight){

for(i2=0; i2 Cols; i2++){

RC[i2]=1+Math.round(Math.random()*Cl);

for(i3=0; i3 RC[i2]; i3++){

B[i3]='';

C[i3]=Math.round(Math.random()*1)+' ';

C[Math.floor(Math.random()*i2)]=' '+' ';

M[i]=B[0]+=C[i3];

Y[i]=-Ts*M[i].length/1.5;

A[i].style.visibility='visible';

}

Sp[i]=Math.round(MnS+Math.random()*MxS);

}

}

A[i].style.top=Y[i];

A[i].innerHTML=M[i]+' '+E[i]+' ';

}

setTimeout('Cycle()',20)

}

Cycle();

}

// --

/script

/body

/html

谁有黑客帝国里面的数字雨的动态图片

孩子~自己做吧!首先点击开始→所有程序→附件→记事本 然后就把下面的代码复制到记事本里,另存为“黑客帝国数字雨.bat” 然后另存为成功后运行文件即可实现桌面数字雨或按Alt+Enter实现全屏数字雨

注:请忽修改下面数字雨代码的任何一个字母,否则将无法成功允许(包括空格在内)

数字雨代码如下: @echo %dbg% off

setlocal ENABLEDELAYEDEXPANSION

mode con cols=80 lines=30

cls

set 退格=

set redtek=" "

set end=0

:start

set /a end+=1

call :calc

set /p=!setspaces! nulping /n 1 127.1nul

set /p=%退格%nul

set /p=%redtek:~1,79%nulecho.

goto :start

:calc

if %end%==28 (

set /a end=0 cls set /a cols=!random:~0,2!

echo ... 风力:!cols! ...

if !cols! GTR 76 set cols=76

if !cols! LSS 2 set cols=2

set setspaces=!redtek:~1,%cols%!!random:~0,1!

goto :eof

)

@echo off

mode con cols=80

color 02

for /f %%i in (test.txt) do set str_char=%%i

set str_blank=

setlocal enabledelayedexpansion

:loop

:: 取随机位置上的字符

set /a num_char=1%random:~-1%%random:~0,1%-100

set char=!str_char:~-%num_char%,1!

:: 设置随机长度的空格

set /a num_blank=1%random:~-1%%random:~0,1%-100

set blank=!str_blank:~0,%num_blank%!

echo.%blank%%char%

goto loop

@echo off

mode con cols=80

set a=1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%.*(){}[]_+-=\"'?.,/^^^^^

set b=

setlocal enabledelayedexpansion

:a

set /a num=%random%%%92

set 字符=!a:~-%num%,1!

set/a c=%random%%%80

set 空格=!b:~-%c%!

echo %空格%^%字符%

goto a

@echo off

mode con cols=80 LINES=30

set a=1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%.*(){}[]_+-=\"'?.,/^^^^^

set b=

setlocal enabledelayedexpansion

:a

set /a num=%random%%%92

set 字符=!a:~-%num%,1!

set/a c=%random%%%80

set 空格=!b:~-%c%!

::echo. %空格%^%字符%

set/a i+=1

rem 指针=i 尾指针=j

set/a j=i-30

set line%i%=%空格%^%字符%

FOR /L %%v IN (%i%,-1,%j%) DO echo.!line%%v!

::ping /n 127.1nul

goto a

@echo off

::mode con cols=80

setlocal ENABLEDELAYEDEXPANSION

color 02

goto BEGIN

goto :eof

::function mt_rand "a" "b"

:mt_rand

::(

set a=%~1

set b=%~2

set /a _mt_rand=(!random!%%(%b%-%a%))+%a%

exit /b 0

::)

:BEGIN

::{--

SET iWidth=80

SET iDensity=6

SET sText="#$'()*+,-./0123456789:;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

SET sText=!sText:"=!

set /A iText=90-1

for /l %%i in (1,1,%iWidth%) do (

set aDown%%i=0

)

:loop

for /l %%I in (1,1,%iWidth%) do (

set /a aDown%%I-=1

if !aDown%%I! LSS 0 (

call :mt_rand "0" "%iDensity%"set aArrow%%I=!_mt_rand!

call :mt_rand "10" "25"set aDown%%I=!_mt_rand!

)

if !aArrow%%I! EQU 1 (

call :mt_rand "0" "%iText%"(FOR %%M IN ("!_mt_rand!") DO SET aa=!sText:~%%~M,1!)

set /p=!aa!nul

) else (

set /p= nul

)

)

goto loop

::--}

:exit

exit /b 0

@echo off

setlocal ENABLEDELAYEDEXPANSION

color 02

for /l %%i in (1,1,80) do (

set Down%%i=0

)

:loop

for /l %%j in (1,1,80) do (

set /a Down%%j-=1

if !down%%j! LSS 0 (

set /a Arrow%%j=!random!%%4

set /a Down%%j=!random!%%15+10

)

if "!Arrow%%j!" == "1" (

set /a chr=!random!%%2

set /p=!chr!nul

) else (

set /p= nul

)

)

goto loop

goto :eof

@echo off

setlocal ENABLEDELAYEDEXPANSION

for /l %%i in (1,1,80) do (

set Down%%i=0

)

for /l %%i in (0) do (

set line=

for /l %%j in (1,1,80) do (

set /a Down%%j-=1

call set x=!down%%j!

if !x! LSS 0 (

set /a Arrow%%j=!random!%%6

set /a Down%%j=!random!%%15+10

)

call set x=!Arrow%%j!

if "!x!" == "1" (

set line=!line!1

) else (set "line=!line! ")

)

call set /p=!line!nul

)[/code]

如何使用CMD命令数字雨?

数字雨效果需要在新建文档中输入数字雨命令代码,并将文件后缀修改为BAT。具体步骤如下:

1、新建一个空白TXT文本文档,双击打开。

2、输入以下代码:

@echo off

color 0a

:start

echo 1 2 3 4 5 g 5 6 7 g t 2 1 3 4 5 6 7 4 3 2 3 5 5 6 7 8 1 2 3 4 5 6 7 8 9 g 3 5 7

ping localhost -n 1 null

echo 1 4 5 6 7 8 9 4 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 1 1 3 4 5 6 7

ping localhost -n 1 null

echo 0 9 8 7 g 6 5 6 7 8 6 7 8 6 5 4 5 6 5 6 7 8 9 0 6 5 4 3 2 1 3 5 6 7 8 9 0 8 9 3

ping localhost -n 1 null

echo 1 2 3 4 5 g 5 6 7 g t 2 1 3 4 5 6 7 4 3 2 3 5 5 6 7 5 6 7 8 4 3 2 1 2 3 4 5 6 7

ping localhost -n 1 null

goto start

3、按下Ctrl+S,保存文档后关闭。

4、选中文档,按下F2重命名文档,将TXT后缀,修改为BAT。

5、双击运行修改完毕的BAT文件。

6、系统弹出CMD命令窗口,在窗口中,会不停出现数字雨。

注意事项:

数字雨命令代码中,echo后面的数字、字母可以随意修改。

cmd命令数字雨教程

有很多朋友对于cmd命令数字雨很感兴趣,那么跟着我来一起看看cmd命令数字雨的教程吧。

01

首先,我们点击鼠标右键在桌面新建一个文本文档。

02

打开文本文档并输入如下代码:

@echo off

color 0a

:start

echo 6 1 7 1 7 f 1 f 1 3 3 0 0 6 0 0 1 r 3 4 1 2 3 1 1 2 1 g 1 2 1 1 1 1 1 1 1 1 1 1

ping localhost -n 1 null

echo 5 2 1 4 1 j 8 1 1 3 2 1 1 4 2 1 2 r 0 3 2 3 4 5 6 g 2 5 8 2 2 2 2 2 2 2 2 2 2 2

ping localhost -n 1 null

echo 2 0 1 7 2 0 1 8 2 0 1 8 2 0 1 8 e b 7 7 4 4 4 1 1 1 5 5 3 8 6 5 6 5 6 5 6 5 2 1

ping localhost -n 1 null

echo 2 0 1 7 2 0 1 8 2 0 1 8 2 0 1 8 e o 5 7 8 4 4 1 1 4 0 5 0 8 7 8 9 5 4 2 0 3 0 0

ping localhost -n 1 null

goto start

03

点击“文件”-“另存为”,把这串代码保存下来。

04

把文件名改为“数字雨.bat”,注意:后缀名一定要为“.bat”,点击保存。

05

然后退回桌面,我们就发现桌面多了一个“数字雨”的图标。

06

点击“数字雨”,进去以后代码雨就制作成功了。通过ESC或点击鼠标,可以退出。

cmd代码数字雨教程是什么?

cmd代码数字雨需要建一个文件,在文件内写入相应的代码,保存后,点击运行就可以在电脑屏幕上出现代码雨,具体方法如下:

1、电脑用户在自己的电脑桌面上创建一个文本文件。创建以后打开。

2、打开以后,在文件中输入代码。代码如下图所示。

3、完成代码雨的代码编写以后,点击工具栏中的文件。然后在点击另存为,将下方的文件名的后缀改为“.bat”。文件名用户随意定义。修改好以后点击“保存”。

4、完成文件的编写和保存以后,右击文件点击以管理员身份运行。

5、运行效果如下。

注意事项:

1、代码不要写错,写错不能运行。

2、在另存的时候,如果不显示后缀,将保存文件选成“所有文件”,在文件名称后面直接打.bat即可。

3、双击也可以运行。

(责任编辑:IT教学网)

更多

推荐思科认证文章