![]() |
Re: Programming Challenges?
Here's an interesting one, well I think it's interesting if only from a counter-intuitive statistical perspective.
The 'Monty Hall problem'. Today's challenge (if you're interested) is to implement the conditions: there's a Ferrari hidden randomly behind one of 3 doors, and a goat behind the other two. You want the Ferrari. You choose one door, and the host then eliminates one of the goats (the host knows where the Ferrari is). So now there's two choices left. The statistical conundrum is: should you stick with your choice or change to the other door? Which one has the best odds? Run the program in both conditions (switch/no switch) for a decent number of trials, and record the probabilities of getting the car. You'll be surprised. BTW: I've done this one before, and it really is quite simple. My code is about 30 lines, but a third of that is variable declaration and printing. It prints "Hello World" as well... :) |
Re: Programming Challenges?
Quote:
|
Re: Programming Challenges?
When I were't lad.........
My first programming language in 1980 was IBM Mainframe Assembler, with 2, 4, and 6 byte instructions, and if you weren't careful, you could overwrite the instruction, which would result in "interesting" outputs (and the code was input in punch cards.....). |
Re: Programming Challenges?
Quote:
---------- Post added at 06:39 ---------- Previous post was at 06:37 ---------- Quote:
I like perl, it's useful for writing code that looks like characters from comics when they swear. |
Re: Programming Challenges?
Well when I started in the 1980's I was writing code on ICL Mainframes using COBOL. Can't beat that language.....
|
Re: Programming Challenges?
My java version of the 3&5 divisor in one line (ignoring all the usual boilerplate java
Spoiler:
|
Re: Programming Challenges?
Quote:
|
Re: Programming Challenges?
Quote:
I can answer that question if it will help anybody with the code? :D |
Re: Programming Challenges?
Quote:
I should really do the sorting challenge and the Monty Hall Problem one. (P.S It's a pretty famous one, you always change). If you program all week it's tiring :P |
Re: Programming Challenges?
Apologies for the lack of indentation but I couldn't get it to look right. Anyway, here's my effort -
Spoiler:
|
Re: Programming Challenges?
Quote:
Quote:
|
Re: Programming Challenges?
Quick and dirty 3 and 5 divisibility test in vbscript
Spoiler:
|
Re: Programming Challenges?
Excel vba.
Spoiler:
|
Re: Programming Challenges?
I've added spoiler tags to the last two just to maintain the convention and so as not to spoil the fun for anybody else that's playing along :)
|
Re: Programming Challenges?
Cool ... I didn't know how to do them! :)
|
All times are GMT +1. The time now is 03:40. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum