Determine winning hand in 7 card poker in Elixir

Anulowany Opublikowano 3 lat temu Płatność przy odbiorze
Anulowany Płatność przy odbiorze

Elixir language

Write a program that from input deals 7 cards to 2 players. Then compare the 2 hands and determine the best hand.

The values of cards should look like this

Ace = 1

2=2

3=3

4=4

5=5

6=6

7=7

8=8

9=9

10=10

11=Jack

12=Queen

13= King

Ace is the highest valued card but is also 1.

Input is given and will look like this.

Input permutation

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

[40, 41, 42, 43, 48, 49, 50, 51, 52]

[40, 41, 27, 28, 1, 14, 15, 42, 29]

[30, 13, 27, 44, 12, 17, 33, 41, 43]

[27, 45, 3, 48, 44, 43, 41, 33, 12]

Winning hand (output)

["2C", "3C", "4C", "5C", "6C"]

["10S", "11S", "12S", "13S", "1S"]

["1C", "1D", "1H", "1S", "3S"]

["12C", "1H", "4D", "4H", "4S"]

["2S", "4S", "5S", "6S", "9S"]

First 4 inputs are the cards that will be dealt to the players (alternating)

The remaining 5 numbers are the cards the shared 5 card pool (Texas Holdem Style) that will go to each player.

So if input is [1,2,3,4,5,6,7,8,9]

Then each players hand will be

Player1: [1,3,5,6,7,8,9]

Player2: [2,3,5,6,7,8,9]

Then from 7 cards each player has determine the winner.

Card suits is determine by the input 1-13 is Clubs 14-27 is diamonds and so on. The exact translation is attached below.

Elixir

Numer ID Projektu: #26911330

O projekcie

2 ofert Zdalny projekt Aktywny 3 lat temu

2 freelancerów złożyło ofertę za $140 w tym projekcie

max329

Hello, sir. I'm professional at web hosting, CGI, software architecture, accounting, PDF, word, excel, powerpoint, matlab, octave, java, PHP, android, windows, A/V editing, c, c++, java, kotlin, exilir, etc... I can do Więcej

$30 CAD w ciągu 1 dnia
(0 Oceny)
0.0