# (Linear Algebra) Evade The Sun Like A Vampire

Your Sneaky Ninja game was a wild success. Now you're creating your next game...this time in 3D!

In this one, you play Mr. Vampire, a vampire who's trying to evade being exposed to too much sunlight before finding a shelter of darkness.

You've prototyped the game out, and are in the testing phase. The brighter the sunlight that shines on Mr. Vampire's body, the more life he loses.

Mr. Vampire currently has 12 life points left, and his body orientation at that point is described by the vectors <2, 5, 3> & <1, -4, 6>. A ray of sunlight, L, described by the vector <-10,-6,2> shines itself on the vampire at that body orientation point (blue cube).

Typically in gaming, surface brightness is described as N * L, where N is the normalized surface normal (see blue arrow below).

The greater the value of N * L, the more the object is facing towards the light and brighter the surface will be.

Hint: totally lost? Read this for some background!

Assuming the damage done to the vampire is equal to N * L, should Mr. Vampire still be alive or now be a dead pile of dust?

(Note: Jen now totally understands how knowing linear algebra is useful in game development.)

# (Logic) Peter, Paul or Mary?

Given the following algorithm

ABC = 5

If ABC = 5 then DEF = "Peter"

If ABC > 5 then DEF = "Paul"

If ABC <_ 5 then DEF = "Mary"

Print DEF

The output of the last statement is

(Original question contributed by Professor Autar Kaw. Modified with permission.)

# (Math) What's The Sum Of Me?

Short and simple(?) question today folks...

What's the sum of the integers from 1 to 100?

# (Math) Evade Machine Guns Like a Ninja

Time for a new hobby - you've decided to learn how to code and develop games.

In your game, you're a sneaky ninja that tries to slide undetected past deadly objects that try to kill you. One of these objects is a machine gun that automatically hones in on your location and shoots if you're within range.

You think you've finally got it programmed out, and now you're testing to see if everything works correctly. You run the game.

The machine gun is at (7, 5), currently facing in the direction (1, 3). It's got a 120 degree field of view and its firing radius extends to the entire map. Sneaky Ninja sneaks to point (2, 7) on the map.

At this point, should you expect Sneaky Ninja to get shot?

# (Computers) # Of Bytes in 4MB

The number of bytes in a 4MB memory is

(Original question contributed by Professor Autar Kaw. Modified with permission.)