A learning puppet code