home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Complete Encyclopedia of Games 3
/
GAMES1000V3_d2.iso
/
card
/
cardws17
/
inc
/
jp.cdh
< prev
next >
Wrap
Text File
|
1994-02-10
|
2KB
|
68 lines
#ifndef jppredicat
#define jppredicat
#include 'predicat.cdh'
predicate ValidOnPlayerStack?(c1,c2:Card) is
return((SameSuit?(c1,c2) and
(FollowRankWrap?(c2,c1) or
FollowRankWrap?(c1,c2))));
predicate ValidForCenterUp?(s1,s2:stack) is
return(((SameSuit?(s1[s1!],s2[s2!]) and
(FollowRankWrap?(s2[s2!],s1[s1!]))) or
((s2!=0) and (SameCard?(s2[0],s1[s1!])))));
predicate ValidForCenterDown?(s1,s2:stack) is
return(((SameSuit?(s1[s1!],s2[s2!]) and
(FollowRankWrap?(s1[s1!],s2[s2!]))) or
((s2!=0) and (SameCard?(s2[0],s1[s1!])))));
predicate ValidForTable?(c1,c2:Card) is
return(AlternateColor?(c1,c2) and FollowRankWrap?(c2,c1));
{--------------------------------------------------------------------------}
predicate IsDeuce?(c1 : card) is return (c1 mod 13)=Deuce;
predicate IsThree?(c1 : card) is return (c1 mod 13)=Three;
predicate IsFour?(c1 : card) is return (c1 mod 13)=Four;
predicate IsFive?(c1 : card) is return (c1 mod 13)=Five;
predicate IsSix?(c1 : card) is return (c1 mod 13)=Six;
predicate IsSeven?(c1 : card) is return (c1 mod 13)=Seven;
predicate IsEight?(c1 : card) is return (c1 mod 13)=Eight;
predicate IsNine?(c1 : card) is return (c1 mod 13)=Nine;
predicate IsTen?(c1 : card) is return (c1 mod 13)=Ten;
predicate IsJack?(c1 : card) is return (c1 mod 13)=Jack;
predicate IsQueen?(c1 : card) is return (c1 mod 13)=Queen;
{--------------------------------------------------------------------------}
procedure GrabItSideUp(P1,P2 : stack) is
if P1! > 0 then
begin
Turn P1[P1!] Side Up;
Pull 1 from P1 To P2;
end;
{--------------------------------------------------------------------------}
stack procedure Geta2FullDeckFaceDown(s : stack) is
begin
Add Ace+Spade .. King+Diamond;
Add Ace+Spade .. King+Diamond;
Turn s[1..s!] side down;
draw s;
Shuffle;
end;
{--------------------------------------------------------------------------}
stack procedure ShowShaded(c1 : card) is
begin
[0]:=c1;
Turn [0] Side Shaded;
end;
{--------------------------------------------------------------------------}
#endif