谁有Java扑克牌Forty thieves的算法和解决方案!
解决方案 »
- 问一个一会就很可能被和谐掉的问题
- 请大家给一个使用java类格式化date对象为一个指定格式String的例子。
- 各位大哥大姐 能否说一下jBuilder 里的一些热键,象单步调试的是哪个,谢谢
- 有SWING高手吗? 帮我改一下这个JTree 能遍历整个系统的 拜托了
- 记事本练习的程序为何编译出错,一个线程的问题(明天去公司上机考试)
- 编译无法通过:non-static method power(int,int) cannot be referenced from a static context
- 关于静态方法的调用的问题??
- 关于查找文件的问题
- 绝对地送分。。。。android字符串顺序问题
- 关于java的事件问题,如何在程序中使一个button被click,从而引发这个button的事件处理代码????
- Java , Installanywhere 在 Redhat 上的中文问题解决方法
- SOS 使用eclipse时Jboss怎么安装配置呀,eclipse-examples-2.1.1-win32.zip.md5怎么解压?谢谢
洗牌再完美版:
<SCRIPT LANGUAGE=vbscript >
function xipai(mystr)
xipai=""
if len(mystr)=0 then'如果是空的,那么初试化一付连续的牌
for i=1 to 52
mystr=mystr & "<" & i & "> "
next
end if
dim i,x
for i=1 to 52
myarry=split(mystr) 'myarry是下标52的数组,前0-51个有效
randomize
x=cint(rnd*(ubound(myarry)-1))'前0-51个随便找一个
mystr=replace(mystr, myarry(x) & space(1),"")'从没发的牌中随便挑一张
xipai=xipai & myarry(x) & space(1)
next
end functionfunction XP(n)
mystr="xipai("""")"
dim i
for i=1 to n
mystr="xipai(" & mystr & ")"
next
XP=eval(mystr)
end function
document.write "洗牌完美版" & "<br/>"
document.write "洗一次牌:" & XP(1) & "<br/>"
document.write "洗两次牌:" & XP(2) & "<br/>"
document.write "洗三次牌:" & XP(3) & "<br/>"
document.write "洗一百次牌:" & XP(100) & "<br/>"
</SCRIPT>
mei dong dong???
地址:
http://cosoft.org.cn/html/osl/download.php?file_id=6754&f=javasol-1.1.tar.gz&g_u_n=javasolitaire
100分给我!