當前位置:首頁 » 操作系統 » asp小游戲源碼

asp小游戲源碼

發布時間: 2022-02-25 17:11:19

『壹』 用ASP編寫一個 猜數字游戲的代碼

這可是本人親自編的,我只編了一個1-9數字的,猜字游戲,你可以改成你想要的
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
action=request("action")

dim sum,znum

sum=cint(request("shu"))

if action="Sub" then
if not isNumeric(sum) then
response.Write("請輸入數字<a href='javascript:history.back(-1)'>返回</a>")
response.End()
end if
if len(sum)>1 then
response.Write("請輸入1-9的數字<a href='javascript:history.back(-1)'>返回</a>")
response.End()
end if
Randomize timer
znum = cint(8*Rnd+1)

if znum=sum then
response.Write "恭喜你,你猜對了。<br>"
else
response.Write "不好意思,你沒猜對。<br>"
end if
response.Write"每次產生的隨機數為:<font color=red>"&znum&"</font>"
end if
%>
<form name="form1" method="post" action="?action=Sub">
請輸入1-9的數字<input name="shu" type="text" size="10">
<input type="submit" name="Submit" value="提交">
</form>

『貳』 求一個網頁版的換衣服小游戲的代碼,用asp的最好。謝謝。

自己編多累呀,直接到移聯小游戲平台上下載就可以了

『叄』 誰有ASP小游戲採集源代碼,能採集的

