LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2012, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 18 Apr 2012 18:23:38 -0400
Reply-To:     Arthur Tabachneck <art297@ROGERS.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@ROGERS.COM>
Subject:      Re: Friday Humour.
Comments: To: Fried Egg <friedegg2012@GMAIL.COM>

I think you accidentally left out the "You can't fire me I quit" subroutine. ------ On Wed, 18 Apr 2012 15:35:21 -0600, Fried Egg <friedegg2012@GMAIL.COM> wrote:

>My level of boredom right now is frightening. > >proc format; > value lightbulb > 0 = ' ' > 1 = 'O' > 2 = '!'; >run; > >proc fcmp outlib=work.func.lights; > subroutine unscrewBulb(bulb_x,bulb_y,office[*,*]) varargs; > outargs office; > if office[bulb_x,bulb_y] = 0 then do; > put 'ERROR: There is no bulb here to remove.'; > return; > end; > else do; > office[bulb_x,bulb_y] = 0; > end; > return; > endsub; > > subroutine screwInBulb(bulb_x,bulb_y,office[*,*]) varargs; > outargs office; > if office[bulb_x,bulb_y] ne 0 then do; > put 'ERROR: You cannot screw in a lightbulb here.'; > return; > end; > else do; > office[bulb_x,bulb_y]=1; > end; > return; > endsub; > > subroutine operateBusiness(office[*,*]) varargs; > outargs office; > call streaminit(0); > do i=1 to dim(office,1); > do j=1 to dim(office,2); >x=rand('table',.01); >if office[i,j]=1 and x=1 then office[i,j]=2; > end; > end; > endsub; > > subroutine smashBulb(bulb_x,bulb_y,office[*,*]) varargs; > outargs office; > call streaminit(0); > x=rand('table',.5); > if office[bulb_x,bulb_y] ne 0 then do; > office[bulb_x,bulb_y]=0; > put 'NOTE: You smashed a bulb'; > if x = 1 then do; > put 'WARNING: Your manager saw you!'; >y=rand('table',.5); >if y = 1 then do; > put 'ERROR: You are fired.'; > *abort return; >end; >else put 'NOTE: He will let it slide, this time.'; > end; > end; > else put 'NOTE: What are you doing? There is nothing there.'; > endsub; > > subroutine viewOffice(office[*,*]) varargs; > do j=1 to (dim(office,2)+2); > put '-' @; > end; > put /; > do i=1 to dim(office,1); > put ' ' @; > do j=1 to dim(office,2); > put office[i,j] lightbulb. @; > end; > put /; > end; > return; > endsub; >run; > >options cmplib=work.func; > >data _null_; > array office[9,9] _temporary_ (81*1); > do i=1 to 10; > call operateBusiness(office); > end; > call viewOffice(office); > do i=1 to dim(office,1); > do j=1 to dim(office,2); > if office[i,j]=2 then call unscrewBulb(i,j,office); > end; > end; > do i=1 to dim(office,1); > do j=1 to dim(office,2); > if office[i,j]=0 then call screwInBulb(i,j,office); > end; > end; > call viewOffice(office); > call screwInBulb(1,1,office); > call unscrewBulb(1,1,office); > call unscrewBulb(1,1,office); > call screwInBulb(1,1,office); > call smashBulb(9,9,office); >run; > >On Wed, Apr 18, 2012 at 11:36 AM, John Burton <jrburtonsaspro@gmail.com>wrote: > >> Oh my gosh! >> >> What did I start? ;-) >> >> LOL >> >> >> >> >> -- >> "be seeing you", >> Ray Burton >> Richmond VA >>


Back to: Top of message | Previous page | Main SAS-L page