For a piece of 1st year Computer Science Prolog coursework (as part of a sheet with loads of mini-projects), I have to write a program to print out the 'song':
99 bottles of beer on the wall,
99 bottles of beer,
you take one down and pass it around,
98 bottles of beer on the wall.
For any beer(X) where X is any number. In other words, what ever number you substitute X with, the song begins on that number and counts down.
I've done it recursively (as everything seems to have to be done in prolog). Unfortunately, the program whizzes through every single number, ending up with 0 bottles.
I want to be able to force the semicolon ; stepping through each verse of the song, so that every number can be seen.
I thought it was something like "!", but that doesn't seem to work.
Ideas?
99 bottles of beer on the wall,
99 bottles of beer,
you take one down and pass it around,
98 bottles of beer on the wall.
For any beer(X) where X is any number. In other words, what ever number you substitute X with, the song begins on that number and counts down.
I've done it recursively (as everything seems to have to be done in prolog). Unfortunately, the program whizzes through every single number, ending up with 0 bottles.
I want to be able to force the semicolon ; stepping through each verse of the song, so that every number can be seen.
I thought it was something like "!", but that doesn't seem to work.
Ideas?