Card game do you recommend?

I do a card game, a game of poker.

the problem is the following:

I keep the CSM in an example of table:

= cards [[1,2,3,4,5,6,7,8,9,10],

[1,2,3,4,5,6,7,8,9,10]

[1,2,3,4,5,6,7,8,9,10]

[1,2,3,4,5,6,7,8,9,10]];

ValueCards = [[1,2,3,4,5,6,7,8,9,10],

[11,12,13,14,15,16,17,18,19,20],

[21,22,23,24,25,26,27,28,29,30],

[31,32,33,34,35,36,37,38,39,40]];

I would recommend? Save the value and the STM in a table? so that the diagram comparison higher thanks to its index [i] [j]

or y at - it another way to declare the MC and the value of the cards to make comparisons between them to see which card is higher?

I can't see another way of stating that the MC and the value of other than in a table please help

I used an array of strings to the bridge and arrays of strings for each players hand.  I used 1, 2,..., 10, j, q, k and one for the value of the card combination with c, d, h, s for the 4 combinations.

for example, here's my Deck class and my class PokerRoundEvaluator

package com.kglad {}

import flash.display.MovieClip;

public class {bridge

var suitA: Array = ["C", "D", "H", "S"];

var cardsA:Array = [];

public void Deck() {}

for (var i: int = 0; i<>

var map: MovieClip = new MovieClip();

Card.Name = suitA [i %4]+(2+Math.Floor(i/4));]

var cardface:Card = new Card();

cardface.gotoAndStop(i+2);

var cardback:Card = new Card();

freeze frame 1

card.addChild (cardface);

card.addChild (cardback);

Card.face = cardface;

Card.Back = cardback;

cardface.highlight_mc. Visible = false;

cardback.highlight_mc. Visible = false;

Card.highlight_mc = cardface.highlight_mc;

cardsA.push (card);

card.cacheAsBitmap = true;

}

}

Shuffle before treatment

public function get cards (): Array {}

shuffleF (high);

Flip cards;

}

public void shuffleF(a:Array) {}

var p:int;

var t: *;

var ivar:int;

for (ivar =. Length-1; Ivar > = 0; Ivar-) {}

p = Math.Floor ((Ivar+1) * Math.Random ());

t = a [ivar];

a [ivar] = a [p];

a [p] = t;

}

}

}

}

package com.kglad {}

import com.kglad.Player;

import flash.display.MovieClip;

public class PokerRoundEvaluator {}

private var playerA:Array;

private var bestHandSA:Array = ["straightflush', 'quad', 'full House', 'flush', 'right', 'journey', 'twopair', 'pair', 'nothing'];

public void PokerRoundEvaluator() {}

}

public function set {players(playerA:Array):void}

this.playerA = playerA.slice ();

/*

for (var i: int = 0; i<>

for (var j: int = 0; j<>

trace (playerA [i] .bestPokerHand [j]. (Name)

}

}

*/

}

public function get (eval): Player {}

find the best hand, part 1

var bestHandIndex:int = bestHandSA.length;

for (var i: int = 0; i<>

bestHandIndex = Math.min (bestHandSA.indexOf(playerA[i].bestPokerHandS), bestHandIndex)

}

find the number of players with the best hand

var bestHandPlayersA:Array = [];

for (var j: int = 0; j<>

If (.bestPokerHandS [j] playerA is {bestHandSA [bestHandIndex])}

bestHandPlayersA.push (playerA [j]);

}

}

trace ("PokerRoundEvaluator bestHandPlayersA.length =", bestHandPlayersA.length);

{if(bestHandPlayersA.Length==1)}

return bestHandPlayersA [0];

}

Search now val higher among those who have the best hands

var winningPlayer:Player = bestHandPlayersA [0];

for (var k: int = 1; k<>

trace (winningPlayer.Name, "vs", bestHandPlayersA [k]. (Name)

If (arrayF (winningPlayer.bestPokerHand, {higherValueHandF (winningPlayer.bestPokerHand, bestHandPlayersA [k] .bestPokerHand)))}

trace ("no change");

} else {}

winningPlayer = bestHandPlayersA [k];

}

}

return winningPlayer

}

private void valueF(c:MovieClip):int {}

Return Number (c.name.substr (1));

}

private void higherValueHandF(a:Array,b:Array):Array {}

for (var i: int = a .length-1; I > = 0; i--) {}

{if (valueF (a [i]) > valueF (b [i]))}

return a;

} else if (valueF (a [i])<>

Back to b;

}

}

return a;

}

private void arrayF(a:Array,b:Array):Boolean {}

for (var i: int = 0; i<>

{if(a[i]!=b[i])}

Returns false;

}

}

Returns true;

}

}

}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • Wacom-click opens the app in Finder

    Hey guys!Then I use a small Pro Intuos 9 on my macbook pro (13 "retina with 10.11.5) Installed the latest drivers for the wacom and still encounter some problems While using the wacom (using also as a mouse) and tapping for example an icon on the doc

  • How can I delete log data?

    When I open google mail, and I start typing, a list of connections are presented to me... I erased all my history, but this is not enough, these names are always appearing. How can I remove it please?

  • Credit card was stolen. How can I pay for storage iCloud with Tunes gift card?

    Credit card was stolen. How can I pay for storage iCloud with Tunes gift card?

  • / etc/sudoers, 1242 but file size expected 2299

    Computer crashes often with many different applications, iMovie and Autocad running under parallels W / windows XP, constantly and safari and numbers occasionally. I went as far as backup, wipe my hard drive and reinstall the original operating syste

  • Jelly Bean question

    Two days ago, that I've updated my Droid Razor HD of Ice Cream Jelly Bean sandwich. It worked fine for a day. Then I discovered that I couldn't turn off the phone. She went from the screen/stop button of a screen of "restarting in safe mode. If I sai