Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How can I get Alice to determine if numbers are sorted or not?
Old
Zicksen
Guest
 
Status:
Posts: n/a
Default How can I get Alice to determine if numbers are sorted or not? - 09-10-2010, 07:03 PM

Null

Last edited by Zicksen; 06-10-2011 at 01:05 AM.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 09-10-2010, 07:24 PM

Upload the world in an attachment, and I'll see what I can do. (When you're posting, if you scroll down a bit, there is a button "Manage Attachments". Click on it, and attach your file.)

As for a second variable, I'm pretty sure you would need it.


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 09-10-2010, 08:01 PM

Downloading...

OK. Just one question and then it'll be done. If they only enter one number, should it be sorted or unsorted?


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.

Last edited by debussybunny563; 09-10-2010 at 08:07 PM.
   
Reply With Quote
Got it!
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow Got it! - 09-10-2010, 08:13 PM

OK, here it is.

Tell me if you have any questions.
Attached Files
File Type: a2w CompleteSequenceWorld.a2w (579.8 KB, 5 views)


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Default 09-10-2010, 08:26 PM

The prev variable is simply set to whatever the input variable is.
Then, the if/else statement in the middle of the loop checks if the new input is one more than the previous number (prev).
Hence the "If <input> == <prev> + 1", "<is_sorted> set value to <true>"

And, in the end, it checks whether or not the is_sorted is true, and if it is, say sorted, otherwise say unsorted.

Also, I'm sorry, there was a glitch that I recently caught.
If you entered something like 1, 7, 8, it would count as sorted, as long as the last two were in order.
Fixed it by ensuring the whole sequence had to be in order.

Here's the new file:
Attached Files
File Type: a2w CompleteSequenceWorld.a2w (579.9 KB, 4 views)


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.

Last edited by debussybunny563; 09-10-2010 at 08:29 PM.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Cool 09-10-2010, 08:36 PM

Quote:
Originally Posted by Zicksen View Post
Thanks debussybunny563! I don't know how you figured that out so fast, but this is very useful. I haven't used some of these commands yet, so I'll definitely play around with them (they seem straightforward enough). Thanks again!
Simple experience. I would recommend experimenting with the little things you find, as it gives you a better knowledge and application of what you're learning.

I'm self-taught Alice, and it took me a pretty long time to learn all its facets.
This is the result of all my work and experimentation (my final project, if you will-though it very well may NOT be the last): FPS
Since some people have trouble running the world, I'd appreciate it if you would download it and tell me if it works and what you think of it. (It's a somewhat big file, though not as large as some 38 MB worlds I've seen lol; in the end it should be worth it though )

Anyway, always a pleasure to help!


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Cool 09-10-2010, 08:43 PM

Thanks.

It's also good to know that the game works for you. I hate when errors pop up.


I'm currently working on the story/mission, as right now there's no involving gameplay.

If you ever need more help, feel free to ask!


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.

Last edited by debussybunny563; 09-10-2010 at 08:47 PM.
   
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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.