Fw: Rosetta Code seeks programming examples

badmadevil badmadevil at gmail.com
Mon Jan 21 20:05:49 PST 2008


bearophile wrote:
> BCS:
>>> At the time of this writing, there are 16 examples written in D, out
>>> of 121 established tasks. That's only 13%.
> 
> And most of them are from me, I presume.
> There is the codecodex.com site too, and it looks more interesting than the rosettacode site, I have written D & Python code for both sites:
> http://www.codecodex.com/wiki/index.php?title=Main_Page
> 
> At the moment the codecodex.com site doesn't have a category for D, despite I have added many D implementations, some examples:
> http://www.codecodex.com/wiki/index.php?title=Convert_text_to_Morse_Code
> http://www.codecodex.com/wiki/index.php?title=Selection_sort
> http://www.codecodex.com/wiki/index.php?title=Shell_sort
> 
> I think such sites, like the Shootout, are good to make a language more known. I think the Haskell community takes them "seriously" enough.
> 
> Bye,
> bearophile

Hi, I'm just a noob ^^

I don't know who coded the D version of Arithmetic Evaluator.
I think it has bug.

http://rosettacode.org/rosettacode/w/index.php?title=Arithmetic_Evaluator
test:
   writefln(calculate("(3+50)*7-9"), ", ", (3+50)*7-9);
   writefln(calculate("(3+50)*7-9-1"), ", ", (3+50)*7-9-1);
   writefln(calculate("1+2"), ", ", 1+2);
   writefln(calculate("1+2+3"), ", ", 1+2+3);
   writefln(calculate("1+2+3+4"), ", ", 1+2+3+4);
   writefln(calculate("1+2+3+4+5"), ", ", 1+2+3+4+5);
   writefln(calculate("1+2+3+4+5+6"), ", ", 1+2+3+4+5+6);
   writefln(calculate("1+2+3+4+5+6+7"), ", ", 1+2+3+4+5+6+7);
output:
362, 362
362, 361
3, 3
3, 6
7, 10
7, 15
13, 21
13, 28

peace~



More information about the Digitalmars-d mailing list