Rohit Vishal Kumar             99 Bottles of Beer             rohitvk@lycos.com              03-15-02 (  :  )       PROFAN2                97   3193     99btls.bas  'PROFAN2ã'--------------------------------------------------------------------ã'SOURCE CODE TITLE:  99 Bottles of beer on the wallã'--------------------------------------------------------------------ã'AUTHOR NAME:        Rohit Vishal Kumarã'--------------------------------------------------------------------ã'WEB ADDRESS:        http://www.angelfire.com/nb/neeraja-rohit/ã'--------------------------------------------------------------------ã'EMAIL ADDRESS:      rohitvk"AT"lycos"DOT"comã'--------------------------------------------------------------------ã'SOURCE DATED:       26 January 2002ã'--------------------------------------------------------------------ã'SOURCE STATUS:      Public Domainã'--------------------------------------------------------------------ã'DESCRIPTION:        This source code was developed as my firstã'                    learning attempt at ProFan 3.3.ã'                    Use it to learn ProFan 3.3.ã'                    You might start liking the language :-)ã'--------------------------------------------------------------------ã'REQUIREMENTS:       Nothing Specificã'--------------------------------------------------------------------ã'CREDITS:            Developers of Profan - It certainly makes prog-ã'                    ramming a lot of funã'--------------------------------------------------------------------ãã' Defining the counter to be used in the ProgramãDECLARE X%, Y%ãã' Creating the windowãWINDOW 20,20 - 400,400ãã' Assigning the Title of the WindowsãWINDOWTITLE "99 Bottles of Beer on the Wall"ãã' Printing the Welcome Message on the ScreenãPRINT "Welcome to 99 Bottles of Beer..."ãPRINTãPRINT "Programmed By - "ãPRINT "Rohit Vishal Kumar"ãPRINT "Flat No: B-21/11"ãPRINT "E.C.T.P. Phase - IV, Type - B"ãPRINT "Calcutta - India"ãPRINT "Pin : 700 107"ãPRINT "Phone : (91-33) 443-5858"ãPRINT "Email: rohitvk@hotmail.com"ãPRINTãPRINT "Please Press Any Key to Run the Program..."ãã'Wait for the User to Press Any KeyãWAITKEYãã' Initialize the variables to be usedãLET X% = 1ãLET Y% = 99ãã' Use the While Loop - While X is less than 101ã' Note: 101 is used to make the counter go down to zero and print ã' going to store messageããWHILE @LT(X%, 101)ãã  ' Write the Lyricsã  PRINT Y%," bottles of beer on the wall"ã  PRINT Y%," bottles of beer..."ã  PRINT "Take one down and pass it around..."ãã  ' Subtract X from 100ã  LET Y%=@SUB(100,X%)ãã  ' The IF Loop - 1. If Y = 1 then say bottle instead of bottlesã  ' The IF Loop - 2. If Y = 0 then go to the storeã  ' The IF Loop - 3. ELSE Print the messageã  IF @EQU(Y%,1)ã    PRINT Y%," beer bottle on the wall."ã  ELSEIF @EQU(Y%,0)ã    PRINTã    PRINT "Now there are none....."ã    PRINT "I need some more ......."ã    PRINT "I am going to the store ... hic :-)"ã  ELSEã    PRINT Y%," beer bottles on the wall."ã  ENDIFã  PRINTãã  'Increment X by Oneã  LET X%=@ADD(X%,1)ãWENDãã'Wait for a key press from the userãWAITKEYãã'Show the message box with Okay ButtonãMESSAGEBOX "Thank you very much for Drinking Along with Me...",\ã           "Shoot...Hic...Shut Program",64ãã'Finally End the ProgramãENDãRoy Scott                      Quick Sort For Profan2         RoyScott@RoyScott.net          03-16-02 (  :  )       PROFAN2                100  3804     Qsort2.inc  '--------------------------------------------------------------------ã'SOURCE CODE TITLE:  Quicksort Procedure for Profan2 3.3ã'--------------------------------------------------------------------ã'AUTHOR NAMES:       Daniel Jansen & Roy Scottã'--------------------------------------------------------------------ã'WEB ADDRESS:        http://www.royscott.net/ã'--------------------------------------------------------------------ã'EMAIL ADDRESS:      royscott"AT"royscott"DOT"netã'--------------------------------------------------------------------ã'SOURCE DATED:       18 February 2002ã'--------------------------------------------------------------------ã'SOURCE STATUS:      Public Domainã'--------------------------------------------------------------------ã'DESCRIPTION:        A standard Quicksort routine written in Profan2ã'--------------------------------------------------------------------ã'REQUIREMENTS:       Profan2 Version 3.3 US Englishã'-------------------------------------------------------------------- ã'CREDITS:            The inventor of the original Quicksort Algorithmã'                                  C. A. R. Hoareã'--------------------------------------------------------------------ãproc setstringãparameters array$,position%,value$,separator$ãdeclare new$,count%ãlet count%=1ãwhile @and(@lt(count%,position%),@neq$(@substr$(array$,count%,separator$),""))ã let new$=@add$(new$,@substr$(array$,count%,separator$))ã let new$=@add$(new$,",")ã inc count%ãwendãif @lt(count%,position%)ã while @lt(count%,position%)ã   let new$=@add$(new$,"0")ã   let new$=@add$(new$,",")ã   inc count%ã wendãendifãlet new$=@add$(new$,value$)ãlet new$=@add$(new$,",")ãinc count%ãlet new$=@add$(new$,@substr$(array$,count%,separator$))ãreturn new$ãendprocããproc qsort2ãparameters first%,last%ãdeclare stackpointer%,i%,j%,left%,right%,pivot$,temp$,leftstack$,rightstack$ãlet stackpointer% = 1                                   'initialize stackpointer%ãlet leftstack$=@str$(@int(first%))                      'first element in left array partitionãlet rightstack$=@str$(@int(last%))                      'first element in right array partition)ã300:ãlet left% = @int(@val(@substr$(leftstack$,stackpointer%,",")))    'get starting pointãlet right% = @int(@val(@substr$(rightstack$,stackpointer%,",")))  'get ending pointãdec stackpointer%                                                 'set stackpointer% to 0 ???ãifnot @lt(left%,right%)                                           'see if this partition is sortedã  if @gt(stackpointer%,0)ã    goto "300"ã  elseã    goto "570"ã  endifãendifãlet i% = left%                              'partition the array around the pivotãlet j% = @add(right%,1)ãlet pivot$ = @list$(left%)                  'set up for List$--can be adapted to any of the List arraysã430:ãdec j%ãif @gt$(@list$(j%),pivot$)ã  goto "430"ãendifã440:ãinc i%ãif @and(@lt$(@list$(i%),pivot$),@lt(i%,right%))ã  goto "440"ãendifãif @lt(i%,j%)ã  let temp$ = @list$(i%)ã  list$ i% = @list$(j%)ã  list$ j% = temp$ã  goto "430"ãendifãlet temp$ = @list$(left%)ãlist$ left% = @list$(j%)ãlist$ j% = temp$ãinc stackpointer%                                   'set up stack for subpartitionsãlet temp$=@str$(@int(@add(j%,1)))ãsetstring leftstack$,stackpointer%,temp$,","ãlet leftstack$=@$(0)ãlet temp$=@str$(@int(right%))ãsetstring rightstack$,stackpointer%,temp$,","ãlet rightstack$=@$(0)ãinc stackpointer%ãlet temp$=@str$(@int(left%))ãsetstring leftstack$,stackpointer%,temp$,","ãlet leftstack$=@$(0)ãlet temp$=@str$(@int(@sub(j%,1)))ãsetstring rightstack$,stackpointer%,temp$,","ãlet rightstack$=@$(0)ã'print leftstack$;"     |     ";rightstack$         'for testing onlyãgoto "300"ã570:ãendprocã