| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1188 人关注过本帖
标题:求代写foxpro程式,付酬
取消只看楼主 加入收藏
kowloonfan
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-8-24
收藏
 问题点数:0 回复次数:4 
求代写foxpro程式,付酬
Hi,我想找人代写foxpro程式。
是用来计算纸牌的概率,不太复杂。
我想到的是...程式公开,人人可以写,由一人整理。我会有报酬赞助给本论坛。
报酬以字数计。
不知道这个主意如何?请给些意见。
搜索更多相关主题的帖子: 求代写 
2008-08-24 06:01
kowloonfan
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-8-24
收藏
得分:0 
首先谢谢各位关注。

因为要做一些赌业研究报告,我需要一些程式,用来计算纸牌游戏概率

有一种叫[百家乐]的赌場纸牌游戏,是用8副52张的标准扑克纸牌

我需要做幾个程式,用来计算游戏的概率

1. 输入已出牌,计算概率,需要用上 combinatorial analysis

2. simulation program 统计各级概率分布
另外有一种叫[算牌,card counting]的方法,给每张牌一个固定值

3. 模拟,统计各级出牌总值与胜出率的关系。


其实我也有写这类模拟程式,但我是自学的,半桶水,也是古代foxpro2.6,写起来困难重重。也不懂
得combinatorial analysis,所以希望有能人士帮助。
2008-08-27 20:23
kowloonfan
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-8-24
收藏
得分:0 
这里有一个程式源

http://www.

;;; -*-Lisp-*-

(in-package :user)
(use-package :kgk)

;;; ----------------------------------------------------------------------

(defun make-shoe (decks)
  (let* ((size (* decks 52))
         (v (make-array size))
         (index size)
         (cards
          (make-periodic
           '(1                          ; ace
             2 3 4 5 6 7 8 9 0          ; 2 through 10
             0 0 0)))                   ; :j, :q, :k
         )
    (dotimes (i size)
      (setf (aref v i) (pop cards)))
    #'(lambda (&optional shuffle)
        (when (or shuffle (= index size))
          (setf index 0)
          (shuffle! v))
        (unless shuffle
          (prog1 (aref v index)
            (incf index))))))

(defun sum (a b)
  "Determine the value of a Baccarat hand (either two or three cards)"
  (mod (+ a b) 10))

(defun trial (hit)
  (let* ((p (sum (funcall hit) (funcall hit)))        ; player
         (d (sum (funcall hit) (funcall hit)))        ; dealer (bank)
         )
    ;; pick more cards unless one or both sides has a "natural"
    (unless (or (>= p 8)                ; a "natural" for the player
                (>= d 8)                ; a "natural" for the dealer
                )
      ;; consider drawing a third card for the player
      (let ((p3 nil))
        (when (<= p 5)
          (setf p3 (funcall hit))
          (setf p (sum p p3)))
        ;; consider drawing a third card for the dealer
        (when (if (null p3)
                  (<= d 5)
                (or
                 (<= d 2)
                 (and (= d 3)
                      (/= p3 8))
                 (and (= d 4)
                      (<= 2 p3 7))
                 (and (= d 5)
                      (<= 4 p3 7))
                 (and (= d 6)
                      (<= 6 p3 7))))
          (setf d (sum (funcall hit) d)))))
    ;; pick the winner
    (cond ((= p d) :tie)
          ((< p d) :bank)
          (t :player))))
   
(defun play-hands (&optional (n 10000000))
  "Play a million hands of Baccarat and count the winners."
  (let ((player-wins 0)
        (bank-wins 0)
        (tie 0)
        (shoe (make-shoe 8)))
    (dotimes (i n)
      (ecase (trial shoe)
        (:tie (incf tie))
        (:bank (incf bank-wins))
        (:player (incf player-wins))))
    ;; report the results
    (values (float (/ bank-wins n))
            (float (/ player-wins n))
            (float (/ tie n)))))

;;; ----------------------------------------------------------------------

(defun estimate-losses (&key
                        (commission 0.05)
                        ;; these values came by running play-hands for 50M hands
                        (tie-return 9)
                        (p-bank 0.4586346)
                        (p-player 0.4461371)
                        (p-tie 0.0952283))
  "Figure out the losses in Baccarat"
  (labels ((note (situation &key (player-return 0) (bank-return 0) (tie-return 0))
                 (format t "Select ~A and lose ~A%.~&"
                         situation
                         (* 100 (+ (* p-bank bank-return)
                                   (* p-player player-return)
                                   (* p-tie tie-return))))))
    (note "player" :player-return 1 :bank-return -1 :tie-return 0)
    (note "bank" :player-return -1 :bank-return (- 1 commission) :tie-return 0)
    (note "tie" :player-return -1 :bank-return -1 :tie-return tie-return)))

;;; ----------------------------------------------------------------------
2008-08-27 20:26
kowloonfan
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-8-24
收藏
得分:0 
有没有高手帮忙?
2008-08-31 21:43
kowloonfan
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-8-24
收藏
得分:0 
呢十日来,我亦做了一部分功夫,由这里开始。。。
baccarat example
8 decks, 2 cards to player, 2 cards to banker (both first 2 cards only)
=> p1,p2,b1,b2

0000
0001
0002
...
0089
0099
...
0100
0101
0102
...
9989
9999
***
all=55*55=3025 groups
2008-09-12 18:28
快速回复:求代写foxpro程式,付酬
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031030 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved