{"id":18722784,"url":"https://github.com/bronzdoc/crypto-square","last_synced_at":"2025-11-11T05:30:24.885Z","repository":{"id":89418456,"uuid":"58290642","full_name":"bronzdoc/crypto-square","owner":"bronzdoc","description":"Solution for the crypto-square exercism","archived":false,"fork":false,"pushed_at":"2016-05-08T03:46:13.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T06:42:41.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bronzdoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-08T00:54:54.000Z","updated_at":"2016-05-08T00:56:53.000Z","dependencies_parsed_at":"2023-03-13T18:09:56.677Z","dependency_job_id":null,"html_url":"https://github.com/bronzdoc/crypto-square","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bronzdoc%2Fcrypto-square","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bronzdoc%2Fcrypto-square/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bronzdoc%2Fcrypto-square/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bronzdoc%2Fcrypto-square/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bronzdoc","download_url":"https://codeload.github.com/bronzdoc/crypto-square/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239587244,"owners_count":19663892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:42:52.057Z","updated_at":"2025-11-11T05:30:24.844Z","avatar_url":"https://github.com/bronzdoc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crypto Square\n\nImplement the classic method for composing secret messages called a square code.\n\nThe input is first normalized: The spaces and punctuation are removed\nfrom the English text and the message is downcased.\n\nThen, the normalized characters are broken into rows.  These rows can be\nregarded as forming a rectangle when printed with intervening newlines.\n\nFor example, the sentence\n\n\u003e If man was meant to stay on the ground god would have given us roots\n\nis 54 characters long.\n\nBroken into 8-character columns, it yields 7 rows.\n\nThose 7 rows produce this rectangle when printed one per line:\n\n```plain\nifmanwas\nmeanttos\ntayonthe\ngroundgo\ndwouldha\nvegivenu\nsroots\n```\n\nThe coded message is obtained by reading down the columns going left to\nright.\n\nFor example, the message above is coded as:\n\n```plain\nimtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau\n```\n\nWrite a program that, given an English text, outputs the encoded version\nof that text.\n\nThe size of the square (number of columns) should be decided by the\nlength of the message.\n\nIf the message is a length that creates a perfect square (e.g. 4, 9, 16,\n25, 36, etc), use that number of columns.\n\nIf the message doesn't fit neatly into a square, choose the number of\ncolumns that corresponds to the smallest square that is larger than the\nnumber of characters in the message.\n\nFor example, a message 4 characters long should use a 2 x 2 square. A\nmessage that is 81 characters long would use a square that is 9 columns\nwide.\n\nA message between 5 and 8 characters long should use a rectangle 3\ncharacters wide.\n\nOutput the encoded text grouped by column.\n\nFor example:\n\n- \"Have a nice day. Feed the dog \u0026 chill out!\"\n  - Normalizes to: \"haveanicedayfeedthedogchillout\"\n  - Which has length: 30\n  - And splits into 5 6-character rows:\n    - \"havean\"\n    - \"iceday\"\n    - \"feedth\"\n    - \"edogch\"\n    - \"illout\"\n  - Which yields a ciphertext beginning: \"hifei acedl v…\"\n\n* * * *\n\nFor installation and learning resources, refer to the\n[exercism help page](http://exercism.io/languages/ruby).\n\nFor running the tests provided, you will need the Minitest gem. Open a\nterminal window and run the following command to install minitest:\n\n    gem install minitest\n\nIf you would like color output, you can `require 'minitest/pride'` in\nthe test file, or note the alternative instruction, below, for running\nthe test file.\n\nIn order to run the test, you can run the test file from the exercise\ndirectory. For example, if the test suite is called\n`hello_world_test.rb`, you can run the following command:\n\n    ruby hello_world_test.rb\n\nTo include color from the command line:\n\n    ruby -rminitest/pride hello_world_test.rb\n\nThe test files may have the execution bit set so you may also be able to\nrun it like this:\n\n    ./hello_world_test.rb\n\n## Source\n\nJ Dalbey's Programming Practice problems [http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html](http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbronzdoc%2Fcrypto-square","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbronzdoc%2Fcrypto-square","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbronzdoc%2Fcrypto-square/lists"}