From: JB Date: 2006-03-31T14:38:43+09:00 Subject: Re: Learn to Program, by Chris Pine Jan_K wrote: > Does anyone know where I can find the solutions to the exercises in > this book: > > http://pine.fm/LearnToProgram/ > > > I'm stuck in "Flow Control" chapter, specificailly the "Extend Deaf > Grandma" exercise. I'm stuck trying to do the part to make it do '99 bottles of beer on the wall' song. I get started in what I hope will work and next thing I know I have way too many variables and nothing makes sense. I even did something that made it loop the integer 0. I had to Ctrl-c on that one. Here's what I quit trying at, because no matter how many breaks I took or whatever, it just wasn't making any sense. : puts '99 bottles of beer on the wall, 99 bottles of beer,' 'take one down, pass it around,' '98 bottles of beer on the wall!' song = '99 bottles of beer on the wall, 99 bottles of beer, take one down, pass it around,' song = 99 song2 = '98 bottles of beer on the wall!' song2 = 99 - 1 last = '1 bottle of beer on the wall' last = 1 if song2 == last puts 'Yay!' else if song2 - 1 puts while song == 1 end endputs '99 bottles of beer on the wall, 99 bottles of beer,' 'take one down, pass it around,' '98 bottles of beer on the wall!' song = '99 bottles of beer on the wall, 99 bottles of beer, take one down, pass it around,' song = 99 song2 = '98 bottles of beer on the wall!' song2 = 99 - 1 last = '1 bottle of beer on the wall' last = 1 if song2 == last puts 'Yay!' else if song2 - 1 puts while song == 1 end end I too wish the author had put examples, say on some pages in the back or something.