+ 1
CHALLENGE: Monty Hall problem simulator
Create a program which will create a simulation of a Monty Hall problem in any programming language. In a nutshell. You randomly pick one of three doors. Behind one of them is a prize. Computer reveals you a one wrong choise (among two other doors, which player didnt chose) and gives you a chance to change a door. In link below is more information about Monty Hall problem. https://en.m.wikipedia.org/wiki/Monty_Hall_problem GOOD LUCK! 😛
7 Réponses
+ 5
What should be input and what should be output?
+ 5
https://code.sololearn.com/cg58RlM6NS24/?ref=app
I haven't tested it, so please give your feedback!
+ 5
y should not = x. Did that happen?
+ 5
Auto for easier UI:
https://code.sololearn.com/c9OG33wP8R4h/?ref=app
+ 2
https://code.sololearn.com/cplB47R4ADwC/?ref=app
Since sololearn doesn't allow input while the program is running I just automated it instead.
I did it on phone so I tried to type as little as possible. :)
+ 1
thanks for question!
input: door you choose from 1 to 3 and would you like to change it "y"/"n" or "yes"/"no"
output: print text which shows whether you chose right or wrong (mandatory). show also what was behind all doors (optional)
+ 1
J.G. everything looks fine except int 'y' (revealed door) should not match with user input.