Sha256: 365bab08fec4d46ebccefc43eec0be3db0d51d0b814010a7f147445b7215ee8c

Contents?: true

Size: 903 Bytes

Versions: 207

Compression:

Stored size: 903 Bytes

Contents

function! Verse(verse) abort
  if a:verse == 0
    return "No more bottles of beer on the wall, no more bottles of beer.\n".
          \ "Go to the store and buy some more, 99 bottles of beer on the wall.\n"
  elseif a:verse == 1
    return "1 bottle of beer on the wall, 1 bottle of beer.\n".
          \ "Take it down and pass it around, no more bottles of beer on the wall.\n"
  elseif a:verse == 2
    return "2 bottles of beer on the wall, 2 bottles of beer.\n".
          \ "Take one down and pass it around, 1 bottle of beer on the wall.\n"
  else
    return printf(
          \ "%s bottles of beer on the wall, %s bottles of beer.\n".
          \ "Take one down and pass it around, %s bottles of beer on the wall.\n",
          \ a:verse, a:verse, a:verse - 1)
  end
endfunction

function! Verses(start, end) abort
  return join(map(range(a:start, a:end, -1), 'Verse(v:val)'), "\n")
endfunction

Version data entries

207 entries across 207 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.179 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.178 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.177 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.176 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.175 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.174 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.173 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.172 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.171 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.170 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.169 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.167 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.166 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.165 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.164 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.163 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.162 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.161 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.160 tracks/vimscript/exercises/beer-song/example.vim