Dunno what the topic should be other than it works and i'm a bit burnt out

new topic     » topic index » view thread      » older message » newer message

I've just spent the last 2 days **hacking** and it works, but...

I have ended up with code like the following:

printf(1,"   Printed:%d Rec:%d Fld:%d (%s%s:%d) Prev:%d Next:%d\n",
		 fieldlist[i][5][k..k+2]&ddata[1..3]&fieldlist[i][5][k+3])

(Yes, I went a bit mad & I guess I'm a bit lucky there are a few debug
prints left which give *me* clues to code *I just wrote* - not even 48
hours old... Why [5]? Why [k..k+2]? etc...)

Worse:
	for k=3D1 to length(fieldlist[dupf][5]) by 4 do
		if fieldlist[dupf][5][k+2]=3Dddata[3]=20
		and fieldlist[dupf][5][k+1]=3Drli then
		if fieldlist[dupf][5][k+3][2]=3D0 then
			fieldlist[dupf][5][k+3][2]=3Dfli

-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D-

Can't believe I did that; Can't believe it works...
But I did, there you have it, colour me stupid.

-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D-

I have started the correcting process with eg:
constant F_Face=3D1, F_Size=3D2, F_Attr=3D3, F_Clr=3D4, F_Uniq=3D5
.....
	printf(1,"Face:%s Pitch:%d Attributes:%s Colour:%s\n",
			{font[F_Face],
			 font[F_Size],
			 get_attr_desc(font[F_Attr]),
			 get_colour_desc(font[F_Clr])})

-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D-
That's a bit clearer. Rectifying the rest of the code...

Stepwise, test again at every step, pencil and paper job, I guess.=20

Otherwise does anyone have any tips on converting gibberish but
working code back to something readable without breaking it?

Yours hopefully,
Pete (obviously a bit deranged and doing some odd self-humiliation
therapy, or something !)

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu