(define betting-rules '(((forall x in other/active-players (poker:<= my/hand (lo-hand x))) ==> (raise max-raise)) ((forall x in other/active-players (poker:>= my/hand (hi-hand x))) ==> (raise max-raise)) ((forall x in other/active-players (avghand x)) ==> (call)) ((forall x in other/active-players (avghand x)) ==> (call)) (#t ==> (pass)))) (define declaration-rules '(((if (= num-active-players 1)) ==> (declare-high)) ((forall x in other/active-players (poker:<= my/hand (lo-hand x))) ==> (declare-low)) ((forall x in other/active-players (poker:>= my/hand (hi-hand x))) ==> (declare-high)) ((forall x in other/active-players (avghand x)) ==> (declare-high)) ((forall x in other/active-players (avghand x)) ==> (declare-low)) (#t ==> (declare-low)))) (define (avghand x) (if (>(/ (+ (position (car (hi-hand x)) hand-ordering) (position (car (lo-hand x)) hand-ordering)) 2) (position (car my/hand) hand-ordering)) #t #f)) (define position-helper (let ( (null? null?) (equal? equal?) (car car) (cdr cdr) (+ +) ) (lambda (elt lst num) (cond ((null? lst) #f) ((equal? elt (car lst)) num) (else (position-helper elt (cdr lst) (+ num 1)))) )) ) (define position (let ( (position-helper position-helper) ) (lambda (elt lst) (position-helper elt lst 0) )) ) (define poker-player (list 'Rash "V.Arvind" betting-rules declaration-rules (lambda () '()))) ;(define *print-to-file ; '("mypoker.txt" ; (table-info all-cards betting declarations showdown) ; (state-info rule-firings predicate-matching action-execution))) ;(define *print-to-screen* ; '(state-info predicate-matching rule-firings action-execution))