i would like to ask how type the codes for mastermind game in greenfoot?
This is too general of an ask. Are you wanting someone to do your assignment for you? Try anything. Show what you tried and ask for help when you get stuck on something specific. I will say this much: in turn-based games (which mastermind basically is -- guess, followed by hints), your world will "control" the game.