Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write code using elixir(erlang) code for the following application: The application is a simple Bridge Bidding game Your code module must have a withPermutation/1 function
Write code using elixir(erlang) code for the following application:
The application is a simple Bridge Bidding game
- Your code module must have a withPermutation/1 function that accepts a list of integers represting a deck of up to 52 cards and returns a "game object". Since there are no objects in Elixir, "game object" refers to data of some sort - possibly a tuple, map, process or array - that you choose to represent your game.
- Your code module must have a format/1 function that formats the "game object" as a string.
- When run via iex, the above methods would return results.
- Your code will be tested via iex -S mix.
- The marker should be able to run your program by entering the following code:
$ iex -S mix iex(1)> code.withPermutation([1,2,3,4]) |> code.format() |> IO.write() North S H D C 3 West East S S H H D D C 2 C 4 South S H D C 5 South West North East Pass Pass Pass Pass Declarer: None :ok iex(2)>
Note that the format function returns a string; it does no I/O.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started