Back to basics...
As a teacher at the local primary (grade?) school, you need a way to teach your class their times tables. At your disposal, you have hundred squares and a load of red pens. You need to also be able to show your class the correct answers quickly.
Now, you're clever enough to write a program that can do times tables, but can you draw them on a hundred square?
The challenge
Output a hundred square to stdout or equivalent using ansi-escape codes to shade in numbers which are multiples of the input.
- Output a 10x10 grid containing the numbers 1-100.
- It doesn't matter the alignment of 2 digit numbers in each box as long as it's consistant
- For 1 digit numbers, you may pad to 2 digits and use the same formatting as 2 digit numbers or centered in the middle of the box.
- If the number in the box is a multiple of the input, colour the entire box red.
- This means the whole box, not just the number part
For example, given the input 3
, print the given hundred square
This is code golf so the shortest answer in bytes wins!
<table>
, for example? \$\endgroup\$ – nicael Jun 13 '16 at 19:22white
orgrey
? \$\endgroup\$ – Bassdrop Cumberwubwubwub Jun 13 '16 at 19:23curses
it shouldn't matter - red is short anyway. \$\endgroup\$ – Blue Jun 13 '16 at 19:27