COMP.THEORY-------------- < Пред. | След. > -- < @ > -- < Сообщ. > -- < Эхи > --
 Nп/п : 84 из 100
 От   : Richard Damon                       2:5075/128        03 сен 23 15:54:31
 К    : Charlie-Boo                                           03 сен 23 01:56:01
 Тема : Re: Simple Programming Problem but How Many Ways to Do It?
----------------------------------------------------------------------------------
                                                                                 
@MSGID: SuUf.772249@fx14.iad>
0fc05830
@REPLY:
<6f144545-d915-436d-b90d-a610ae747dfcn@googlegroups.com> 264cd2ad
@REPLYADDR Richard Damon
<Richard@Damon-Family.org>
@REPLYTO 2:5075/128 Richard Damon
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<865bc1f2-ae48-48cb-8140-4fb96fb33eeen@googlegroups.com> xMqa.162772@fx12.iad>
<6f144545-d915-436d-b90d-a610ae747dfcn@googlegroups.com>
@RFC-Message-ID:
SuUf.772249@fx14.iad>
@TZUTC: -0700
@PID: Mozilla Thunderbird
@TID: FIDOGATE-5.12-ge4e8b94
On 9/2/23 11:43 AM, Charlie-Boo wrote:
> On Saturday, August 26, 2023 at 1:24:35 PM UTC-4, Richard Damon wrote:
>> On 8/26/23 1:11 PM, Charlie-Boo wrote:
>>> Program 1 returns a Boolean value call it A.
>>> Program 2 returns a Boolean value call it B.
>>> We want one program that returns A ^ B (the value of A and B).
>>> We don`t want to call 1 and 2.
>>> We want to take the code in these two programs and create a new program.
>>>
 >>> Assume we have the common commands and expression elements e.g.
those of PHP.
>>> How many different programs can we create?
>>>
>>> C-B
>> A fundamental property of programming is that you can create an infinite
>> variation of programs that achieve a given goal. At least as long as the
>> requirements are written semantically (this is the result we need to
>> generate) and not with syntactic limits (it must be written this way).
>>
>> THough you have a syntactic restriction in your definition (we can`t
>> "call" A or B, since you can always replace a call to a function with
>> the code for that function, and you specified we have the code, we can
>> use this property.
>>
>> Now, the question comes down to terminology, if you have multipe ways of
>> implementing a given algorithm, are they all "one program", or is each
>> implementation consider a different program.
>>
>> Normal terminology calls them diferent programs, so your answer is infinite.
>>
>> There may be a finite (but large) practical limit established by the
>> language you express the program in, and the machine it will be run on.
 > I said use common programming language constructs e.g. PHP. As
you create alternatives, you start to see the difference between
algorithm and implementation.
 > Perhaps the simplest way is 3 parts. Assuming variable name
conflicts are removed:
> 1. The code for A but save the value returned in variable A.
> 2. The code for B but save the value returned in variable B.
> 3. return A&&B

> There ae LOTS more.

> C-B

Which is basically what I said.
--- Mozilla Thunderbird
 * Origin: Forte - www.forteinc.com (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх