<html>
<head>
<title></title>
<meta charset="UTF-8" />
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="Concurrent.Thread-full-20080319.js"></script>
<script type="text/javascript" src="game.js"></script>
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript">
$(function(){
$('#button').click(function(event) {
var no = $('#no').val();
var orientation = $('#orientation').val();
var noReg = new RegExp("[^0-9]", "g");
var orientationReg = new RegExp("[^(,|0-9)]", "g");
if(no == "" || orientation == "" || noReg.test(no) || orientationReg.test(orientation)){
alert("输入不合法!");
return false;
}
orientation = orientation.replace(/,+$/g, "");
$('#node').append('<p>节点编号:<span name="no">' + $('#no').val() + '</span> 节点方向:<span>' + orientation + '</span><button id="delSingle" style="margin-left:5px;">删除</button><p>');
$('#no').val('');
$('#orientation').val('');
$('#no').focus();
});
$('#delSingle').live('click', function(event) {
$(this).parent().remove();
});
$('#delAll').live('click', function(event) {
$('#node').empty();
});
// $('#orientation').bind('keydown', function(event) {
// setTimeout("$('#orientation').val($('#orientation').val() + ',')", 300);
// });
});
</script>
<style type="text/css"></style>
</head>
<body align="center">
<div id="result" style="width:800px; margin-left:auto; margin-right:auto; margin-bottom:15px; min-height:20px;"></div>
<p style="margin:3px;">说明:节点为游戏中的点,节点方向为某节点所指向节点的编号,多个方向以逗号分开。<br/>
游戏开始前请按从上到下、从左到右为所有节点编号。
节点编号只能输入数字,节点方向只能输入数字、“,”。</p>
<div>
<span>节点编号:</span>
<input id="no" type="text" value="" style="width:30;">
<span>节点方向:</span>
<input id="orientation" type="text" value="">
<button id="button">添加节点</button>
</div>
<p style="margin-top:5px;"><button id="exec" >计算</button><button id="delAll" style="margin-left:5px">删除全部节点</button></p>
<div id="node"></div>
</body>
</html>
javascript编写 一笔画游戏解答程序
需积分: 50 4 浏览量
2014-01-08
22:11:32
上传
评论 2
收藏 201KB RAR 举报
迹-
- 粉丝: 50
- 资源: 19
最新资源
- (完整)数据库课程设计餐厅点餐说明书-21ab6d3c8beb172ded630b1c59eef8c75ebf952c.doc
- 2023-04-06-项目笔记 - 第一百五十四阶段 - 4.4.2.152全局变量的作用域-152 -2024.06.04
- 松哥解协议松哥解协议松哥解协议松哥解协议松哥解协议
- 618节日618节日618节日
- tensorflow-gpu-2.9.1-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp39-cp39-win-amd64.whl
- lcd daimalcd daima
- 电影领域-推荐算法-个性化内容-观影决策-电影推荐小程序.zip
- 电气控制PLC考试题库
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