I was just playing the board game Sorry! with some people, and I realized that I could base a few interesting challenges off of it. This one is pretty simple.
You task is simply to output an ascii-art version of a sorry board, placing pieces where I tell you to.
Specs
First, here is an image of an actual Sorry! board for reference:
The empty board looks like:
# > - - o # # # # > - - - o # #
# # S v
o # H # # # # # |
| # |
| # S o
| # #
^ H #
# #
# #
# H v
# # |
o S # |
| # |
| # # # # # H # o
^ S # #
# # o - - - < # # # # o - - < #
Notice a few features.
- The
#
's are empty squares. - The
S
's andH
's are Start's and Home's respectively. - The
>v<^
's are the start of the slides, depending on which direction they face. - The
|
's and-
's are the middles of slides, depending on if they're horizontal or vertical. - The
o
's are the end's of slides. - Each column is separated by a column of spaces to make it look more square-like.
Now here is what you have to do:
- Your input is a list of coordinates of various pieces that have been placed on the board.
- The coordinates start at
0
at the square outside the Start of the bottom color (yellow in the picture), and increase by one per square clockwise. - After these 60 squares, the safe zones have the next and last 20 coordinates, starting from the one on the bottom (which gets 60-64), then going clockwise.
- You will have to place star's(
*
's) on the correct coordinate, replacing the character underneath for all players. - Additionally, if any of the players are on the start square of a slider, move them to the end of the slider before placing them.
- You can assume that there will be no collisions, before or after resolving sliders.
- You con't need to worry about the Home's or Start's.
- You can be 1-indexed if you want, but the test cases are 0-indexed.
Test Cases
[0, 20] ->
# > - - o # # # # > - - - o # #
# # S v
* # H # # # # # |
| # |
| # S o
| # #
^ H #
# #
# #
# H v
# # |
o S # |
| # |
| # # # # # H # o
^ S # #
# # o - - - < # # # # * - - < #
[2, 7, 66] ->
# > - - o # # # # > - - - o # #
# # S v
o # H # # # # # |
| # |
| # S o
| # #
^ H #
# #
# #
# H v
# # |
o S # |
| # |
| # * # # # H # o
^ S # #
# # o - * - < # # * # o - - < #
0, 5
and the second might be2, 60, 37
). \$\endgroup\$