Hey, Commander Keen, you fancy implementing this thing now?
Announcement
Collapse
No announcement yet.
programming challenge...
Collapse
X
-
Still pondering it.
An advantage in pl/sql is that I can format a string out of all that mess and execute it and simply create an error trap that does null if the thing isn't translatable into a math equation all with very little code.
next thing to think about: what is the maximum number of paren pairs for a list n long.
This is going to beat up the server pretty bad.
The bad news: pl/sql is not array friendly and Fike's algorithm in the Dr Dobbs article uses them.
I might just use table inserts. The servers I have access to would just cache them so it would be nearly as fast as an array.
PS I might add that we are in the land of "not elegant" with this one.Chuck
秋音的爸爸
Comment
-
If you wonna give it a go, I'd go with PERL.
- very array friendly.
- you can cache results and its equation Strings easily, with a hash table (part of the language) where the result is the key and the values is an array of strings:
$result{6} = ( "1+2+3" , "((2 * 4) / 2) + 2 " , etc ...)
- you can eval a string (execute it) very simply using the built in: eval ("some string") function
- you can use many list permutations libraries such as http://search.cpan.org/~phoenix/List...22/Permutor.pm
I'm not sure sql is the best way to go, though it might be interesting.Originally posted by Gurm.. some very fair skinned women just have a nasty brown crack no matter what...
Comment
-
Originally posted by FatBastard View Post
If you wonna give it a go, I'd go with PERL.
...
I'm not sure sql is the best way to go, though it might be interesting.
PERL would no doubt be better, but I don't think this project would benefit from me starting out on a language I don't already know.
Why don't you start in PERL?
PS I downloaded a free perl and the open perl ide and poked around a bit.
PERL was made for this problemLast edited by cjolley; 3 August 2007, 09:25.Chuck
秋音的爸爸
Comment
Comment