চেষ্টা করে (এবং ব্যর্থ হয়ে) আমার শিশু পুত্রকে তার নৈশভোজ খেতে রাজি করিয়েছে, আমি তাকে গান গাওয়ার চেষ্টা করেছি। এই গানের মধ্য দিয়ে আমি বুঝতে পেরেছি যে সূত্রের কাঠামো কোড গল্ফিংয়ের জন্য নিজেকে ভাল ধার দিতে পারে!
কাজটি হ'ল একটি প্রোগ্রাম বা ফাংশন লিখুন যা কোনও ইনপুট গ্রহণ করে না এবং নীচের পাঠ্য উত্পাদন করে:
There's a hole in the bottom of the sea
There's a hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a log in the hole in the bottom of the sea
There's a log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a bump on the log in the hole in the bottom of the sea
There's a bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a frog on the bump on the log in the hole in the bottom of the sea
There's a frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a smile on the flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a smile on the flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
চ্যালেঞ্জ বিধি:
- পাঠ্যটি মুদ্রিত বা ফাংশন আউটপুট হিসাবে ফিরে আসতে পারে
- প্রতিটি আয়াত একক ফাঁকা রেখার দ্বারা পৃথক করা হয়
- শ্বেত স্পেসটি অনুসরণ করা ঠিক আছে যতক্ষণ না এটি বিন্যাসটি পরিবর্তন করে না (সুতরাং কোনও শ্বেত স্পেস বা শব্দের মধ্যে অতিরিক্ত স্থান নেই)
- ট্রেলিং নিউলাইনগুলিও ঠিক আছে।
- কোনও শীর্ষস্থানীয় নিউলাইন নেই।
- সমস্ত ভাষা স্বাগত জানায়, এবং এটি কোড-গল্ফ , তাই প্রতিটি ভাষার জন্য বাইটের মধ্যে সংক্ষিপ্ত উত্তর!
gzip -5
এটা 186 বাইট সংকোচন (এবং bzip2
এবং xz
খারাপ কাজ করতে হবে বলে মনে হচ্ছে)।