99 Bottles of Beer lyrics

버전 1.0 (1.3 KB) 작성자: François Beauducel
This function displays the full song "99 Bottles of Beer" lyrics in pure, optimized Matlab/GNU Octave language.
다운로드 수: 0
업데이트 날짜: 2022/8/26

99 Bottles of Beer lyrics

bottlesofbeer.m

This function displays the full song lyrics in pure GNU Octave scientific language.

99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.

98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.

...

2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall.

1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.

It accepts an input argument to adapt it to your stock of beer.

>> bottlesofbeer(2)

2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall.

1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 2 bottles of beer on the wall.

This more or less useless function is a demonstration of Matlab / GNU Octave language capabilities:

  • the full lyrics draft is produced using a single sprintf function using full vectorized argument (a matrix of 3*100 needed numbers),
  • no loop, no test on values,
  • grammatical and spelling issues are corrected using regular expressions.

If was inspired by the one program in 1500 variations project.

For rating and user comments, see also View 99 Bottles of Beer lyrics on File Exchange.

인용 양식

François Beauducel (2024). 99 Bottles of Beer lyrics (https://github.com/beaudu/bottlesofbeer/releases/tag/v1.0), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
태그 태그 추가

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.