f



numbers to text

How do you change a list of numbers say,:

[1,6]

will give me a result of

[s,i,x,t,e,e,n]

[1,3]

will give me:

[t,h,i,r,t,e,e,n]

[1,9,0,0]

will result:

[o,n,e,t,h,o,u,s,d,n,i,n,e,h,u,n,d,r,e,d]
0
equinox
11/10/2008 2:39:54 PM
comp.lang.prolog 3728 articles. 0 followers. Post Follow

5 Replies
538 Views

Similar Articles

[PageSpeed] 38

On Mon, 10 Nov 2008 06:39:54 -0800 (PST), equinox
<aditya15417@gmail.com> wrote:

>How do you change a list of numbers say,:
>
>[1,6]
>
>will give me a result of
>
>[s,i,x,t,e,e,n]
>
>[1,3]
>
>will give me:
>
>[t,h,i,r,t,e,e,n]
>
>[1,9,0,0]
>
>will result:
>
>[o,n,e,t,h,o,u,s,d,n,i,n,e,h,u,n,d,r,e,d]

You change by writing program in Prolog

A>L.
0
A
11/10/2008 3:21:26 PM
On Nov 10, 8:21=A0am, A.L. <alewa...@zanoza.com> wrote:
> On Mon, 10 Nov 2008 06:39:54 -0800 (PST), equinox
>
>
>
> <aditya15...@gmail.com> wrote:
> >How do you change a list of numbers say,:
>
> >[1,6]
>
> >will give me a result of
>
> >[s,i,x,t,e,e,n]
>
> >[1,3]
>
> >will give me:
>
> >[t,h,i,r,t,e,e,n]
>
> >[1,9,0,0]
>
> >will result:
>
> >[o,n,e,t,h,o,u,s,d,n,i,n,e,h,u,n,d,r,e,d]
>
> You change by writing program in Prolog
>
> A>L.

yes, but I am asking how can I change it
0
equinox
11/10/2008 7:09:35 PM
On Mon, 10 Nov 2008 11:09:35 -0800 (PST), equinox
<aditya15417@gmail.com> wrote:

>On Nov 10, 8:21´┐Żam, A.L. <alewa...@zanoza.com> wrote:
>> On Mon, 10 Nov 2008 06:39:54 -0800 (PST), equinox
>>
>>
>>
>> <aditya15...@gmail.com> wrote:
>> >How do you change a list of numbers say,:
>>
>> >[1,6]
>>
>> >will give me a result of
>>
>> >[s,i,x,t,e,e,n]
>>
>> >[1,3]
>>
>> >will give me:
>>
>> >[t,h,i,r,t,e,e,n]
>>
>> >[1,9,0,0]
>>
>> >will result:
>>
>> >[o,n,e,t,h,o,u,s,d,n,i,n,e,h,u,n,d,r,e,d]
>>
>> You change by writing program in Prolog
>>
>> A>L.
>
>yes, but I am asking how can I change it

This is your homework and you should figure it out

A.L.

P.S> You can also wait until Mr Jonas from University of Koblenz,
Germany will do this for you
0
A
11/10/2008 9:10:51 PM
A.L. wrote:

> On Mon, 10 Nov 2008 11:09:35 -0800 (PST), equinox
> <aditya15417@gmail.com> wrote:
> 
>>On Nov 10, 8:21 am, A.L. <alewa...@zanoza.com> wrote:
>>> On Mon, 10 Nov 2008 06:39:54 -0800 (PST), equinox
>>>
>>>
>>>
>>> <aditya15...@gmail.com> wrote:
>>> >How do you change a list of numbers say,:
>>>
>>> >[1,6]
>>>
>>> >will give me a result of
>>>
>>> >[s,i,x,t,e,e,n]
>>>
>>> >[1,3]
>>>
>>> >will give me:
>>>
>>> >[t,h,i,r,t,e,e,n]
>>>
>>> >[1,9,0,0]
>>>
>>> >will result:
>>>
>>> >[o,n,e,t,h,o,u,s,d,n,i,n,e,h,u,n,d,r,e,d]
>>>
>>> You change by writing program in Prolog
>>>
>>> A>L.
>>
>>yes, but I am asking how can I change it
> 
> This is your homework and you should figure it out
> 
> A.L.
> 
> P.S> You can also wait until Mr Jonas from University of Koblenz,
> Germany will do this for you

Hi,

I have no solution for you, just a hint:

123 million 456 thousand 789.
---         ---          ---
if you can do it with numbers <= 999 you can easy get the greater numbers.
the hundred-position is easy: one, two three ... hundred
the ten postion is easy: twenty, thirty, ...ninety
the teens (11,12,13,14,15,16,17,18,19) take seperatly
the one position is easy (if it is not in a teen): one, two, ..., nine

ok, good luck!
0
Jonas
11/11/2008 7:59:25 PM
On Tue, 11 Nov 2008 20:59:25 +0100, Jonas wrote:

> A.L. wrote:
> 
>> On Mon, 10 Nov 2008 11:09:35 -0800 (PST), equinox
>> <aditya15417@gmail.com> wrote:
>> 
>>>On Nov 10, 8:21 am, A.L. <alewa...@zanoza.com> wrote:
>>>> On Mon, 10 Nov 2008 06:39:54 -0800 (PST), equinox
>>>>
>>>>
>>>>
>>>> <aditya15...@gmail.com> wrote:
>>>> >How do you change a list of numbers say,:
>>>>
>>>> >[1,6]
>>>>
>>>> >will give me a result of
>>>>
>>>> >[s,i,x,t,e,e,n]
>>>>
>>>> >[1,3]
>>>>
>>>> >will give me:
>>>>
>>>> >[t,h,i,r,t,e,e,n]
>>>>
>>>> >[1,9,0,0]
>>>>
>>>> >will result:
>>>>
>>>> >[o,n,e,t,h,o,u,s,d,n,i,n,e,h,u,n,d,r,e,d]
>>>>
>>>> You change by writing program in Prolog
>>>>
>>>> A>L.
>>>
>>>yes, but I am asking how can I change it
>> 
>> This is your homework and you should figure it out
>> 
>> A.L.
>> 
>> P.S> You can also wait until Mr Jonas from University of Koblenz,
>> Germany will do this for you
> 
> Hi,
> 
> I have no solution for you, just a hint:
> 
> 123 million 456 thousand 789.
> ---         ---          ---
> if you can do it with numbers <= 999 you can easy get the greater
> numbers. the hundred-position is easy: one, two three ... hundred the
> ten postion is easy: twenty, thirty, ...ninety the teens
> (11,12,13,14,15,16,17,18,19) take seperatly the one position is easy (if
> it is not in a teen): one, two, ..., nine
> 
> ok, good luck!


Another hint: the div and mod operators can be useful for such a function.

Dhu

-- 
Duncan Patton a Campbell is Dhu
0
Duncan
11/14/2008 9:12:04 PM
Reply: