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.139 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.138 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.137 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.136 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.135 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.134 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.133 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.132 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.131 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.130 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.129 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.128 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.127 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.126 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.125 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.124 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.123 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.122 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.121 tracks/vimscript/exercises/beer-song/example.vim
trackler-2.2.1.120 tracks/vimscript/exercises/beer-song/example.vim