Quote:
Originally Posted by sfunk
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.