Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   The Lounge (http://www.alice.org/community/forumdisplay.php?f=4)
-   -   Testing A-6 (http://www.alice.org/community/showthread.php?t=11778)

cdeleon 07-30-2017 02:04 PM

Testing A-6
 
Looking to finish Assignment 6. Currently in the works. I think mostly everyone is done with this assignment. However, this is what I have so far. Ok I tried uploading the file as a regular a2w, and as a zip. Both uploads failed. Any advice? @chickentree

chickentree 07-30-2017 06:26 PM

[QUOTE=cdeleon;57656]Looking to finish Assignment 6. Currently in the works. I think mostly everyone is done with this assignment. However, this is what I have so far. Ok I tried uploading the file as a regular a2w, and as a zip. Both uploads failed. Any advice? @chickentree[/QUOTE]

I have attached the file you sent me not sure why it is not showing up.

cdeleon 07-30-2017 06:43 PM

I can't see anything in your previous post. ^ Three problems I haven't found a fix for yet. One, my character continues to say the previous numbers at the start of his new verses. Two, the numbers have a .0, added at the end of them. And three, the song keeps going into the negatives, past 0.

chickentree 07-30-2017 07:18 PM

[QUOTE=cdeleon;57656]Looking to finish Assignment 6. Currently in the works. I think mostly everyone is done with this assignment. However, this is what I have so far. Ok I tried uploading the file as a regular a2w, and as a zip. Both uploads failed. Any advice? @chickentree[/QUOTE]

As to your problem:

You are using a while loop. The loop will continue until the condition changes to false. So if you had a boolean variable called keepGoing and it was initially set to true the loop
[CODE]while keepGoing
do stuff
.
change endingCondition
.
if endingCondition then
keepGoing = false
[/CODE]
Would keep going untill the ending condition became false. The ending condition could be anything you make it. in this case you might do something that reduces the value of start and then test to see if it is 2.
What you have right now is
[CODE]while true[/CODE]
This will continue to repeat until true becomes false, which is never. It is what is called an endless loop and is almost always a bad idea.
Note that in your program you could just put the ending condition in the while statement, like
[CODE]while start >2[/CODE]
This would work fine. The first example was to give you a better understanding of what was happening and how 'while' works in general.

All that being said, the 'for' loop would be a better choice. In general, if you know the number of times something is going to happen ahead of time choose the 'for' loop. If you drag the loop statement into 'my first method' you will see it has a 'show complex version' button. clicking this will show you the values the loop is using. Especially note the 'index'
variable. The index is what changes each time the loop is run
A test loop would look like this:
[CODE]loop index from 0 up to but not including 100 times incrementing by 1
print index
[/CODE]
This will print out the value of index in a box below the movie screen.
To see this you will need to right click on the while block and disable it.
Ask yourself why?
Finally, the index values are counting up from 0 to 99 but you want the values to start at 100 and count down. I am leaving this as an exercise for you along with answering the question above. I will say the answer is very simple.

If you need more help let me know
Mark

cdeleon 07-30-2017 10:03 PM

Couldn't figure out the last two issues. I decided to turn it in and take the L on this one. Spent too much time on this assignment. More than I thought. Definitely behind in my other assignments. Will have to move quickly on the last 3 to get ahead. Thanks for trying though, @chickentree.


All times are GMT -5. The time now is 05:16 AM.

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