žGçU|€SXζζD"εγεDgDisëXи]"©.V˜sø®.V€Sø˜‚øʒË}ʒXå≠}gq
žGçU|€SXζζD"εγεDgDisëXи]"©.V˜sø®.V€Sø˜‚øʒË}ʒXå≠}gq
এটি অনলাইনে চেষ্টা করুন।
এটি আমি এখনও লিখেছি এমন এক কুরুচিপূর্ণ এবং দীর্ঘতম 05AB1E প্রোগ্রাম ..>>> এই চ্যালেঞ্জটি 05AB1E এ প্রতারণামূলকভাবে কঠোর। আমার কোনও সন্দেহ নেই যে বাইট-কাউন্টটি কমপক্ষে অর্ধেক বা এমনকি তিন / চারগুণ ছোট হতে পারে ভিন্ন পদ্ধতির (বা এমনকি একই ধরণের পদ্ধতির সাহায্যে) ব্যবহার করে, তবে বর্তমানে কীভাবে তা দেখছি না। আমি এই মুহুর্তে এখনই কাজ করছি বলে খুব আনন্দিত .. অন্য কেউ যদি কিছু স্মার্ট ট্রিকস দিয়ে খুব কম 05ab1E উত্তর পোস্ট করেন তবে আমি সম্ভবত উত্তরটি লজ্জার কারণে মুছে ফেলব ... xD
ব্যাখ্যা:
žGç # Character with unicode 32768 ('耀')
U # Pop and store it in variable `X`
# (This character is not part of the printable ASCII, nor of my 05AB1E code)
| # Take the multi-line input as list
# i.e. "Ybb\nYH%\n%%%%" → ["Ybb","YH%","%%%%"]
€S # Convert each string to a list of characters
# i.e. ["Ybb","YH%","%%%%"] → [["Y","b","b"],["Y","H","%"],["%","%","%","%"]]
Xζζ # Zip with character `X` as filler twice to make the lines of equal length
# i.e. [["Y","b","b"],["Y","H","%"],["%","%","%","%"]]
# → [["Y","b","b","耀"],["Y","H","%","耀"],["%","%","%","%"]]
D # Duplicate this list
" " # Create a string
© # Which we store in the register (without popping)
.V # And execute that string as 05AB1E code
ε # Map each inner list to:
γ # Split in chunks of the same characters
# i.e. [["Y","b","b"],["Y","H","%"],["%","%","%","%"]]
# → [[["Y"],["b","b"]],[["Y"],["H"],["%"]],[["%","%","%","%"]]]
ε # Map each of those to:
D # Duplicate the current inner list
gDi # If its length is exactly 1:
s # Swap so the mapping keeps the duplicated single character (as list)
ë # Else:
Xи # Take character `X` repeated the length amount of times
# i.e. ["%","%","%","%"] (length 4) → ["耀","耀","耀","耀"]
] # Close the if-else and both maps
˜ # Flatten the list to a single list of characters
# i.e. [[["Y"],["耀","耀"],["耀"]],[["Y"],["H"],["%"],["耀"]],[["耀","耀","耀","耀"]]]
# → ["Y","耀","耀","耀","Y","H","%","耀","耀","耀","耀","耀"]
s # Swap so the duplicate list is at the top of the stack
ø # Swap its rows and columns
# i.e. [["Y","b","b","耀"],["Y","H","%","耀"],["%","%","%","%"]]
# → [["Y","Y","%"],["b","H","%"],["b","%","%"],["耀","耀","%"]]
®.V # Execute the same piece of code again that we've stored in the register
€S # Convert each to a list of characters
# i.e. [[["耀","耀"],["%"]],[["b"],["H"],["%"]],[["b"],["耀","耀"]],[["耀","耀"],["%"]]]
# → [["耀","耀","%"],["b","H","%"],["b","耀","耀"],["耀","耀","%"]]
ø # Swap its rows and columns back again
# i.e. [["耀","b","b","耀"],["耀","H","耀","耀"],["%","%","耀","%"]]
˜ # Flatten this list as well
‚ # Pair both lists together
# i.e. [["Y","耀","耀","耀","Y","H","%","耀","耀","耀","耀","耀"],
# ["耀","b","b","耀","耀","H","耀","耀","%","%","耀","%"]]
ø # Swap its rows and columns to create pairs
# i.e. [["Y","耀"],["耀","b"],["耀","b"],["耀","耀"],["Y","耀"],["H","H"],["%","耀"],["耀","耀"],["耀","%"],["耀","%"],["耀","耀"],["耀","%"]]
ʒË} # Filter out any inner lists where both characters are not equal
# i.e. [["耀","耀"],["H","H"],["耀","耀"],["耀","耀"]]
ʒXå≠} # Filter out any inner lists that contain the character `X`
# i.e. [["H","H"]]
g # Take the length as result
# i.e. [["H","H"]] → 1
q # Stop the program, making all other characters no-ops
# (and output the length above implicitly)