• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Evaluated] [Assignment] Week 1

Status
Not open for further replies.

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]
 
Status
Not open for further replies.
Top