Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Thread Tools Display Modes
Bottles of Pop?
Status: Offline
Posts: 21
Join Date: Jun 2018
Default Bottles of Pop? - 06-27-2018, 06:48 PM

Hey guys -

I'm trying to make a character in my Alice world sing the "99 Bottles of Pop" song.

I'm needing to use as few statements as possible. Wouldn't I use either the "loop" or "while" statements to do this?

Here is a screen shot of my method in Alice:

What am I doing wrong? I guess I'm not good at this, as it is confusing to me. :/

- jkidd
Reply With Quote
Bottles Of Pop
Junior Member
Status: Offline
Posts: 3
Join Date: Jun 2020
Default Bottles Of Pop - 07-06-2020, 07:38 AM

I wonder if in this case you could use recursion. You can keep calling the same method as many times as needed until the task is completed. You wouldn't have to use the loop method and "count" how many bottles of pop are on the wall. I'm not the best at this but its just a thought. Maybe you can set it to recall that method multiple times until the song is over. Hopefully this helps, if it makes sense?
Reply With Quote
Bottles of pop
Status: Offline
Posts: 190
Join Date: Jan 2007
Default Bottles of pop - 07-06-2020, 02:18 PM

You are setting a bottles variable to the value of 100 - index
But you are not using that variable in the lyrics you are displaying and so, as near as I can tell you will be displaying

"bottles of pop on the wall"
"bottles of pop"
"bottles of pop on the wall"

without the actual number

you want to use join together world function

bottles + "bottles of pop on the wall"

Don Slater
Alice Project

Don Slater
Alice Team
Carnegie Mellon University
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.