当前位置:首页 » 操作系统 » 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

这可是好东西啊,已发。

热点内容
phpxss攻击 发布:2024-09-22 03:46:17 浏览:734
电脑怎么通过网线访问服务器网线 发布:2024-09-22 03:45:35 浏览:746
如何查已有网络的密码 发布:2024-09-22 03:31:30 浏览:893
驱动forlinux 发布:2024-09-22 03:15:50 浏览:789
凌派车有哪些配置 发布:2024-09-22 03:15:00 浏览:749
压缩文件为什么打不开 发布:2024-09-22 03:09:13 浏览:645
我的世界缓存清理 发布:2024-09-22 03:09:10 浏览:644
斗地主癞子算法 发布:2024-09-22 03:08:09 浏览:120
解释与编译的区别 发布:2024-09-22 02:58:26 浏览:90
示教系统有哪些配置 发布:2024-09-22 02:47:13 浏览:261