0

I saw this question Bottles of beer in level 10 but it doesn't have a full solution. What is the full solution to the 99 bottles of beer on the wall for Vim adventures?


Context:

for the sake of being a good SO member I will give more details but a full solution will answer my question.

It seems from reading the other post that my register is incorrect for some reason. I can't get the <NL>. I think that's the issue since pasting won't work...

1
  • Upvoting because it illustrates the "yank" vs. "delete" dynamic, and shows the text in the registers.
    – m_mlvx
    Commented Jul 27, 2020 at 21:46

1 Answer 1

2

From the posted screenshot, I see that you deleted the red text under "Delete me!" -- but I see only some of it in your registers. You need:

99 bottles of beer<NL>
pass it around,<NL>
on the wall.<NL>

I see the first one, but not the latter two. I'm guessing you somehow overwrote them with battle, tweetle, etc. In that case, I think you have to restart the level with :level 10. (I tried to cobble together what's needed, with a combination of "[LETTER]y[motion] -- yanking into a register labeled with a letter, using a capital letter to append the newly yanked material into the register instead of overwriting. It didn't work because I found no way to yank a newline in level 10.)

I've just confirmed the following recipe works.

  1. Enter the "Delete me!" text. 7 keypresses left.
  2. Use G to get to lower left corner of the text.
  3. Use dd three times, to get the three lines of text into your registers.
  4. Using :reg, you should see:
""   pass it around,<NL>
"1   pass it around,<NL>
"2   on the wall.<NL>
"3   99 bottles of beer<NL>

Next, go into the "on the wall," puzzle.

  1. "3P to paste "99 bottles..." above your position (note the capital P).
  2. j to go down a line, and "3p to paste "99 bottles..." below your position (note lower-case p).
  3. j to go down a line, and "1p to paste "pass it around" below your position.
  4. j to go down a line, and "2p to paste "on the wall" below your position.

That completes the puzzle. A pink-haired NPC appears with info about the "Black Hole register" (which works as an alternate way to complete the "If you can't explain it simply" puzzle).

Note that in step 3, "1p also could be simply p.

Happy Vimming!

5
  • did you end up having to start the game over for this to work? Commented Jul 26, 2020 at 17:59
  • I didn't have to start the whole game over -- just the level. But yes, if you cannot delete the three lines of text to get them into your registers, I think it will be far easier to restart the level than to build the text you need by yank-appending into three registers, one or two characters at a time. (And TBH, since each register content needs <NL> at the end, I'm not sure how to yank that into a register.)
    – m_mlvx
    Commented Jul 27, 2020 at 2:39
  • sad, I've already done the yanking and appending but I just can't get the <NL> in :( Commented Jul 28, 2020 at 0:44
  • Yeah. You don't get the ability to free-edit, or the "O/o" key that lets you insert lines, until level 11 or 12. To restart the level, you can type :level 10
    – m_mlvx
    Commented Jul 28, 2020 at 1:32
  • 1
    It looks like the functionality exists in actual Vim, but is not programmed into Vim Adventures. See stackoverflow.com/questions/1346737/… for using :put x to paste the contents of the x register, on its own line below your current cursor position. It works in Vim, but Vim Adventures says "Unknown command".
    – m_mlvx
    Commented Jul 28, 2020 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.