I think everyone is familiar with the game of snakes & ladders1. Imagine we have a 10x10 board like this:
=============================================================
| | | | | | | | | | |
| 100 | 99 | 98 | 97 | 96 | 95 | 94 | 93 | 92 | 91 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 80 | 79 | 78 | 77 | 76 | 75 | 74 | 73 | 72 | 71 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 60 | 59 | 58 | 57 | 56 | 55 | 54 | 53 | 52 | 51 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 40 | 39 | 38 | 37 | 36 | 35 | 34 | 33 | 32 | 31 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
| | | | | | | | | | |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
=============================================================
The task is to (sort of) paint a ladder on this board from a smaller number to a bigger one. Kind of an ASCII art using these characters /\ | _
only.
The board's dimensions are 61x31 characters fixed like above. To illustrate the task, let's draw some ladders e.g. from 7 to 31, 22 to 77, 54 to 96, and 68 to 89 like this:
=============================================================
| | | | | | | | | | |
| 100 | 99 | 98 | 97 | 96 | 95 | 94 | 93 | 92 | 91 |
------+-----+-----+-----+-\_\-+-----+-----+-----+-----+------
| | | | | \_\| | | | | |
| 81 | 82 | 83 | 84 | 85\_\ 86 | 87 | 88 | 89 | 90 |
------+-----+-----+-----+----\_\----+-----+-----+/_/--+------
| | | | | \_\ | | /_/ | |
| 80 | 79 | 78 | 77 | 76 |\_\ | 74 | 73 /_/72 | 71 |
------+-----+-----+/_/--+-----+-\_\-+-----+---/_/-----+------
| | | /_/ | | \_\| | /_/| | |
| 61 | 62 | 63 /_/64 | 65 | 66\_\ 67 | / / | 69 | 70 |
------+-----+---/_/-----+-----+----\_\----+-----+-----+------
| | | /_/| | | \_\ | | | |
| 60 | 59 | /_/ | 57 | 56 | 55 |\ \ | 53 | 52 | 51 |
------+-----+/_/--+-----+-----+-----+-----+-----+-----+------
| | /_/ | | | | | | | |
| 41 | 42 /_/43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
------+---/_/-----+-----+-----+-----+-----+-----+-----+------
| | /_/| | | | | | | | |
| 40 | /_/ | 38 | 37 | 36 | 35 | 34 | 33 | 32 | 31 |
------+-|_|-+-----+-----+-----+-----+-----+-----+-----+/_/---
| | |_| | | | | | | | /_/ |
| 21 | | | | 23 | 24 | 25 | 26 | 27 | 28 | 29 /_/30 |
------+-----+-----+-----+-----+-----+-----+-----+---/_/------
| | | | | | | | | /_/| |
| 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | /_/ | 11 |
------+-----+-----+-----+-----+-----+-----+-----+/_/--+------
| | | | | | | __________/_/ | |
| 1 | 2 | 3 | 4 | 5 | 6 | _________/_/9 | 10 |
=============================================================
Challenge
Given the two distinct numbers that are both in the range of 1..100
, draw a ladder from the smaller number to the bigger one, assuming that their arrangements and positions are fixed like above. You are not required to print the whole table. Only the ladder would suffice, but it must be placed in the right position on a 31x
61 ASCII sheet.
Note that sometimes the ladder has two parts, i.e. direct (horizontal or vertical) and slant. The direct part must always come first.
Rules
Standard code-golf rules apply. If any clarifications or more rules are needed, please inform me in the comments. Happy golfing!
1. In case you have never heard of it (which would be really odd), please refer to the linked Wikipedia article. I skipped elaborating the game rules for the sake of brevity and being on topic.