Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Question on Roman Numerals
Old
TheDarkWolf
Junior Member
 
TheDarkWolf's Avatar
 
Status: Offline
Posts: 3
Join Date: Mar 2012
Location: Fargo, ND
Question Question on Roman Numerals - 03-09-2012, 04:48 AM

I am doing a project which entitles my character to say a number as a roman numeral. Can someone explain to me on how i can accomplish this?
   
Reply With Quote
Old
TheDarkWolf
Junior Member
 
TheDarkWolf's Avatar
 
Status: Offline
Posts: 3
Join Date: Mar 2012
Location: Fargo, ND
Default 03-09-2012, 04:49 AM

And by meaning not the say command but how can i get my character to say a number as a roman numeral
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 03-09-2012, 09:18 AM

so i'm guessing you mean as example have 1=I 2=II and so forth? if so, you need to explain more on how you need to accomplish this goal, such as, are we having a user input a value which then converts it to a Roman numeral? or are we just using pre-determined numbers?

if you are using pre-determined numbers, that would be easy, just have an object say 1=I,2=II etc.

However, I'm assuming you want user input, this is kinda tricky as in you would have to figure out a limit of value you want the user to be able to enter, The reason I say this is because the only method I can think of to do this is using If/else statements.

so to say
if x==y
then object blah blah blah
else
do nothing

Which this is saying if x (your variable) is equaled to value(normally user input) then the alice world will do whatever action you tell it to do.
you would just have to make a bunch of these and then have the user put their input, then have the world check their input with your statements, and have whatever action it is told to do be bone.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
zilants
Junior Member
 
Status: Offline
Posts: 1
Join Date: Mar 2012
Location: salty seas
Default 03-29-2012, 05:04 PM

How would i say make a program that

asks me for a number input

and i type in say a digit 1-5

and a object tells me it back in roman numerals?

ex 1=i 2=ii etc
   
Reply With Quote
Old
SnowWolf
Junior Member
 
Status: Offline
Posts: 2
Join Date: Feb 2014
Location: Maryland
Default 02-18-2014, 03:29 PM

Quote:
Originally Posted by sfunk View Post
so i'm guessing you mean as example have 1=I 2=II and so forth? if so, you need to explain more on how you need to accomplish this goal, such as, are we having a user input a value which then converts it to a Roman numeral? or are we just using pre-determined numbers?

if you are using pre-determined numbers, that would be easy, just have an object say 1=I,2=II etc.

However, I'm assuming you want user input, this is kinda tricky as in you would have to figure out a limit of value you want the user to be able to enter, The reason I say this is because the only method I can think of to do this is using If/else statements.

so to say
if x==y
then object blah blah blah
else
do nothing

Which this is saying if x (your variable) is equaled to value(normally user input) then the alice world will do whatever action you tell it to do.
you would just have to make a bunch of these and then have the user put their input, then have the world check their input with your statements, and have whatever action it is told to do be bone.

I'm actually having the same issue as this poster and thought maybe I could get a bit of direction. This is the actual text of the tutorial from the Alice book.

"Create an interactive world that asks the user to enter a number that is at least 1 but not greater that 10. A character of your choice should translate the number to Roman numerals, and say the roman numerals in a speech bubble. If the user enters a number outside the range of 1 through 10, the character should say that is an invalid number was entered."


The first and third part I can do fine. I declare the variable, then set the variable to "ask the user for a number", I create an if/else statement to compare the variable to a number less than or equal to 10, and then I add what would be said if the number falls inside or outside of the range. My issue is I have no clue on when a user inputs say a 5 to get it to appear as the roman numeral V when the text bubble pops up. Sorry to bump an older topic but I thought it would make more sense than creating a new one.
   
Reply With Quote
Done
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Done - 02-18-2014, 04:16 PM

Are you by any chance studying how arrays work? sounds like a perfect opportunity to use one, and makes for a really short program once you get it set up.
   
Reply With Quote
Old
SnowWolf
Junior Member
 
Status: Offline
Posts: 2
Join Date: Feb 2014
Location: Maryland
Default 02-18-2014, 04:48 PM

Quote:
Originally Posted by MrMoke View Post
Are you by any chance studying how arrays work? sounds like a perfect opportunity to use one, and makes for a really short program once you get it set up.
We aren't even close to that, we are on if/else statements currently.
   
Reply With Quote
More Cumbersome, bit Simple
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default More Cumbersome, bit Simple - 02-18-2014, 07:12 PM

If answer < 1 OR answer > 10
The character says "Duh".
If the answer == 1
The character says "I".

Etc., etc., etc.

Last edited by MrMoke; 02-19-2014 at 08:55 AM.
   
Reply With Quote
Old
empowermenttech
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jan 2014
Location: lucknow
Default 02-28-2014, 05:17 AM

Nice question and very good answers. I got also my answer. Thanks
   
Reply With Quote
Ok
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Ok - 03-04-2014, 10:57 AM

That's good.
   
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.