Re: Act.informative.c

From: Adam Days (g98s12@oemsunix.onysd.wednet.edu)
Date: 07/23/96


Okay I came up with a new way to do it, and I don't think it divides by
zero in any way shape or form, but it still doesn't work.

how 'bout this:

int i;
float val;
int z;

z = GET_HIT(ch) * 50; /* always a whole number */
val = z / GET_MAX_HIT(ch); /* here is where it gets into a decimal */

for(i=0; i <= val; ++i)
  *(buf2 + i) = '*';
  *(buf2 + i) = '\0';

sprintf(buf, "[ %-50s ] LIFE METER\r\n", buf2);
  send_to_char(buf, ch);

shouldn't this work?  I tried it but it still messes up. same Arithmetic
Exception.  I'm not still dividing by zero am I?
*******************************************************************************
 Adam Days  a.k.a		  ** "Being an Outcast is only a frame of mind
 Drizzt Do'Urden                  **  and not something that is placed upon
 Unholy Lands <164.116.34.2 4000> **  you."  -Adam Days
*******************************************************************************



This archive was generated by hypermail 2b30 : 12/07/00 PST