連連看java源代碼
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class lianliankan implements ActionListener
{
JFrame mainFrame; //主面板
Container thisContainer;
JPanel centerPanel,southPanel,northPanel; //子面板
JButton diamondsButton[][] = new JButton[6][5];//游戲按鈕數組
JButton exitButton,resetButton,newlyButton; //退出,重列,重新開始按鈕
JLabel fractionLable=new JLabel("0"); //分數標簽
JButton firstButton,secondButton; //分別記錄兩次被選中的按鈕
int grid[][] = new int[8][7];//儲存游戲按鈕位置
static boolean pressInformation=false; //判斷是否有按鈕被選中
int x0=0,y0=0,x=0,y=0,fristMsg=0,secondMsg=0,validateLV; //游戲按鈕的位置坐標
int i,j,k,n;//消除方法控制
public void init(){
mainFrame=new JFrame("JKJ連連看");
thisContainer = mainFrame.getContentPane();
thisContainer.setLayout(new BorderLayout());
centerPanel=new JPanel();
southPanel=new JPanel();
northPanel=new JPanel();
thisContainer.add(centerPanel,"Center");
thisContainer.add(southPanel,"South");
thisContainer.add(northPanel,"North");
centerPanel.setLayout(new GridLayout(6,5));
for(int cols = 0;cols < 6;cols++){
for(int rows = 0;rows < 5;rows++ ){
diamondsButton[cols][rows]=new JButton(String.valueOf(grid[cols+1][rows+1]));
diamondsButton[cols][rows].addActionListener(this);
centerPanel.add(diamondsButton[cols][rows]);
}
}
exitButton=new JButton("退出");
exitButton.addActionListener(this);
resetButton=new JButton("重列");
resetButton.addActionListener(this);
newlyButton=new JButton("再來一局");
newlyButton.addActionListener(this);
southPanel.add(exitButton);
southPanel.add(resetButton);
southPanel.add(newlyButton);
fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())));
northPanel.add(fractionLable);
mainFrame.setBounds(280,100,500,450);
mainFrame.setVisible(true);
}
public void randomBuild() {
int randoms,cols,rows;
for(int twins=1;twins<=15;twins++) {
randoms=(int)(Math.random()*25+1);
for(int alike=1;alike<=2;alike++) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
while(grid[cols][rows]!=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
}
this.grid[cols][rows]=randoms;
}
}
}
public void fraction(){
fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())+100));
}
public void reload() {
int save[] = new int[30];
int n=0,cols,rows;
int grid[][]= new int[8][7];
for(int i=0;i<=6;i++) {
for(int j=0;j<=5;j++) {
if(this.grid[i][j]!=0) {
save[n]=this.grid[i][j];
n++;
}
}
}
n=n-1;
this.grid=grid;
while(n>=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
while(grid[cols][rows]!=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
}
this.grid[cols][rows]=save[n];
n--;
}
mainFrame.setVisible(false);
pressInformation=false; //這里一定要將按鈕點擊信息歸為初始
init();
for(int i = 0;i < 6;i++){
for(int j = 0;j < 5;j++ ){
if(grid[i+1][j+1]==0)
diamondsButton[i][j].setVisible(false);
}
}
}
public void estimateEven(int placeX,int placeY,JButton bz) {
if(pressInformation==false) {
x=placeX;
y=placeY;
secondMsg=grid[x][y];
secondButton=bz;
pressInformation=true;
}
else {
x0=x;
y0=y;
fristMsg=secondMsg;
firstButton=secondButton;
x=placeX;
y=placeY;
secondMsg=grid[x][y];
secondButton=bz;
if(fristMsg==secondMsg && secondButton!=firstButton){
xiao();
}
}
}
public void xiao() { //相同的情況下能不能消去。仔細分析,不一條條注釋
if((x0==x &&(y0==y+1||y0==y-1)) || ((x0==x+1||x0==x-1)&&(y0==y))){ //判斷是否相鄰
remove();
}
else{
for (j=0;j<7;j++ ) {
if (grid[x0][j]==0){ //判斷第一個按鈕同行哪個按鈕為空
if (y>j) { //如果第二個按鈕的Y坐標大於空按鈕的Y坐標說明第一按鈕在第二按鈕左邊
for (i=y-1;i>=j;i-- ){ //判斷第二按鈕左側直到第一按鈕中間有沒有按鈕
if (grid[x][i]!=0) {
k=0;
break;
}
else{ k=1; } //K=1說明通過了第一次驗證
}
if (k==1) {
linePassOne();
}
}
if (y<j){ //如果第二個按鈕的Y坐標小於空按鈕的Y坐標說明第一按鈕在第二按鈕右邊
for (i=y+1;i<=j ;i++ ){ //判斷第二按鈕左側直到第一按鈕中間有沒有按鈕
if (grid[x][i]!=0){
k=0;
break;
}
else { k=1; }
}
if (k==1){
linePassOne();
}
}
if (y==j ) {
linePassOne();
}
}
if (k==2) {
if (x0==x) {
remove();
}
if (x0<x) {
for (n=x0;n<=x-1;n++ ) {
if (grid[n][j]!=0) {
k=0;
break;
}
if(grid[n][j]==0 && n==x-1) {
remove();
}
}
}
if (x0>x) {
for (n=x0;n>=x+1 ;n-- ) {
if (grid[n][j]!=0) {
k=0;
break;
}
if(grid[n][j]==0 && n==x+1) {
remove();
}
}
}
}
}
for (i=0;i<8;i++ ) { //列
if (grid[i][y0]==0) {
if (x>i) {
for (j=x-1;j>=i ;j-- ) {
if (grid[j][y]!=0) {
k=0;
break;
}
else { k=1; }
}
if (k==1) {
rowPassOne();
}
}
if (x<i) {
for (j=x+1;j<=i;j++ ) {
if (grid[j][y]!=0) {
k=0;
break;
}
else { k=1; }
}
if (k==1) {
rowPassOne();
}
}
if (x==i) {
rowPassOne();
}
}
if (k==2){
if (y0==y) {
remove();
}
if (y0<y) {
for (n=y0;n<=y-1 ;n++ ) {
if (grid[i][n]!=0) {
k=0;
break;
}
if(grid[i][n]==0 && n==y-1) {
remove();
}
}
}
if (y0>y) {
for (n=y0;n>=y+1 ;n--) {
if (grid[i][n]!=0) {
k=0;
break;
}
if(grid[i][n]==0 && n==y+1) {
remove();
}
}
}
}
}
}
}
public void linePassOne(){
if (y0>j){ //第一按鈕同行空按鈕在左邊
for (i=y0-1;i>=j ;i-- ){ //判斷第一按鈕同左側空按鈕之間有沒按鈕
if (grid[x0][i]!=0) {
k=0;
break;
}
else { k=2; } //K=2說明通過了第二次驗證
}
}
if (y0<j){ //第一按鈕同行空按鈕在與第二按鈕之間
for (i=y0+1;i<=j ;i++){
if (grid[x0][i]!=0) {
k=0;
break;
}
else{ k=2; }
}
}
}
public void rowPassOne(){
if (x0>i) {
for (j=x0-1;j>=i ;j-- ) {
if (grid[j][y0]!=0) {
k=0;
break;
}
else { k=2; }
}
}
if (x0<i) {
for (j=x0+1;j<=i ;j++ ) {
if (grid[j][y0]!=0) {
k=0;
break;
}
else { k=2; }
}
}
}
public void remove(){
firstButton.setVisible(false);
secondButton.setVisible(false);
fraction();
pressInformation=false;
k=0;
grid[x0][y0]=0;
grid[x][y]=0;
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()==newlyButton){
int grid[][] = new int[8][7];
this.grid = grid;
randomBuild();
mainFrame.setVisible(false);
pressInformation=false;
init();
}
if(e.getSource()==exitButton)
System.exit(0);
if(e.getSource()==resetButton)
reload();
for(int cols = 0;cols < 6;cols++){
for(int rows = 0;rows < 5;rows++ ){
if(e.getSource()==diamondsButton[cols][rows])
estimateEven(cols+1,rows+1,diamondsButton[cols][rows]);
}
}
}
public static void main(String[] args) {
lianliankan llk = new lianliankan();
llk.randomBuild();
llk.init();
}
}

