Page 1 of 2
Those math statements
Posted: Sat Jul 19, 2003 11:58 pm
by Alcoholic
I forgot what they were called, but I learned them in elementary school. Whats the name of those statements that come out like this?
100,000 + 20,000 + 5 = 120,005
Is there a way to do that in mohaa? Like if I had an 8 and a 4, could I add it so it makes 84?
Posted: Sun Jul 20, 2003 1:59 am
by HappyChappy_7000
80+4.you can't make it 8 + 4 to 84 coz it doesn't make sense.(to me it doesn't)

Posted: Sun Jul 20, 2003 2:23 am
by Alcoholic
gotta do it the hard way then...

Posted: Sun Jul 20, 2003 3:58 am
by tltrude
(10 * 8) + 4 = 84
Posted: Sun Jul 20, 2003 6:34 am
by jv_map
Or: int("8" + "4") = 84

Posted: Sun Jul 20, 2003 6:20 pm
by Alcoholic
cool that works?
to all concerned....
Posted: Mon Jul 21, 2003 4:57 pm
by grb
just in case someone is wondering what the heck the "int" function does...
It interprets whatever is enclosed in double quotations as alpha numerical
strings and then converts the characters representing integer numbers into
a integer form.
So......using jv_maps example......
int("8" + "4") = 84
the int function evaluates the alphanumeric character "8" as a integer numeric 8 and the alphanumeric character "4" as being an integer 4 THEN
concatonates (joins them together in a string) then CONVERTS THE STRING INTO IT'S integer form.
As to Alcoholic's question....what is the name of the term for a sequence such as 100,000 + 20,000 + 5 = 120,005
I believe you would call it a Polynomial term. That is it contains more then two (binomial) sets of numbers on one side of the equal sign.
ex:
A +B = C would be a binomial as apposed to A (B*C) = D being more then two elements which would be of a polynomial form. And for those that have been away from math for some time. The above simple examples can be called an equation, because you are equating something on the left hand side of the equal sign to being equal to something on the righthand side of the equal sign.
cheers
Re: to all concerned....
Posted: Tue Jul 22, 2003 2:31 am
by TheShiznaeSpe
grb wrote:just in case someone is wondering what the heck the "int" function does...
It interprets whatever is enclosed in double quotations as alpha numerical
strings and then converts the characters representing integer numbers into
a integer form.
So......using jv_maps example......
int("8" + "4") = 84
the int function evaluates the alphanumeric character "8" as a integer numeric 8 and the alphanumeric character "4" as being an integer 4 THEN
concatonates (joins them together in a string) then CONVERTS THE STRING INTO IT'S integer form.
As to Alcoholic's question....what is the name of the term for a sequence such as 100,000 + 20,000 + 5 = 120,005
I believe you would call it a Polynomial term. That is it contains more then two (binomial) sets of numbers on one side of the equal sign.
ex:
A +B = C would be a binomial as apposed to A (B*C) = D being more then two elements which would be of a polynomial form. And for those that have been away from math for some time. The above simple examples can be called an equation, because you are equating something on the left hand side of the equal sign to being equal to something on the righthand side of the equal sign.
cheers
and that's why i almost failed both algebra and geometry

Posted: Tue Jul 22, 2003 6:49 am
by jv_map
It's all comprehensible as long as you stick to the point (unlike grb

), but nice info anyway

Sorry for the verbosity....just trying to help.
Posted: Tue Jul 22, 2003 3:53 pm
by grb
I was only trying to explain to HappyChappy_7000, how the int() function works, since he indicated that he did not understand your reply. And also
provide a simple answer to Alcoholic to his question. Sorry if it appeared to be to lenghtly an answer. No respones required. And no ill feelings harbored in any way.
cheers
Posted: Tue Jul 22, 2003 4:02 pm
by TheShiznaeSpe
i'm just messing with, man

well while where at it....
Posted: Wed Jul 23, 2003 12:50 am
by grb
Can Jv_Map or some other expert give a good example of where we would want to use the int() function in the manner it was used in the example in this thread? Not sure what use it would have in the context of the example, but then again, most of the time I'm not to bright.
I think I will check out some of the stock scr files to see where the int()
function may be used.
And TheShiznaeSpe..... I understood your comment to imply no negative.
I failed algebra many years ago before I started to get serious about obtaining some form of education.
cheers all
Posted: Wed Jul 23, 2003 7:02 am
by jv_map
I know where Alcoholic needs it for but I won't yet tell. It may be a 'top secret' project

jv_map...
Posted: Wed Jul 23, 2003 3:28 pm
by grb
fair enough. Incidentally after a search thru ALL the PK0 global files for a string that contained "int(" to catch any int function call, I found not one.
So it appears that the folks who created the stock missions did not have a
need to use the function.
cheers
Posted: Sun Oct 05, 2003 9:18 pm
by sysQuik
How about if you want to make a variable an integer like "20" instead of "20.000". So...
Code: Select all
main:
level.mynumber = 100
thread my_value
end
my_value:
local.n = (level.mynumber) * .1
println "local.n = " (local.n)
end
This will output something like "local.n = 10.000". How would you make it output "local.n = 10", basically getting rid of the decimal places? I've tried int (local.n), (int local.n) and variations of these, but they don't work. I read through all the docs I can find as well as through this index, but I haven't seen int used with variables. Any ideas?
Take it easy,
SysQuik