/// , 35 байт
/I///,*/+,//+/I//**,/,A//*/A//,//,I
Попробуйте онлайн!
Вводит в унарном виде, используя символ *, и выводит в унарном, используя символ A. Это разрешено для некоторых конкретных языков, включая /// ( мета )
Поскольку нет никакого способа получить ввод в ///, ввод должен быть жестко закодирован:
/I/«put input here»//,*/+,//+/I//**,/,A//*/A//,//,I
для ввода = 4.
Объяснение: (перед чтением необходимо знать, что единственный синтаксис ///- /pattern/replacement/это заменить каждый случай patternна replacement; и \для экранирования; для вывода на печать выводятся другие символы)
Для n=4:
/I/****//,*/+,//+/I//**,/,A//*/A//,//,I Start program.
/I/****/ Replace all `I` in the program by the input.
/,*/+,//+/****//**,/,A//*/A//,//,**** Remaining part of the program.
/,*/+,/ Use the `,` as a scanner, scan through `*` after it and convert to `+`.
/+/****//**,/,A//*/A//,//++++, Note that only `*` in the second group is affected.
/+/****/ Replace all `+` (which is just created) by `n` asterisks (from the first `I` group)
/**,/,A//*/A//,//****************, Now at the last of the program before the `,` there are `n²` asterisks.
/**,/,A/ Scan the `,` to the left to perform division by 2:
replace each `**` by a `A` as the scanner `,` pass through.
/*/A//,//,AAAAAAAA Remaining program.
/*/A/ If there is any `*` remaining (if `n²` is odd), replace it with `A`.
/,// Remove the scanner `,`.
AAAAAAAA Output the result.