Looking for a book called something like "I²", or I squared, or perhaps "me²": it's about an eight-bit artificial intelligence that grows up inside a computer, playing something like Tube Wars to learn how to survive. it gets installed into a robot body which is shipped somewhere on a train and the AI has to figure out how to reattach some of its limbs and escape, where it hides in a barn and is discovered by the farmer's daughter who menaces it with a pitchfork.
sry, can't remember the author.
@Nikolai_Kingsley Do you remember roughly which decade you saw/read it?
Consider this a friendly, local pub. Make yourself at home, bring your friends, have a good time! Meet new people, have a laugh, enjoy the ambience, and the Oxford commas.