[QUIZ PROPOSAL] autoreferential letter count

P

Paolo Capriotti

I propose the following for the next week quiz:

Write a ruby program that takes a sentence as its input an produces an
output that autoreferentially describes the letters found in the
sentence _and_ the description itself.

This is an example in italian:

Questa nota contiene esattamente: cinque A sette C nove D diciotto E
dodici I due M otto N undici O tre Q due R sei S diciotto T sette U
due V.

That means:

This note contains exactly: five A's seven C's nine D's eighteen E's
twelve I's two M's eight N's eleven O's three Q's two R's six S's
eighteen T's seven U's two V's.

(which is false, but its' true in the italian version).

I'm sorry I don't have an English example at the moment, but I hope
that the problem is quite easy to understand anyway.

Paolo
 
J

Josef 'Jupp' SCHUGT

Hi!

=20
I propose the following for the next week quiz:
=20
Write a ruby program that takes a sentence as its input an produces
an output that autoreferentially describes the letters found in the
sentence _and_ the description itself.

As long as one restricts oneself to a single language that is no
problem but as soon as several languages are involve things become
naughty. Dutch 'co=F6rdinatie" (coordination) contains

1 a, 2 c, 1 d, 1 e, 2 i, 1 n, 2 o, 1 r, 1 t

while German "Di=E4tplan" contains

1 a, 1 =E4, 1 d, 1 i, 1 l, 1 n, 1 p, 1 t

You see that depending on the language the trema either introduces a
new letter or not.

Even if a German sentence contains no umlaut (=E4, =F6, =FC) at all, the
count still may because 5 reads 'f=FCnf' (as a result the '=FC' is
contained in any number containing the digit '5'), and 12 reads
"zw=F6lf'.

Tot ziens,

Josef 'Jupp' Schugt
--=20
Diese E-Mail wurde moeglicherweise erst mehrere Stunden nach ihrer
Fertigstellung versendet, um Onlinekosten zu sparen.
This e-mail has possibly been sent several hours after composition
in order to reduce online costs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[QUIZ] Panagrams (#86) 25

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top