Since this is a similar issue, I decided to continue this same email thread.

Running the Fixed FPS from pg. 42 in section 5-2, I receive the following
error:

"Illegal division by zero at C:\p42_5-2_FixedFPS.pl line 83."

The line referenced reads:

$FPS = int(($frames * 100) / $delta_time );

This doesn't happen immediately and the program will usually run for a few
seconds (5-10) before crashing and displaying the message.  I verified that
my code matches the code in the SDL Manual.

I was running this without any command-line arguments when this first
occurred.  I then tried with ARGV[0] = 60 and the Divide by Zero occurs
within a second of the program starting.  I tried ARGV = (60 , 60) and the
result is the same as ARGV[0] = 60.  I also tried ARGV = (500, 300) with the
same results.

Hope this helps and I've attached the code.



On Mon, Jan 3, 2011 at 8:52 AM, Kartik Thakore <thakore.kar...@gmail.com>wrote:

> Done at
>
> http://bit.ly/i0j3mc
>
> Thanks.
>
>
> On Sun, 2011-01-02 at 21:42 -0500, Sheppy R wrote:
> > I remembered encountering an issue the first go through the manual, but
> > wasn't really aware of the community at that time.  I'm going back
> through
> > the most recent version and came across the following 'typo'.  I don't
> know
> > why, but I"m inclined to blame garu.
> >
> > pg. 33 -> Remove the 'my' in line 51.  $brush_color is a global variable.
> >
> > 51 my $brush_color = $key_name if $key_name =~ /^nd$/;
> >
> > The program will run, but the user will not be able to change the brush
> > color as long as 'my' is in there.
>
>
>

Attachment: p42_5-2_FixedFPS.pl
Description: Binary data

Reply via email to