Question: 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

  1. 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.
  2. Your code module must have a format/1 function that formats the "game object" as a string.
  3. When run via iex, the above methods would return results.
  4. Your code will be tested via iex -S mix.
  5. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!