Alice Community  

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

Reply
 
Thread Tools Display Modes
Bottles of Pop?
Old
jkidd
Member
 
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: https://image.ibb.co/mJRS28/Pop1.jpg

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
Old
mandapanda625
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
Old
djslater107
Administrator
 
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
Reply

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.