Article View: comp.lang.misc
Article #3472Re: Formal definitions (Re: ada-c++ productivity)
From: Joseph Allen
Date: Sat, 13 Apr 1991 02:21
Date: Sat, 13 Apr 1991 02:21
27 lines
1795 bytes
1795 bytes
In article <50453@nigel.ee.udel.edu> new@ee.udel.edu (Darren New) writes:
>For example, your customer gives you the following requirements:
>1) a phone will not ring if it is off-hook.
>2) a phone will ring if it is on-hook and its number is dialed.
>3) a non-ringing phone will issue a dialtone if off-hook and no
> digits have been dialed.
>4) a phone which has had 7 digits dialed will emit either a ring signal
> or a busy signal.
>5) ring signals will never be associated with phones which are not ringing.
> etc etc etc
>Clearly, this is the kind of specification a customer wants to give.
:-) Yeah. (Do you work in the real world (tm)?) If customers could give this
good of a specification we probably really could automate coding and we would
all be out of a job.
--
#define h 23 /* Height */ /* jallen@ic.sunysb.edu (129.49.12.74) */
#define w 79 /* Width */ /* Amazing */
int i,r,b[]={-w,w,1,-1},d,a[w*h];m(p){a[p]=2;while(d=(p>2*w?!a[p-w-w]?1:0:0)|(
p<w*(h-2)?!a[p+w+w]?2:0:0)|(p%w!=w-2?!a[p+2]?4:0:0)|(p%w!=1?!a[p-2]?8:0:0)){do
i=3&(r=(r*57+1))/d;while(!(d&(1<<i)));a[p+b[i]]=2;m(p+2*b[i]);}}main(){r=time(
0L);m(w+1);for(i=0;i%w?0:printf("\n"),i!=w*h;i++)printf("#\0 "+a[i]);}
Technical Details
Message-ID:
<1991Apr13.022129.29607@sbcs.sunysb.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!sbcs!libserv1.ic.sunysb.edu!jallenReferences:
<1755@optima.cs.arizona.edu> <50453@nigel.ee.udel.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!sbcs!libserv1.ic.sunysb.edu!jallen From: jallen@libserv1.ic.sunysb.edu (Joseph Allen) Newsgroups: comp.lang.misc Subject: Re: Formal definitions (Re: ada-c++ productivity) Message-ID: <1991Apr13.022129.29607@sbcs.sunysb.edu> Date: 13 Apr 91 02:21:29 GMT References: <1755@optima.cs.arizona.edu> <50453@nigel.ee.udel.edu> Sender: usenet@sbcs.sunysb.edu (Usenet poster) Organization: State University of New York at Stony Brook Lines: 27