[Info-vax] VMS Software needs to port VAX DIBOL to OpenVMS X86 platform

mceculski2 at gmail.com mceculski2 at gmail.com
Wed Dec 16 12:35:22 EST 2020


On Tuesday, December 15, 2020 at 2:47:43 PM UTC-5, Stephen Hoffman wrote:
> On 2020-12-15 15:59:28 +0000, ultradwc at gmail.com said:
> 
> > THINK OF DIBOL AS A TYPE OF 4 GL COBOL
> > 
> > RECORD MISC
> >     NUMBOTTLES	,D2,99			;Default # of bottles to 99
> >     ANUMBOTTLES	,A2			;Used to mask the output of bottles
> > 
> > 
> > PROC
> >     XCALL FLAGS (0007000000,1)		;Suppress STOP message
> >     OPEN (8,O:C,"TT:")        		;Open the terminal/display
> >     REPEAT
> > 	BEGIN
> > 	ANUMBOTTLES = NUMBOTTLES,'ZX'
> > 	WRITES (8,ANUMBOTTLES+" Bottles of Beer on the wall,")
> > 	ANUMBOTTLES = NUMBOTTLES,'ZX'
> > 	WRITES (8,ANUMBOTTLES+" Bottles of Beer,")
> > 	WRITES (8,"   Take one down, pass it around,")
> > 	DECR NUMBOTTLES	      		;Reduce # of bottles by 1
> > 	IF (NUMBOTTLES .LE. 1) EXITLOOP	;If just 1 bottle left, get out
> > 	ANUMBOTTLES = NUMBOTTLES,'ZX'
> > 	WRITES(8,ANUMBOTTLES+" Bottles of Beer on the wall.")	WRITES (8," ")
> > 	END
> >     ANUMBOTTLES = NUMBOTTLES,'ZX'
> >     WRITES(8,ANUMBOTTLES+" Bottle of Beer on the wall.")    WRITES (8," ")
> >     WRITES (8,ANUMBOTTLES+" Bottle of Beer on the wall,")
> >     WRITES (8,ANUMBOTTLES+" Bottle of Beer,")
> >     WRITES (8,"   Take one down, pass it around,")
> >     WRITES (8," ")
> >     WRITES (8," ")
> >     WRITES (8, "Hey the Beer's gone, I am out of here...")
> >     SLEEP 2
> >     CLOSE 8
> >     STOP
> > END
> 
> 
> For grins, and written entirely off the cuff...
> 
> 
> for i in (1...99).reversed() {
>     print("\(i) bottle\((i == 1 ? "" : "s")) of beer on the wall, \(i) 
> bottle\((i == 1 ? "" : "s")) of beer.")
>     print("Take one down and pass it around, ", terminator: "")
>     if i == 1 {
>         print("no more bottles of beer on the wall.")
>     } else {
>         print("\(i - 1) more bottle\((i == 2) ? "" : "s") of beer on the wall.)
>     }
> }
> print("No more bottles of beer on the wall, no more bottles of beer.")
> print("Hey, the beer's all gone, I'm outta here.")
> 
> Pure Personal Opinion | HoffmanLabs LLC

YOU DIDN'T THINK I WOULD PASS ON A CHALLENGE DID YOU? :)
THAT WAS AN OLD VAX DIBOL CODE EXAMPLE NOT USING THE FOR LOOP STRUCTURE

BEHOLD THE POWER OF SYNERGY DIBOL I THINK MY CPU PROCESS TIME WILL BEAT YOURS


RECORD MISC
     I              ,D2 
     NUMBOT         ,D2,99		;Default # of bottles to 99
PROC
     XCALL FLAGS (0007000000,1)		;Suppress STOP message
     OPEN (15,O:C,"TT:")        	;Open the terminal/display
     FOR I FROM NUMBOT THRU 1 BY -1
     DO
       BEGIN
         IF (NUMBOT .EQ. 1) EXITLOOP	;If just 1 bottle left, get out
         USING NUMBOT SELECT
           (1), BEGIN
                  DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottle of Beer on the wall.',13,10,13,10)
                  DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottle of Beer on the wall,',13,10)
                  DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottle of Beer,',13,10)
                  DISPLAY(15,'   Take one down, pass it around,',13,10)
                  DISPLAY(15,13,10,13,10,'Hey the Beer's gone, I am out of here...',13,10)
                END
           (), BEGIN
 	         DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottles of Beer on the                 wall,',13,10)
 	         DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottles of Beer,',13,10)
                 DISPLAY(15,'   Take one down, pass it around,',13,10)
 	         DISPLAY(15,NUMBOT<FORMAT:'ZX'>,' Bottles of Beer on the wall.',13,10,13,10)
               END
         ENDSUING
       END
     SLEEP 2
     CLOSE 8
     STOP



More information about the Info-vax mailing list