COMP.THEORY-------------- < Пред. | След. > -- < @ > -- < Сообщ. > -- < Эхи > --
 Nп/п : 95 из 100
 От   : Jeffrey Rubard                      2:5075/128        22 сен 23 11:06:17
 К    : Richard Damon                                         22 сен 23 21:11:02
 Тема : Re: Simple Programming Problem but How Many Ways to Do It?
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
<755767dd-c4f6-425e-a71d-38de42064acen@googlegroups.com> ea7a6fa2
@REPLY: SuUf.772249@fx14.iad>
0fc05830
@REPLYADDR Jeffrey Rubard
<jeffreydanielrubard@gmail.com>
@REPLYTO 2:5075/128 Jeffrey Rubard
@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> SuUf.772249@fx14.iad>
@RFC-Message-ID:
<755767dd-c4f6-425e-a71d-38de42064acen@googlegroups.com>
@TZUTC: -0700
@PID: G2/1.0
@TID: FIDOGATE-5.12-ge4e8b94
On Sunday, September 3, 2023 at 3:54:35 PM UTC-7, Richard Damon wrote:
> 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.

"Clap, clap, clap."
--- G2/1.0
 * Origin: usenet.network (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    
                                                                                
В этой области больше нет сообщений.

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