Extras din proiect
Program Poker;
Uses Crt;
Const
heart = chr(3);
diamond = chr(4);
club = chr(5);
spade = chr(6);
Type
deck = array[1..4,1..13] of string[20];
card = string[20];
Var
index,index2,index3,index4,index5,
index6,index7,rank1,rank2,suit1,
suit2,num,num1,num2 : shortint;
new,straight : array[1..5] of shortint;
count,nodecimal,index8,
checktens : longint;
menu,choose : char;
throws : array[1..200] of char;
startdeck : deck;
tempsuit : string[8];
rank : array[1..14] of string[6];
suit : array[1..4] of string[8];
suitdraw : array[1..4] of string[1];
temp,temprank : card;
handrank,handsuit,playhand : array[1..5] of card;
handvalue : array[1..9] of card;
playdeck : array[1..52] of card;
hand : array[1..9] of boolean;
P : pointer;
winnings,numvalue : array[1..9] of real;
Money, bet,cash,totalmoney : real;
Label Suck,Youloseforreal;
Procedure Set_arrays;
Begin
for index := 1 to 9 do hand[index] := false;
for index := 1 to 9 do winnings[index] := 0;
for index := 1 to 9 do numvalue[index] := 0;
rank[1] := 'As'; rank[8] := 'Opt';
rank[2] := 'Doi'; rank[9] := 'Noua';
rank[3] := 'Trei'; rank[10] := 'Zece';
rank[4] := 'Patru'; rank[11] := 'Valet';
rank[5] := 'Cinci'; rank[12] := 'Dama';
rank[6] := 'Sase'; rank[13] := 'Popa';
rank[7] := 'Sapte'; rank[14] := 'As';
suit[1] := 'Inima'; suit[3] := 'Frunza';
suit[2] := 'Romb'; suit[4] := 'Trefla';
suitdraw[1] := Heart; suitdraw[3] := Club;
suitdraw[2] := Diamond; suitdraw[4] := Spade;
handvalue[1] := 'Royal Flush'; HandValue[2] := 'Straight Flush';
handvalue[3] := 'Four of a Kind'; HandValue[4] := 'Full House';
handvalue[5] := 'Flush'; HandValue[6] := 'Straight';
handvalue[7] := 'Three of a Kind'; HandValue[8] := 'Two Pair';
handvalue[9] := 'Pair-Face Cards';
End;
Procedure Fill_Deck;
Begin
count := 0;
index := 0;
while count < 4 do begin
inc(count);
while index < 13 do begin
inc(index);
startdeck[count,index] := rank[index] + ' de ' + suit[count];
end;
index := 0;
end;
end;
Procedure Shuffle_Deck(shuffles : longint);
Begin
randomize;
for count := 1 to (shuffles) do begin
suit1 := trunc(random*4) + 1;
rank1 := trunc(random*13) + 1;
suit2 := trunc(random*4) + 1;
rank2 := trunc(random*13) + 1;
temp := startdeck[suit1,rank1];
startdeck[suit1,rank1] := startdeck[suit2,rank2];
startdeck[suit2,rank2] := temp;
end;
End;
Procedure Firstcards;
Begin
num := 0;
count := 0;
Repeat
inc(count);
index := 0;
repeat
inc(num);
inc(index);
playdeck[num] := startdeck[count,index];
until index = 13;
until count = 4;
count := 0;
for count := 1 to 5 do playhand[count] := playdeck[count];
end;
Preview document
Conținut arhivă zip
- Joc de Poker in Pascal.doc