//old 998 lines
//new 318 lines
參考資料:http://..com/question/36439800.html?fr=qrl3

『肆』 誰會寫asp網頁小游戲

要做什麼游戲?
由於HTTP協議的限制.如果做多人在線游戲的話
asp很難.

『伍』 FLASH小游戲網站源碼

http://www.yx99.com/?top
http://www.4399.com/

『陸』 有沒好點的小游戲網站ASP源碼源程序

我有的,最近也自己做了個ASP小游戲網站,很簡單,你看下,呵呵

『柒』 求:用asp寫剪刀石頭布小游戲的代碼

給你舉個例子,你運行一下,再看一看就明白其中的原理,然後你就可以修改成你要的樣子了:

<!--這個頁面的文件名叫tmp.asp-->
<html>
<body><%
id=trim(Request.QueryString("id"))
if isNumeric(id) then
id=cint(id)
if id>=0 and id<=2 then
dim dn(2)
dn(0)="石頭":dn(1)="剪刀":dn(2)="布"
randomize
tmp=int(rnd*3)
response.write "<script lanuage=""javascript"">alert(""您出的是【"&dn(id)&"】,電腦出的是【"&dn(tmp)&"】,您"
if id<tmp and not(id=0 and tmp=2) then
response.write "贏"
elseif id=tmp then
response.write "平"
else
response.write "輸"
end if
response.write "了!"")</script>"
end if
end if
%>
請點擊您的選擇:
<input value="石頭" type="button" style="width:50px" onClick="window.location.href='tmp.asp?id=0'"></input>
<input value="剪刀" type="button" style="width:50px" onClick="window.location.href='tmp.asp?id=1'"></input>
<input value="布" type="button" style="width:50px" onClick="window.location.href='tmp.asp?id=2'"></input>
</body>
</html>

『捌』 求用ASP做好的游戲網頁

不用高分~ 網路一下~找傳奇網頁源碼~就可以了!不知道你要的是不是單純的網頁~如果是帶有游戲並且可以運行的~那你可以找私服站裡面有網頁游戲~不過好像就幾個~而且不完整!

『玖』 一個ASP小程序

//VBScript的語法我不太懂,你看著改一下吧, JS的語法比較清晰易懂.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Test</title>
<script language=JavaScript>
<!--
function showTime(){
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var day = digital.getDate();
var month = digital.getMonth() + 1;
var year = digital.getYear();
var amOrPm = "AM";
if (hours > 11) amOrPm = "PM";
//if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes < 10) minutes = "0" + minutes;
if (seconds < 10) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds + " ";// + amOrPm;

var enabled = 0; today = new Date();
var day; var date;
if(today.getDay()==0) day = " 星期日"
if(today.getDay()==1) day = " 星期一"
if(today.getDay()==2) day = " 星期二"
if(today.getDay()==3) day = " 星期三"
if(today.getDay()==4) day = " 星期四"
if(today.getDay()==5) day = " 星期五"
if(today.getDay()==6) day = " 星期六"
document.fgColor = "000000";
var str = ['上午好','下午好','晚上好','夜裡好'];
var i = 0;
if(hours>=0 && hours<=6)
i = 3;
else if(hours>6 && hours<=12)
i = 0;
else if(hours>=12 && hours<=18)
i = 1;
else
i = 2;
date = "今天是:" + (today.getYear()) + "年" + (today.getMonth() + 1 ) + "月" + today.getDate() + "日" + day +" ";
document.getElementById("timeSpan").innerHTML = date + dispTime + str[i];
setTimeout("showTime()", 1000);
}
// -->
</script>
</head>

<body onload="showTime()">
<span id="timeSpan"></span>
</body>
</html>

『拾』 誰能發個asp結合flash製作的小游戲的實例和源文件啊。qq939402771

這可是好東西啊,已發。

熱點內容
為什麼電腦我的世界進不了伺服器 發布:2024-09-22 01:02:17 瀏覽:698
為什麼緩存不了柯南 發布:2024-09-22 01:01:34 瀏覽:819
蘋果手機怎麼修改無線網密碼 發布:2024-09-22 01:01:34 瀏覽:463
伺服器過熱會有什麼影響 發布:2024-09-22 00:40:32 瀏覽:907
sql2005安全 發布:2024-09-22 00:40:31 瀏覽:211
寬頻的密碼去哪裡看 發布:2024-09-22 00:39:08 瀏覽:647
unix編程實踐 發布:2024-09-22 00:32:42 瀏覽:295
sql寫入文件 發布:2024-09-21 23:58:23 瀏覽:511
易語言網路訪問 發布:2024-09-21 23:57:08 瀏覽:932
sql日期年份 發布:2024-09-21 23:56:57 瀏覽:818