Problem with TwotyFruity.cs in Chapter 2
by Matthew Ruggiero · in Torque Game Engine · 06/29/2004 (11:33 am) · 1 replies
I ran this example and it did not print out what was expected.
I used the one that was on the CD. i.e. I didn't introduce errors by typing it in myself.
Here is the output I got.
Total pieces of fruit: 1
Total Price of Fruit: $1.15
This doesn't seem to be what the book says it should.
I printed out the value of $numFruitTypes and it doesn't seem to be initialized correctly with the following line:
Don't know if that is the problem or something in the function call is causing the problem.
Does anyone know what the problem is?
Thanks.
-Matthew Ruggiero
I used the one that was on the CD. i.e. I didn't introduce errors by typing it in myself.
Here is the output I got.
Total pieces of fruit: 1
Total Price of Fruit: $1.15
This doesn't seem to be what the book says it should.
I printed out the value of $numFruitTypes and it doesn't seem to be initialized correctly with the following line:
$numFruitTypes = InitializeFruit();
Don't know if that is the problem or something in the function call is causing the problem.
Does anyone know what the problem is?
Thanks.
-Matthew Ruggiero
Torque Owner Matthew Ruggiero
I found the problem.
The InitializeFruit function should return $numTypes and not %numTypes.