最近儿子学校让孩子买关于数独的书,还要组织数独比赛。以开发为乐趣的父亲,把自己的解题思路用代码写出来,供大家参考、批评、指正。
在线测试地址:http://www.jmeditor.com/shudu/。
下面是源代码,可能不够优雅,一个晚上时间写出来的,也算有成果了。
(感谢mfkvfn的指正,在布局上做了些调整。)
<style>
li{list-style:none;}
.numdiv{width:470px;float:left;}
.numdiv li{width:50px;height:50px;text-align:center;float:left;}
.numdiv li input{width:40px;height:40px;font-size:36px;text-align:center;border:none 0px;margin-top:3px;}
.numdiv li input.s{background-color:gray;}
#outlog,#reslog{height:400px;}
#outlog{width:300px;}
#reslog{width:300px;margin-left:10px;}
.console{width:700px;float:left;margin-left:10px;}
#msg{margin-left:20px;height:30px;}
.btn{height:40px;}
.btn input{height:30px;margin-right:5px;};
.leftn{border-left:solid blue 1px;}
.top1{border-top:solid blue 1px;}
.right1{border-right:solid blue 1px;}
.bottom1{border-bottom:solid blue 1px;}
.right2{border-right:solid blue 3px;}
.bottom2{border-bottom:solid blue 3px;}
</style>
由于源代码过长,论坛有时会提示“脚本运行太慢,是否停止?”,所以只能上传附件了。