Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/games/CaribbeanStud/files/patch-Deck.cpp
16461 views
1
--- ./Deck.cpp.orig 2013-10-29 15:12:13.000000000 -0200
2
+++ ./Deck.cpp 2013-10-29 15:12:13.000000000 -0200
3
@@ -38,7 +38,8 @@
4
_globalCards[j] = Card(j);
5
_globalInit = 1;
6
}
7
- for(int i =0 ; i < _numOfCards; i++)
8
+ int i;
9
+ for(i =0 ; i < _numOfCards; i++)
10
_cards[i] = & _globalCards[i];
11
for(i=_numOfCards; i < 54; i++)
12
_cards[i] = (Card *) 0;
13
@@ -55,7 +56,7 @@
14
{
15
for (int i = 0; i < _numOfCards/2; i++)
16
to[i*2] = from[_numOfCards/2+i];
17
- for ( i = 0; i < _numOfCards/2; i++)
18
+ for (int i = 0; i < _numOfCards/2; i++)
19
to[i*2+1] = from[i];
20
Card **tmp = from;
21
from = to;
22
@@ -82,13 +83,13 @@
23
24
for(int i=_numOfCards-cut; i< _numOfCards; i++)
25
tmp[i] = _cards[i];
26
- for( i = _numOfCards-1; i >= cut; i--)
27
+ for(int i = _numOfCards-1; i >= cut; i--)
28
_cards[i] = _cards[i-cut];
29
- for( i = 0; i < cut; i++)
30
+ for(int i = 0; i < cut; i++)
31
_cards[ i ] = tmp[i + _numOfCards-cut];
32
#ifdef DEBUG
33
cout << "Cutting at " << _numOfCards-cut <<endl;
34
- for ( i = 0; i < _numOfCards; i++ ){
35
+ for (int i = 0; i < _numOfCards; i++ ){
36
if( i%10 == 0 ) cout << endl;
37
cout << _cards[i]->Suit() << (int)_cards[i]->Rank() << " ";
38
}
39
40