Collect and buy commands. Construct program from them. Run code to get more coins and commands. Repeat.