An open API service indexing awesome lists of open source software.

https://github.com/cdvel/drawing_squares

TDD'd coding exercise, brain teaser. Tested with SNAP-CI
https://github.com/cdvel/drawing_squares

Last synced: about 1 year ago
JSON representation

TDD'd coding exercise, brain teaser. Tested with SNAP-CI

Awesome Lists containing this project

README

          

[![Build Status](https://snap-ci.com/cesarvelandia/drawing_squares/branch/master/build_image)](https://snap-ci.com/cesarvelandia/drawing_squares/branch/master)

#Drawing Exercise 1
## Draw a Square
This is a square of size 4, with 'x' along the edge of the square and space ' ' in the middle of the square.

```
xxxx
x x
x x
xxxx
```

Here is the same square represented as a Java string.
String square4 = "xxxx\n" +
"x x\n" +
"x x\n" +
"xxxx";

### Exercise
Write code that given a size can return a string, which represents a square of size with 'x' in the edge and space ' ' in the middle, s s same as the square of size 4 shown above The code needs to be tested using unit tests comprehensively. The code should be and there is , it's enough to have the code run by the tests simple no need to create a main method

## Draw multiple squares
Revisit your program in order to be able to draw multiple squares, by allowing them to be drawn on top of each other. For example, sq3 on top of sq6:

```
xxxxxx
x x x
xxx x
x x
x x
xxxxxx
```