Goal:
The goal of this challenge is to take a simple 6 row by 6 column XML file (without the standard XML header) and parse it out so that the program can return the value of a cell given it's coordinates.
The entry with the shortest overall length by language and overall will be declared the winner.
Additional information:
The XML syntax will always be an HTML table with each inner level being indented by four single spaces. You may assume that every file put into the program will be exactly like the one given below.
If your program uses imports you do not need to include them in the golfed version of your code but you must submit a copy of the program in the explanation that shows all imports used. This explanation will not effect your entries byte count.
Rules:
- The XML file cannot be hardcoded
- XML libraries/functions cannot be used
Extra Credit:
- Can pretty print the table if given the
--all
flag (20 bytes off of total) - Can print all entries of a column given the column number in
--col=number
(20 bytes off of total) - Can print all entries of a row given the row number in
--row=number
(20 bytes off of total) - Can parse any size file as long as #rows = #columns (40 bytes off of total)
XML File:
<table>
<tr>
<th>Foo</th>
<th>Bar</th>
<th>Baz</th>
<th>Cat</th>
<th>Dog</th>
<th>Grinch</th>
</tr>
<tr>
<th>Something</th>
<th>Something</th>
<th>Darkside</th>
<th>Star</th>
<th>Wars</th>
<th>Chicken</th>
</tr>
<tr>
<th>Star</th>
<th>Trek</th>
<th>Xbox</th>
<th>Words</th>
<th>Too</th>
<th>Many</th>
</tr>
<tr>
<th>Columns</th>
<th>Not</th>
<th>Enough</th>
<th>Words</th>
<th>To</th>
<th>Fill</th>
</tr>
<tr>
<th>Them</th>
<th>So</th>
<th>I</th>
<th>Will</th>
<th>Do</th>
<th>My</th>
</tr>
<tr>
<th>Best</th>
<th>To</th>
<th>Fill</th>
<th>Them</th>
<th>All</th>
<th>Up</th>
</tr>
</table>