谁有Java扑克牌Forty thieves的算法和解决方案!

解决方案 »

  1.   


    洗牌再完美版:
    <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>
      

  2.   

    Forty thieves 
    mei dong dong???
      

  3.   

    给你一个~
    地址:
    http://cosoft.org.cn/html/osl/download.php?file_id=6754&f=javasol-1.1.tar.gz&g_u_n=javasolitaire
    100分给我!