Create a function or program that makes a grid as close to an square as possible
- You will be given an integer N as input, whole numbers (1,2,3,25, etc)
- The output must be a perfect rectangular grid of N letters as close to a square as possible
- The (wannabe)square must consist of one of the the letters O or X as specified by user
Points:
- Hardcoded to only O or X: +1
- A param(0/1, true/false, something similar) to rotate output (like with 5 or 8): -10
- Design the square (use both O and X in some sort of pattern): -5
A pattern is considered valid if it contains both types of characters (where x/y-axis >= 3) and the pattern stays the same when flipped horizontally or vertically (exchanging Xs with Os is allowed)
Examples
INPUT: 4 INPUT: 5 INPUT: 8 INPUT: 9
OO OOOOO XXXX XOX
OO XXXX OXO
or rotated 90deg XOX
Examples which aren't allowed (not same length row or columns)
BAD RESULT: 5a BAD RESULT: 5b BAD RESULT: 8
OOO OO OOO
OO OO OOO
O OO
If possible please provide an online example.
"xo"[i]
instead ofi
? That doesn't seem worth it. In general, all of your rewards seem kinda low. \$\endgroup\$