home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Complete Encyclopedia of Games 3
/
GAMES1000V3_d2.iso
/
card
/
cardws17
/
inc
/
stack.cdh
< prev
next >
Wrap
Text File
|
1994-02-06
|
584b
|
32 lines
#ifndef cwsstack
#define cwsstack
stack procedure MoveFirstFrom(c1 : card; src : stack) is
var i : integer;
begin
i:=1;
while i<=src! do
if (src[i] mod 13)=c1 then
begin
Move src[i] to [!+1];
Turn [!] side up;
Draw src;
break;
end
else i:=i+1;
end;
stack procedure MoveAllFrom(c1 : card; src : stack) is
var i,j : integer;
begin
i:=1;
j:=!+1;
while i<=src! do
if (src[i] mod 13)=c1 then
Move src[i] to [!+1]
else i:=i+1;
if j<=! then Turn [j..!] side up;
Draw src;
end;
#endif