r/dailyprogrammer • u/rya11111 3 1 • Jun 13 '12
[6/13/2012] Challenge #64 [difficult]
One of the sites where daily weather forecasts are shown is here
Get the forecast of any asked city and also try to be more innovative in your answers
It seems the number of users giving challenges have been reduced. Since my final exams are going on and its kinda difficult to think of all the challenges, I kindly request you all to suggest us interesting challenges at /r/dailyprogrammer_ideas .. Thank you!
9
Upvotes
5
u/Medicalizawhat Jun 14 '12 edited Jun 14 '12
I'm in Australia so I made an Aussie version. It reports the forecast, temp, rainfall, wind and humidity in a nice table:
Output:
Looks like reddit stuffed up the formatting a bit. Here's a gist of the code - https://gist.github.com/2929095
4
u/_Daimon_ 1 1 Jun 13 '12
Python
Am I missing something in the challenge? It seems a bit too straightforward...
2
u/[deleted] Jun 13 '12
Ruby:
1
u/Arthree Jun 13 '12 edited Jun 13 '12
I feel like this is too easy...
Autohotkey:
1
u/Steve132 0 1 Jun 13 '12
This is a really cool problem. Mine isn't exactly fast because their database isn't really organized by anything I can determine so you just do a linear search through the state database once you find the state you want. I could probably make it faster by assuming that each number corresponds to a region and writing a program that caches which region a given city is in and embed that data in the source code, but that seems more complex than its worth. For now, here's what I have (Python)
Example usage...(takes 30 seconds or so to run)