Alice Community  

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

Reply
 
Thread Tools Display Modes
Combine two Strings and Say it as whole
Old
Stipz
Guest
 
Status:
Posts: n/a
Default Combine two Strings and Say it as whole - 08-03-2009, 08:17 AM

We have an exercise in using arrays and numbers to strings

now I'm having troubles on how the character will say the worded number

if it is in 23 -[Twenty][One], 33 -[Thirty][Three]

999- [Nine Thousand][Nine Hundred][Ninety][Five]

i've attached the a2w file just in case

tips, comments are very much appreciated
Attached Files
File Type: a2w NumberToWord.a2w (1.65 MB, 4 views)
   
Reply With Quote
Old
Veryuhbull
Guest
 
Status:
Posts: n/a
Default 08-03-2009, 10:44 AM

Well by looking at this you would have to make a scenario for every number. The variables you are using also aren't helping to simplify this project. You should use 0-9, 10-19,(for the special name numbers) Multiples of ten, and multiples of hundreds. If you could isolate the individual places it would cut a ton programing but the interface does not work that way as it.

I worked on yours for a while and thing it would be easier for me to help you by starting over. I will see if I can make a better set-up.
   
Reply With Quote
Old
Stipz
Guest
 
Status:
Posts: n/a
Default 08-03-2009, 04:30 PM

I've noticed that my program lacks this modulus logic
(this can replace the if-else statements)

can someone please enlighten me on this one

having this searched on the web, it still confuses me
   
Reply With Quote
Old
Stipz
Guest
 
Status:
Posts: n/a
Default 08-17-2009, 09:00 PM

im really stuck with this program

for some reason alice is automatically rounding off results of remainders
and getting negative answers that are required for the sorting

here's the version 3

the ranger.say has not been included yet
observe how the variables change when you input something like:
9900, 1100, 2300 (anything that has hundreds place)
Attached Files
File Type: a2w NumberToWord_v3.a2w (629.4 KB, 1 views)

Last edited by Stipz; 08-17-2009 at 11:50 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.