huangeddie / GymGo

An environment of the board game Go using OpenAI's Gym API
165 stars 31 forks source link

UI improvement #14

Closed Centauria closed 2 years ago

Centauria commented 2 years ago

Use unicode box-drawing characters to render square board in terminal. Attention: please use monospace font to ensure the effect.

image
huangeddie commented 2 years ago

Hi Centauria. Thanks so much your contribution! I like the replacement of letters with colored dots, and that they're on the intersection of lines like in real Go boards. However I think this has some issues.

  1. This should be at least be compatible with the default Mac terminal font (Menlo) and the Linux terminal font (Ubuntu Mono)
  2. The Black/White Area values should be integer format, not floating point
  3. Last Turn Passed and Game Over should be the same type format (i.e. either both boolean or both integer). I'd prefer boolean. Another alternative would be to convert this to more human readable formats. For example for "game over", we could toggle between the texts "Game ongoing" and "Game over", or display "Game over" when the game ends and display nothing when it's ongoing.
  4. The double digits on the x-axis are too close too each other. I wonder if it's possible to fix that by increasing the square lengths by another line. I know that may make things too big or out of proportion with your circle pieces though.

I haven't had the time to run this PR myself yet. I can take a closer look later.

Centauria commented 2 years ago
  1. Tested in macOS 11.6.3
  2. All text after the board is identical to the original one. I didn't change any code of this part.
  3. [Same as 2]
  4. Generally, we don't have to consider row number >= 100, so 2-digit string is enough. And if we need a square board, we must have 2 chars to form a row, so the row number > 9 will be the same width of the board row. If we want to enlarge it by 2, the 19x19 board will not be able to show properly in some narrow terminals.
huangeddie commented 2 years ago

Thanks for your response! I also took a look at it, and I like the new changes. Thanks again Centauria!