Tool-Assisted Code Golf
Python 2, 69 48 46 44 bytes
print"start\n\n"*19+(27*"A right\n"+"\n")*99
See it in action on youtube!
Automatically found with (a modified version of) this hacky script:
start = 18
oncycle = 21
offcycle = 4
while true do
emu.poweron()
-- emu.speedmode("maximum")
starting = 0
i = 0
frames = 0
last_mario_x = -1
emu.message(start .. " " .. oncycle .. " ".. offcycle)
state = 0
while state ~= 6 and state ~= 11 and frames < 4000 do
if frames > 500 and frames % 100 == 0 then
mario_x = memory.readbyte(0x6D) * 0x100 + memory.readbyte(0x86)
if mario_x == last_mario_x then emu.message("stuck " .. mario_x .. " " .. last_mario_x); break end
last_mario_x = mario_x
end
if starting < start then
joypad.set(1, {start=1})
emu.frameadvance(); frames = frames + 1;
joypad.set(1, {})
emu.frameadvance(); frames = frames + 1;
starting = starting + 1
else
if i < oncycle then
joypad.set(1, {A=1, B=1, right=1})
i = i + 1
else
joypad.set(1, {})
i = i + 1
if i == oncycle + offcycle then
i = 0
end
end
emu.frameadvance()
frames = frames + 1
end
state = memory.readbyte(0x000E)
if state == 4 then
emu.message("success!")
os.exit()
break
end
end
if start < 30 then
start = start + 1
elseif offcycle < 10 then
start = 18
offcycle = offcycle + 1
else
offcycle = 1
oncycle = oncycle + 1
end
end
Python 2, 107 bytes
i=0
print'\n'*33+'start'
for c in'~~22 + 2 2? @ F . \r0'+'@'*10:print'A B right\n'[i:]*ord(c);i^=2