/montyhall

App based on the tv show "Let's make a deal"

Primary LanguageJavaScript

Installation

yarn install

Run the app

yarn start

Demo: https://ramsen-axakon.github.io/montyhall/

Assignment

The purpose of this test is to see how you design and write your code given a problem. Try to use right level of OOP. The problem is a well-known puzzle that you can read more about at http://en.wikipedia.org/wiki/Monty_Hall_problem . Save reading the link if you do not want to know the answer until you have solved the problem. Problem description: Assume that you are attending a TV show where you can win money by picking the right box. The game show host shows you three boxes explaining that the money is in one of the boxes. He asks you to pick one of them without opening it. After you have picked one of the boxes he opens one of the other two boxes which is empty. Now he turns to you and asks, do you want to change your mind, picking the remaining box?

Your task: Write a program (Swift for iOS, Kotlin for Android or Javascript for Web) randomly simulating this event over and over again in the quest of answering following question. Do I stand a better chance to win if I change my mind? Send your code in a zipped but renamed file removing the ‘.zip’ suffix. Else the spam filters may catch the e-mail. Include instructions on how to run the program. Do not hesitate to ask questions if something is unclear.

Todo

Create 3 boxes where only one can have money inside [x] Create a function that randomizes the value of boxes [x] Create a function that returns box without money inside [x] Display rules of game [x] Display 3 boxes [x] Make it possible to click on one box [x] Display when tv host opens the empty box [x] Make it possible for user to pick the remaining box [x] Display the content of the users box [x]