A little of coordination for Rosettacode

bearophile bearophileHUGS at lycos.com
Tue Feb 5 14:44:20 PST 2013


Jos van Uden:

> How do we avoid working on the same thing?

With a little coordination :-)


>> Partial translation of rcrpg-Python:
>> http://codepad.org/SflrKqbT
>>
>> Partial translation of 
>> permutations_rank_of_a_permutation-Python:
>> http://codepad.org/El9SQwOE
>
> The 2 above, I could try.
>
>> Plus a better Perl implementation of the uniform() on BigInts:
>> http://codepad.org/LGcMpk2f
>
> My perl is too rusty.

That perl is meant as a part of 
permutations_rank_of_a_permutation. Feel free to search for other 
good algorithms to implement uniform(BigInt,BigInt) much better 
than me. If this code comes out good enough, it must be added to 
Phobos (and it's meant to be designed better than the Java 
uniform generator for its bigintegers, because it doesn't give a 
correct range).


>> Partial translation of the universal_turing_machine-Ruby:
>> http://codepad.org/nUXLzAg2
>
> I'd have to first read up on the subject.

It's a simple task, just to implement an universal Turing 
machine. It's a matter of finding a balance between the too much 
high level Ruby version and a too much C-like version.
In D a simple way to implement a tape is with two dynamic arrays, 
one represents all the cells on the right to the starting 
position, and the other array is used "inverted", to represent 
all the cells on the left of the right position. There are faster 
solutions, but this is enough for the purposes of Rosettacode.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list