Created
July 12, 2019 05:55
-
-
Save tbilous/83eafafa531df61edf3e813a74a3c946 to your computer and use it in GitHub Desktop.
Part 1 Task 2 (Ver.1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # example: ruby task_p1_t2_v1.rb 'To be or not to be that is the question' 5 | |
| v1, v2 = ARGV | |
| puts v1.scan(/.{1,#{v2}}\b|.{1,#{v2}}/).each(&:lstrip!).join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment