I am running simulations for the game Baccarat. I am wondering if there is a way to plot the "roads", like on this website:
For example, I'd like to plot the following list:
list = {"B", "B", "B", "B", "P", "T", "B", "B", "P", "B", "P", "B", "P","P", "P", "P", "P", "T", "T", "P", "P", "P"}
The rules for generating a road are the following:
- The road starts at the top left corner
- A "B" should be represented by a blue circle
- A "P" should be represented by a red circle
- If the previous letter was a "B" and the new letter is "P", or vice-versa, we start anew at the top of a new column. Otherwise, we stack circles in a path going downwards along its column.
- If the path reaches the sixth row then it changes direction and starts moving to the right instead of downwards.
- A "T" should not add any circle to the path but should be marked by a green line on the most recently added circle.
The blue dots and yellow circles have to do with other aspects of the game which are not reflected in the list, so they can be ignored for the purpose of this question.
Is there an easy way to plot such trace?