Translate code

Hi guys. I'm super new in Programing. Could anyone please help me translate these lines of code? . Thank you so much !

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  if (getpercentage(95 - object_info[n].Novelity[(int)lpTarget[6]][15] * 5))
					{
						object_info[n].Novelity[(int)lpTarget[6]][15] ++;

						info(s, 0x01, n, (int)lpTarget[6]);
					}
					else
					{
						for(i=0;i<17;i++)
						{
							if ((i==2) || (i==3))
								object_info[n].Novelity[(int)lpTarget[6]][i] = 0xFF;
							else
								object_info[n].Novelity[(int)lpTarget[6]][i] = 0x00;
						}
goodness. This is a bit ugly for a newcomer.

getpercentage is a function. In c, 0 is false, else true.
so if (getpercentage( parameters to a function that does who knows what))
is true, do the rest of it.

[] is index into an array or anything treated as an array. The parameters to getpercentage contain arrays.

++ means add 1, assuming the operator is a standard type like int.

0x01 is hex for 1. Its a way to have to type more stuff for no good reason.

info() // some other function that does who knows what.

else,
loop 17 times (whatever 17 means here)
conditionally setting values to 0 or 255 (hex again)

Without more context, that is about as much as I can do without making tons of assumptions like assuming info prints some stuff to the screen and that getpercentage calculates some sort of percent.
Last edited on
Topic archived. No new replies allowed.