Professional Documents
Culture Documents
Time Limit
You have 1 hour to complete this game.
Instructions
Please read the instructions carefully and submit a solution to the task described below.
You can use notepad, or your code editor of choice (i.e. Notepad++ VS Code, etc.) to build your
solution. Once complete, save your code to a text file and save it under your name on the flash drive
provided. You are free to access resources on the internet to assist with the design of your solution.
Note that any plagiarism of similar tests / solutions will result in a fail.
Task
Design the code for a solution that satisfies the criteria given below. Design your solution to show
solid programming technique including functions, and reusable code where applicable. Demonstrating
problem solving skills and solid design are more important than the coding language used. You may
use C#, pseudo code or a combination of the two.
Game
Description
In front of you is a row of 6 coins, with random values between 1 and 100.
You are asked to play the following game. You and an opponent take turns choosing either the first or
last coin from the row, removing it from the row, and receiving the value of the coin.
** Assume that both players always take the coin with the highest value.
** Coin values can repeat, if the coins are equal value then the first coin in the row is taken.
Examples:
{ 99, 9, 4, 33, 25, 11 } returns 133
{ 5, 1, 10, 5, 5, 5 } returns 20
Add to your program the ability to simulate the game over 10 iterations and keep a count of the
final score for each game. Each game should generate a random set of coins, simulate the game
and output the points for the first player.