JBakamovic/yavide

Consultation needed

Closed this issue · 4 comments

I'm having troubles installing yavide on my laptop and am currently in your area. Would you like to meet up in the Vintage Industrial Bar?

That's actually a very good idea. We should organise a support session there, or in BBF.

#include <iostream>

template<int N>
struct beer {
    inline static void drink() {
        std::cout << N << " bottles of beer on the wall, "
            << N << " bottles of beer.\nTake one down, pass it around, "
            << N - 1 << " bottles of beer on the wall.\n\n";
        beer<N - 1>::drink();
    }
};

template<>
struct beer<1> {
    inline static void drink() {
        std::cout << "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\n"
            << "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";
    }
};

template<>
struct beer<2> {
    inline static void drink() {
        std::cout << "2 bottles of beer on the wall, "
            << "2 bottles of beer.\nTake one down, pass it around, "
            << "1 bottle of beer on the wall.\n\n";
        beer<1>::drink();
    }
};

int main() {
    beer<99>::drink();
    return 0;
}

Try this and let me know if it helps or not.

Thank you, it works! I tested this solution and forgot about my original issue, as well some other ones too.