In this paper, a new Genetic Network Programming with Automatic Program Generation (GNP-APG) has been proposed and applied to the Tileworld problem. A kind of genotype-phenotype mapping process is introduced in GNP-APG to create programs. The procedure of the program generation based on evolution is demonstrated in this paper. The advantages of the proposed method are also described. Simulations use different Tileworlds between the training phase and testing phase for performance evaluations and the results shows that GNP-APG could have better performances than the conventional GNP method.