Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Rosetta PGA-TRAM

by Arunbear (Parson)
on May 21, 2012 at 14:37 UTC ( #971630=note: print w/replies, xml ) Need Help??


in reply to Rosetta PGA-TRAM

A nearly verbatim translation to Ruby:
$rtoa = { :M=>1000, :D=>500, :C=>100, :L=>50, :X=>10, :V=>5, :I=>1 } def roman_to_dec(roman) roman.split(//).map { |c| $rtoa[c.upcase.to_sym] }.reduce { |t, n | +t+n-t%n*2 } end %w[ XLII LXIX mi ].each { |r| puts roman_to_dec r }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971630]
help
Chatterbox?
[marto]: Discipulus, what did you have in mind?
[marto]: sort of related, have you seen sonic pi
[Discipulus]: choroba less than perl -le ' $==1,(1 x $_)=~/(^)(1|11\1 )*(?{$=++})^/, print $= for 0..10'?? congrats
[Discipulus]: marto i had in mind something for stupid peoples with smart phones; a free app (this is the the non perl part..) and some hardware to sell in big cities
[marto]: use libPD on Android/IOS, route to something listening on the pi :P
[marto]: libpd
[marto]: OSC

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2017-10-17 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (225 votes). Check out past polls.

    Notices?