#213007 - 2017-11-27 04:03 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Allen]
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Here's my last place code...Probably not much to do to it that hasn't already been done to the others. I didn't think about the repetitive 'teen' and 'ty' until after it was too late to fix it.
; begin BOB
;
;!
function a($)
Dim $0, $1, $2, $3
$0 = " bottle of beer"
$1 = " bottles of beer"
$2 = " on the wall"
$3 = ". Take one down and pass it around, "
If $ > 1
$a = l($) + $1 + $2 + ", " + LCase(l($)) + $1 + $3 + LCase(l(-1+$)) + IIf($=2, $0, $1) +$2+ "."
Else
$a = IIf($=1, l(1)+$0+$2+", one"+$0+$3+"no more"+$1+$2+".", "No more"+$1+$2+", no more"+$1+". Go to the store and buy some more, ninety-nine"+$1+$2+".")
endfunction
function l($)
Dim $t
$t = '',One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,Twelve,Thirteen,Fourteen,Fifteen,Sixteen,Seventeen,Eighteen,Nineteen,Twenty,Thirty,Forty,Fifty,Sixty,Seventy,Eighty,Ninety
If 20 > $
$l = $t[$]
Else
$l = IIf($ mod 10, $t[1*$/10+18]+"-"+lcase($t[$ mod 10]), $t[1*$/10+18])
endfunction
;!
;!
; end BOB
|
Top
|
|
|
|
#213010 - 2017-11-27 05:12 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Allen]
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
514
function a($)
Dim $b
if $+0=$
$b="no more",one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,four,fif,six,seven,eigh,nine,twen,thir,"for",fif,six,seven,eigh,nine
if $<20
$a=$b[$]
if $>12
$a=$a+teen
endif
else
$a=$b[18+$/10]+ty
if $ mod 10
$a=$a + "-" + $b[$ mod 10]
endif
endif
$a = $a + ' bottle' + IIf($ = 1, @, s) + ' of beer'
else
$ = 1 * $
$b = ' on the wall'
$a = chr(asc(a($))-32) + Right(a($), ~) + $b + ', ' + a($) + ". "
If $
$a = $a + 'Take one down and pass it around, ' + a($-1) + $b + "."
Else
$a = $a + 'Go to the store and buy some more, ' + a(99) + $b + "."
endfunction
|
Top
|
|
|
|
#213015 - 2017-11-27 08:38 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Jochen]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4562
Loc: USA
|
510
function a($)
Dim $b
if $+0=$
$b="no more",one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,four,fif,six,seven,eigh,nine,twen,thir,"for",fif,six,seven,eigh,nine
if $<20
$a=$b[$] + iif($>12,teen,@)
else
$a=$b[18+$/10]+ty
if $ mod 10
$a=$a + "-" + $b[$ mod 10]
endif
endif
$a = $a + ' bottle' + IIf($ = 1, @, s) + ' of beer'
else
$ = 1 * $
$b = ' on the wall'
$a = chr(asc(a($))-32) + Right(a($), ~) + $b + ', ' + a($) + ". "
If $
$a = $a + 'Take one down and pass it around, ' + a($-1) + $b + "."
Else
$a = $a + 'Go to the store and buy some more, ' + a(99) + $b + "."
endfunction
|
Top
|
|
|
|
#213018 - 2017-11-27 09:08 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Jochen]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4562
Loc: USA
|
I can't find that f###ing stroke.
506
function a($)
Dim $b
if $+0=$
$b="no more",one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,four,fif,six,seven,eigh,nine,twen,thir,"for",fif,six,seven,eigh,nine
if $<20
$a=$b[$] + iif($>12,teen,@)
else
$a=$b[18+$/10]+ty + iif($ mod 10,"-" + $b[$ mod 10],@)
endif
$a = $a+' bottle'+IIf($=1,@,s)+' of beer'
else
$ = 1 * $
$b = ' on the wall'
$a = chr(asc(a($))-32) + Right(a($), ~) + $b + ', ' + a($) + ". "
If $
$a = $a + 'Take one down and pass it around, ' + a($-1) + $b + "."
Else
$a = $a + 'Go to the store and buy some more, ' + a(99) + $b + "."
endfunction
|
Top
|
|
|
|
#213020 - 2017-11-27 09:15 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Jochen]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4562
Loc: USA
|
I get it... i know where you are, but for the life of me...
|
Top
|
|
|
|
#213021 - 2017-11-27 11:33 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Allen]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4562
Loc: USA
|
Jochen, I think with the crowd that is playing, no one is going to throw up a fit for your suggestions... but I could see this being a point of contention otherwise.
|
Top
|
|
|
|
#213024 - 2017-11-28 09:11 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Jochen]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4562
Loc: USA
|
I've been looking at the words but to no avail so far.
|
Top
|
|
|
|
#213031 - 2017-12-04 07:15 AM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Allen]
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
I too had fun with this one, thank you. For what it's worth, here goes the 490 for you to chew on:
function a($)
Dim $b
if $+0=$
$b="no more",one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,four,fif,six,seven,eigh,nine,twen,thir,"for"
if $<20
$a=$b[$] + iif($>12,teen,@)
else
$a= $b[18+$/10-($>49)*8] + ty + iif($ mod 10,"-" + $b[$ mod 10],@)
endif
$a = $a + ' bottle' + left(s,$^1) + ' of beer'
else
$ = 1 * $
$b = ' on the wall'
$a = chr(asc(a($))-32) + Right(a($), ~) + $b + ', ' + a($) + ". "
If $
$a = $a + 'Take one down and pass it around, ' + a($-1) + $b + "."
Else
$a = $a + 'Go to the store and buy some more, ' + a(99) + $b + "."
endfunction
_________________________
|
Top
|
|
|
|
#213032 - 2017-12-04 06:56 PM
Re: Kixgolf - 99 Bottles Of Beer - Public Round
[Re: Jochen]
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Argh. I knew there had to be a way to do this...Just never put the 'bits' together.
Edited by ShaneEP (2017-12-04 06:56 PM)
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 493 anonymous users online.
|
|
|