Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ challenge - Perl Numerals

Name: Anonymous 2016-12-02 21:10

Perl numerals is a way to represent natural numbers in Perl wihtout the use of numeric literals, examples:
say !''>>!''; # 0
say !''; # 1
say !''<<!''; # 2
say !''<<!''|!''; # 3
say !''<<!''<<!''; # 4
say !''<<!''<<!''|!''; # 5


Your task is to write a function that given a natural number returns a valid Perl numeral expression that evaluates into that same number.

Name: Anonymous 2016-12-02 21:52

>>2
you need use 5.010; at least to use say(), otherwise just print and add a new line character.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List