Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mihaeu/kata-word-wrap
http://codingdojo.org/cgi-bin/index.pl?KataWordWrap
https://github.com/mihaeu/kata-word-wrap
Last synced: 1 day ago
JSON representation
http://codingdojo.org/cgi-bin/index.pl?KataWordWrap
- Host: GitHub
- URL: https://github.com/mihaeu/kata-word-wrap
- Owner: mihaeu
- Created: 2015-11-12T17:10:27.000Z (about 9 years ago)
- Default Branch: split-words
- Last Pushed: 2015-11-16T11:58:52.000Z (almost 9 years ago)
- Last Synced: 2024-10-20T08:34:56.665Z (24 days ago)
- Language: PHP
- Size: 0 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Word Wrap Kata by Robert Martin
My attempt at the kata which was suggested by Robert Martin on his blog. I used the following [description](http://codingdojo.org/cgi-bin/index.pl?KataWordWrap):
> You write a class called Wrapper, that has a single static function named wrap that takes two arguments, a string, and a column number. The function returns the string, but with line breaks inserted at just the right places to make sure that no line is longer than the column number. You try to break lines at word boundaries.
> Like a word processor, break the line by replacing the last space in a line with a newline.
## Getting started
```bash
# get the code
git clone https://github.com/mihaeu/kata-word-wrap
cd kata-word-wrap# install dependencies using composer (if installed globally)
composer install# run tests
vendor/bin/phpunit
```