|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming | |
Programming Challenge
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#31 (permalink) | ||||||||||||||
|
Photography nut
![]() |
If we use some of the ACM challenges I don't think it'll matter that the answers can be found. You would be able to tell if they and you can find the answers to a lot of small programming problems with some searching.
![]() If you have some challenges that could be used, then please post them or provide a link so we can start organizing everything!
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
||||||||||||||
|
|
|
|
#32 (permalink) | |||||||||||||
|
Bifford
![]() |
Please send all suggestions via PM to Hobo or myself. If we post them here members will be able to get a head-start and potentially ruin a time based challenge. Hopefully we can get this rolling again.
__________________
Helpful Posts (Hopefully )Overclocker's Calculator Photo Editing - B&W w/Color Accents
|
|||||||||||||
|
|
|
|
#33 (permalink) |
|
Programmer
|
If you guys are interested in more programming challenges for the time being, check out www.hackthissite.org and click on "Programming" missions on the left hand side.
|
|
|
|
|
|
#34 (permalink) | |||||||||||
|
4.0ghz
![]() |
Not to beat a dead horse, but I just noticed this thread (haven't been on this site in months). Tried the first one; took a while, mostly because it's haha, my first python program (learning, after years of java). Not perfect but working and...readable
![]() Code:
import sys
input = "1,2,3,5,10,11,12,13,25,26"
if len(sys.argv) > 1:
input = sys.argv[1]
list = input.split(",")
output = ""
run = 0
for i in range(0, len(list)):
if i == 0 or output[-1] == ",":
output += list[i]
elif int(list[i]) == int(list[i-1]) + 1:
run = 1
pass
else:
if run:
output += "-" + list[i-1]
output += "," + list[i]
run = 0
if run:
output += "-" + list[-1]
print output
__________________
Overclocking in a nutshell: CyberDruid's BOOK | EvilXP's List of OCing Guides | DeathONator's Ultimate Overclocking Guide | The TOS Quote:
|
|||||||||||
|
|
|
|
#35 (permalink) | |||||||||||
|
4.0ghz
![]() |
Ok I did the third one (screw pascal, hehe).
First time I went through all the numbers divisible by that big factor, then checked each for palindromicityness Took FOREVER...Code:
def isPalindrome(num):
return str(num) == str(num)[::-1]
factor = 11*13*17*19*23*29
max = 99999999999999999999
quotient = max / factor
num = factor * quotient
while not isPalindrome(num):
quotient = quotient - 1
num = factor * (quotient)
print "testing " + str(num)
print "found it: " + str(num)
Code:
import sys
factor = 11*13*17*19*23*29
for a in range(9,0,-1):
for b in range(9,0,-1):
for c in range(9,0,-1):
for d in range(9,0,-1):
for e in range(9,0,-1):
for f in range(9,0,-1):
for g in range(9,0,-1):
for h in range(9,0,-1):
for i in range(9,0,-1):
for j in range(9,0,-1):
num = 10000000000000000001 * a +
1000000000000000010 * b +
100000000000000100 * c +
10000000000001000 * d +
1000000000010000 * e +
100000000100000 * f +
10000001000000 * g +
1000010000000 * h +
100100000000 * i +
11000000000 * j;
if num % factor == 0:
print "found it: " + str(num)
sys.exit(0)
Code:
$ time p 2a.py found it: 99976239844893267999 real 0m7.547s user 0m7.506s sys 0m0.033s
__________________
Overclocking in a nutshell: CyberDruid's BOOK | EvilXP's List of OCing Guides | DeathONator's Ultimate Overclocking Guide | The TOS Quote:
|
|||||||||||
|
|
|
|
#36 (permalink) | |||||||||||||||
|
Photography nut
![]() |
Quote:
Code:
#!/usr/bin/env ruby
org = ARGV.to_s.split(/,s*/).map {|n| n.to_i}.sort.uniq
con = org.first.to_s
one = true
for n in 1...org.size.to_i
if org[n].to_i > org[n-1]+1
con.concat "#{org[n-1]},#{org[n]}" if not one
con.concat ",#{org[n]}" if one
one = true
elsif one
con.concat "-" and one = false
end
end
p con
Code:
anomaly [~] $ time ruby convert.rb 1,2,8,4,12,34,15,17,16 "1-2,4,8,12,15-17,34" real 0m0.004s user 0m0.000s sys 0m0.004s
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
|||||||||||||||
|
|
|
|
#37 (permalink) | ||||||||||||||
|
Photography nut
![]() |
Just to give everyone a bit of a heads up, I plan to post a challenge Thursday (July 24) around 8pm EST. The dead line then I'm still not sure on. More details will come when the challenge is posted. I just wanted to give a heads up so no one (hopefully) sees the challenge at the last minute.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
||||||||||||||
|
|
|
|
#38 (permalink) | ||||||||||||
|
4.0ghz
![]() |
Quote:
will you post to this thread so we can get a subscription email?
__________________
_₌=The Q9550 Club=₌_
1.16VID Q9550 @ 4.0Ghz (and counting) - 8k ppd GPU - GPUz-Validation Overclock.net Headphone Club: Because perfect hair is overrated. EP45-UD3P/R M.I.T. Template Team Fortress 2 Club
|
||||||||||||
|
|
|
|
#39 (permalink) | ||||||||||||||
|
Photography nut
![]() |
Yes, I will post the challenge here in this thread.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
||||||||||||||
|
|
|
|
#40 (permalink) | ||||||||||||||
|
Photography nut
![]() |
Hey everyone, here is the new challenge. This one did not sound to difficult, but I don't know what everyones skill level here is.
The challenge: Create a program to convert a given dollar amount to written amounts. For example, the input $72.61 would output "seventy two dollars and sixty one cents". The dollar amount will be under $1000.00, so your program should be able to handle any dollar amount smaller then that. Creativity, efficiency and elegance are weighed to decide the winner. Any language is welcome. ![]() It does not matter how you let someone enter an amount to your program, just as long as it has a dollar sign($) and a decimal point. Deadline: Wednesday July 30th at 11:59pm EST. Wait to post your solutions till it's closer to the deadline. You don't want to give away how you solved it! (We'll wait for a 24 hour challenge to see who can solve something first) I plan to post another challenge then next Thursday at the same time (8:00pm ish EST). Post any questions you have. If this is too easy or too hard then please let me know!
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
Last edited by dangerousHobo : 07-24-08 at 09:50 PM |
||||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|