谁有Java扑克牌Forty thieves的算法和解决方案!
解决方案 »
- 求各位大神帮忙解决下!
- java调用C的库,如何声明回调函数呢?
- 请教一个打包,并生成exe执行文件的问题
- 如何让 textArea 自动换行??
- 用Java发送,接收短消息
- io读取文件的问题?
- JApplet载入图片的问题
- 请各位老大帮帮忙,我快疯了--在线
- 关于java报表的网站有那些?
- jBuilder4.0 Enterprise version那里有DOWN.谢谢谢谢。
- 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分给我!