Confusing to a girl, the King’s rule? (9)
I believe the answer is:
algorithm
'rule?' is the definition.
(algorithm is a kind of rule)
'confusing to a girl the king's' is the wordplay.
'confusing' is an anagram indicator.
'the king' becomes 'hm' (short for His Majesty).
'to'+'a'+'girl'='toagirl'
'toagirl' with letters rearranged gives 'algorit'.
'algorit'+'hm'='ALGORITHM'
(Other definitions for algorithm that I've seen before include "Step-by-step solution method - oral might (anag)" , "Problem-solving formula" , "Set of rules (for computer) to solve a problem" , "Procedure" , "Set of rules for solving problem by computer" .)