Using the programming language Rust , write a program that deals two 2-card poker hands and a
Question:
Using the programming language Rust, write a program that deals two 2-card poker hands and a shared five card pool (the flop/turn/river for those who know these poker terms) according to the rules of Texas Hold\'em poker. Your program will determine the winning hand and return it. (ignore all talk of incremental betting/passing/folding, we arent considering that).
When determining the strength of each players hand, you will consider the two cards that player was dealt, as well as the five cards present in the shared pool. The stronger hand will be returned as the winner.
Program Input:
The input to your program will be the first 9 values in a permutation of the integers 1-52. This represents a shuffling of a standard deck of cards. The order of suits in an unshuffled deck are Clubs, Diamonds, Hearts, Spades. Within each suit, the ranks are ordered from Ace, 2-10, Jack, Queen, King.
Rust requirements:
In a single Rust file called Poker.rs, write a function called deal that accepts an array of integers as an argument and returns the winning hand. In Rust, the typing of the input argument and the return value are very important. Rust will NOT implicitly convert anything for you, so pay extra attention to this. The usage of the deal function must be as follows:
let perm:[u32;9] = [1, 2, 3, 4, 5, 6, 7, 8, 9]; let winner:Vec = deal(perm);Your deal function should accept an array of 9 unsigned integers, and your deal function should return a vector of five Strings. The strings should be formatted in the same way as all previous assignments.
Your submission should not include a main() function. The tester will implement main(). Finally, the deal function should be declared as public using the pub keyword. The required signature for your deal function is below:
pub fn deal(perm:[u32;9])->Vec { // Your code goes here }