- Joined
- Jul 4, 2008
- Messages
- 1,106
Assignment 1
Now, I'm not sure whether or not this was meant to be a Math issue other than a Jass issue, but it seems to be more concerned about Math than Jass, which according to me is somewhat out of the point of this class.
But here we go, although I am an amateur at Math, the results will be below.
JASS:
// Solve: 6 / 5 * 4 / 3 * 2 - 1
// Let's start by doing shait.
local integer array v
local integer array m
set v[0] = 6
set v[1] = 5
set v[2] = 4
set v[3] = 3
set v[4] = 2
set v[5] = 1
set m[0] = v[0] / v[1] * v[2] / v[3] * v[4] - v[5]
set m[1] = (v[0] / v[1]) * (v[2] / v[3]) * (v[4] - v[5])
set m[2] = ((((v[0] / v[1]) * v[2]) / v[3]) * v[4]) - v[5]
return m[2]
/* Note that m[2] is how I would've ended calculating it overall.
The proper method is most definitely far away. */
// How should I know if (4 / 3 * 2) is executed as 4/3 * 2 or as 4 / (3*2)?
// No idea. I'm honestly not a math person.
local integer array v
local integer array m
set v[0] = 4
set v[1] = 3
set v[2] = 2
return m[0] = v[0] / v[1] * v[2]