I'd love to know the exact formula as well. I believe the factors involved are strength, level, and weapon.Almost every weapon gives a bonus to thac0 (or whatever you want to call it). For example, short swords raise your attack rating by three, long swords boost it by four, and the Muramasa Blade elevates it by eight. These stats apply to the NES version, which is a mostly faithful port.