Como realmente tenía que hacerse, aquí está. Fue realmente desagradable depurar y proporcionó algunos desafíos.
La entrada debe ser solo letras mayúsculas. La salida es unaria (¿espero que esté bien?)
J K ZZZZZZK Z ZD ZB ZZZZZZZZZZZZZZZZZA K A Z ZD ZB ZZZZZZZZZZZZZZZKF K A Z ZD ZB ZZZZZZZZZZZZZZZB K A Z ZD ZB ZZZZZZZZZZZZZZZ K A Z ZD ZB ZZZZZZZZZZZZZZKD K A Z ZD ZB ZZZZZZZZZZZZZD K A Z ZD ZB ZZZZZZZZZZZZZD K A Z ZD ZB ZZZZZZZZZZZZ K A Z ZD ZB ZZZZZZZZZZZZB K A Z ZD ZB ZZZZZZZZZKA K A Z ZD ZB ZZZZZZZZZKF K A Z ZD ZB ZZZZZZZZZZK K A Z ZD ZB ZZZZZZZZZB K A Z ZD ZB ZZZZZZZZZB K A Z ZD ZB ZZZZZZZZKD K A Z ZD ZB ZZZZZZZK K A Z ZD ZB ZZZZKB K A Z ZD ZB ZZZZZZKF K A Z ZD ZB ZZZZZZB K A Z ZD ZB ZZZZZFB K A Z ZD ZB ZZZZZA K A Z ZD ZB ZZZAK K A Z ZD ZB ZZZ K A Z ZD ZB ZD K A Z ZD ZB ZKB K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K ZZZZKF KF K A ZKA ZZZZZZZZZZZZZZZZZZY
Pruébalo en línea!
El proceso general es:
- obtener carácter de entrada
- restar 65
- verificar si el resultado es 0
- si 0 salta la cantidad especificada de palabras.
- de lo contrario, reste 1 y repita la verificación.
- Los objetivos de salto son operaciones de impresión push seguidas de un bucle de regreso al comienzo del programa.
Termina con un error.
Una explicación más completa:
J K ZZZZZZK Z ZD # Get input and subtract 65
ZB ZZZZZZZZZZZZZZZZZA K A Z ZD # Character A - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZZZZKF K A Z ZD # Character B - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZZZZB K A Z ZD # Character C - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZZZZ K A Z ZD # Character D - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZZZKD K A Z ZD # Character E - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZZD K A Z ZD # Character F - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZZD K A Z ZD # Character G - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZ K A Z ZD # Character H - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZZZB K A Z ZD # Character I - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZKA K A Z ZD # Character J - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZKF K A Z ZD # Character K - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZZK K A Z ZD # Character L - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZB K A Z ZD # Character M - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZZB K A Z ZD # Character N - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZZKD K A Z ZD # Character O - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZZK K A Z ZD # Character P - if 0 jump to print, otherwise subtract 1
ZB ZZZZKB K A Z ZD # Character Q - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZKF K A Z ZD # Character R - if 0 jump to print, otherwise subtract 1
ZB ZZZZZZB K A Z ZD # Character S - if 0 jump to print, otherwise subtract 1
ZB ZZZZZFB K A Z ZD # Character T - if 0 jump to print, otherwise subtract 1
ZB ZZZZZA K A Z ZD # Character U - if 0 jump to print, otherwise subtract 1
ZB ZZZAK K A Z ZD # Character V - if 0 jump to print, otherwise subtract 1
ZB ZZZ K A Z ZD # Character W - if 0 jump to print, otherwise subtract 1
ZB ZD K A Z ZD # Character X - if 0 jump to print, otherwise subtract 1
ZB ZKB # Character Y - if 0 jump to print, otherwise subtract 1
K ZZZZKF KF # Jump Point for print 1111111111
K ZZZZKF KF #
K ZZZZKF KF # Jump Point for print 11111111
K ZZZZKF KF #
K ZZZZKF KF #
K ZZZZKF KF # Jump Point for print 11111
K ZZZZKF KF # Jump Point for print 1111
K ZZZZKF KF # Jump Point for print 111
K ZZZZKF KF # Jump Point for print 11
K ZZZZKF KF # Jump Point for print 1
K A ZKA ZZZZZZZZZZZZZZZZZZAAAA # Jump back to start