Details
David is firing up the barbecue to sear a thick cut of A5 Wagyu. Because David treats steak as an exact science, he demands a mathematically perfect 45° crosshatch sear over a BMS 12 marbling pattern.
Print the 19×9 ASCII representation of David's steak (x from 0 to 18 horizontally, y from 0 to 8 vertically) using the following priority rules for each coordinate (x, y):
- Corners: Print
/at(0, 0)and(18, 8). Print\at(18, 0)and(0, 8). - Crust: Print
#along the remaining outer border (x == 0,x == 18,y == 0, ory == 8). - Grill Marks: Inside the border, let
a = (x + y) % 4 == 0andb = (x - y) % 4 == 0.- If both
aandbare true, printX. - If only
ais true, print/. - If only
bis true, print\.
- If both
- Intramuscular Fat (A5 Marbling): Otherwise, if
(x * y) % 3 == 0, print.. - Prime Beef: For all remaining cells, print
@.
Copied
0 bytes, 0 chars
Restore solution
Compiled from
AT&T syntax to x86-64 Linux. Use
syscalls to write output.
ctrl + enter or