Programming Challenges! - Page 10 - Overclock.net - An Overclocking Community
Forum Jump: 

Programming Challenges!

Reply
 
Thread Tools
post #91 of 99 (permalink) Old 12-19-2008, 07:07 AM
Retired Staff
 
error10's Avatar
 
Join Date: Sep 2008
Location: Manchester, New Hampshire
Posts: 13,477
Rep: 1516 (Unique: 918)
Quote:
Originally Posted by Manyak View Post
Sure thing, if its better then why not?

Though I'm not sure how much faster you can get it, a good backtracking algorithm can do it in under 1s. I'd still like to see what you come up with though
Something that uses all 4 cores of my Q9550, probably.

I will not be pushed, filed, stamped, indexed, briefed, debriefed, or numbered! My life is my own.
I did error10's Windows Challenge and I now am an MCSE: Minesweeper Consultant and Solitaire Expert! graduated.gif
Sorry, I'm unable to provide technical support in private messages.


error10 is offline  
Sponsored Links
Advertisement
 
post #92 of 99 (permalink) Old 12-19-2008, 07:12 AM - Thread Starter
Retired Staff
 
Join Date: Mar 2008
Posts: 11,951
Rep: 726 (Unique: 481)
Quote:
Originally Posted by error10 View Post
Something that uses all 4 cores of my Q9550, probably.
lol ok yeah, there's always that

Manyak is offline  
post #93 of 99 (permalink) Old 12-26-2008, 05:48 PM
New to Overclock.net
 
mentholmoose's Avatar
 
Join Date: Jan 2007
Posts: 1,125
Rep: 130 (Unique: 117)
Here's the roman numerals one, in PHP:

Code:

<?php

$handle = fopen("roman.txt", "r");
$numbers_file = fread($handle, filesize("roman.txt"));
fclose($handle);

$numbers_array = explode("\
", $numbers_file);

foreach($numbers_array as $number) {
$number = preg_replace("/[\
\ ]/", "", $number);
print($number . ": " . strlen($number) . " characters beforehand.\
");
$old = strlen($number);
$number = str_replace("IIIII", "V", $number);
$number = str_replace("IIII", "IV", $number);
$number = str_replace("VIV", "IX", $number);
$number = str_replace("VV", "X", $number);
$number = str_replace("XXXXX", "L", $number);
$number = str_replace("XXXX", "XL", $number);
$number = str_replace("LXL", "XC", $number);
$number = str_replace("LL", "C", $number);
$number = str_replace("CCCCC", "D", $number);
$number = str_replace("CCCC", "CD", $number);
$number = str_replace("DCD", "CM", $number);
$number = str_replace("DD", "M", $number);
print($number . ": ". strlen($number) . " characters afterward.\
");
print("There were " . ($old - strlen($number)) . " characters saved.\
\
");
}
?>
It's verified working with the txt you provided. I think there are a couple of small cases where it won't, but none in your example file.

Jimmy Rollins, presented at your left, is impersonating the New York Mets.
mentholmoose is offline  
Sponsored Links
Advertisement
 
post #94 of 99 (permalink) Old 12-28-2008, 08:50 PM
New to Overclock.net
 
vaporvr6's Avatar
 
Join Date: Dec 2006
Location: brooklyn
Posts: 51
Rep: 1 (Unique: 1)
i'm need a new challenge. anyone got something for me?
vaporvr6 is offline  
post #95 of 99 (permalink) Old 12-28-2008, 08:55 PM
New to Overclock.net
 
vaporvr6's Avatar
 
Join Date: Dec 2006
Location: brooklyn
Posts: 51
Rep: 1 (Unique: 1)
sorry, just read the first post. one should note that not every sodoku has a solution. i suppose it's reasonable to assume that every puzzle a book would give you has one, however. else it wouldnt be any fun.
vaporvr6 is offline  
post #96 of 99 (permalink) Old 12-29-2008, 03:36 AM
New to Overclock.net
 
metala's Avatar
 
Join Date: Aug 2006
Location: Blagoevgrad, Bulgaria
Posts: 1,198
Rep: 48 (Unique: 43)
Quote:
Originally Posted by vaporvr6 View Post
i'm need a new challenge. anyone got something for me?
I have something for you.
"Elliptic curve cryptography"

* Generate keys
* Encode
* Decode

PS. I'm interested in it, but don't have the time to try. AFAIK this is one of the most secure asymmetric encryptions.

PS2. 112bit ECC has the security level of 2048bit RSA. (fixed)

"Alcohol is not the answer."
Milk is not the answer either, but nobody mentions it.

Gentoo worshipper, xterm is man's best friend.

metala is offline  
post #97 of 99 (permalink) Old 12-29-2008, 03:50 AM
New to Overclock.net
 
arkheii's Avatar
 
Join Date: Oct 2007
Posts: 1,758
Rep: 56 (Unique: 52)
Anyone looking for a good challenge may want to google for ACM programming competition questions.

arkheii is offline  
post #98 of 99 (permalink) Old 12-31-2008, 05:50 PM
New to Overclock.net
 
ToastedZergling's Avatar
 
Join Date: Dec 2008
Posts: 2
Rep: 0
I have given the #10 Crackless Wall Puzzle using javascript, but I'm having a problem calculating the larger values. I can get up to W (18, 5) = 7958, but if I go much further up on the first parameter I get array out of bounds errors and other ugly messages. Does anyone think they could lend a spare set of eyes to see how I can improve this? I'm thinking I will have to modify the permute function, which I didn't write to begin with

=( Sad face at modifying other people's code, I like it when their work can just be a big black box.
ToastedZergling is offline  
post #99 of 99 (permalink) Old 01-02-2009, 04:13 PM
New to Overclock.net
 
ToastedZergling's Avatar
 
Join Date: Dec 2008
Posts: 2
Rep: 0
I've moved on from this problem and into another! So if anyone wants to help me out / check out my progress thus far take a look here. It's all about optimization at this point.

Quote:
Originally Posted by ToastedZergling View Post
I have given the #10 Crackless Wall Puzzle using javascript, but I'm having a problem calculating the larger values. I can get up to W (18, 5) = 7958, but if I go much further up on the first parameter I get array out of bounds errors and other ugly messages. Does anyone think they could lend a spare set of eyes to see how I can improve this? I'm thinking I will have to modify the permute function, which I didn't write to begin with

=( Sad face at modifying other people's code, I like it when their work can just be a big black box.
ToastedZergling is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off