@@ -16,17 +16,17 @@ func NewRenderer() *Renderer {
1616// RenderGrid converts the grid state to a visual string representation.
1717func (r *Renderer) RenderGrid(grid *Grid) string {
1818 var output strings.Builder
19-
19+
2020 output.WriteString("\n```\n") // Start code block for proper monospace rendering
21-
21+
2222 // Grid header with column letters (A-T for 20 columns)
2323 output.WriteString(" ")
2424 for x := 0; x < GRID_WIDTH; x++ {
2525 letter := string(rune('A' + x)) // Convert to A, B, C, D...
2626 output.WriteString(letter + " ")
2727 }
2828 output.WriteString("\n")
29-
29+
3030 // Grid content
3131 for y := 0; y < GRID_HEIGHT; y++ {
3232 // Row number with proper spacing
@@ -35,7 +35,7 @@ func (r *Renderer) RenderGrid(grid *Grid) string {
3535 } else {
3636 output.WriteString(strconv.Itoa(y) + " ")
3737 }
38-
38+
3939 // Cells with spaces between them
4040 for x := 0; x < GRID_WIDTH; x++ {
4141 if grid.GetCell(x, y) {
@@ -46,16 +46,16 @@ func (r *Renderer) RenderGrid(grid *Grid) string {
4646 }
4747 output.WriteString("\n")
4848 }
49-
49+
5050 output.WriteString("```\n") // End code block
51-
51+
5252 return output.String()
5353}
5454
5555// RenderHelp generates the help/action text including available commands and patterns.
5656func (r *Renderer) RenderHelp(patternManager *PatternManager) string {
5757 var output strings.Builder
58-
58+
5959 output.WriteString("Actions:\n")
6060 output.WriteString("* [NewGame](conway$help&func=NewGame) - Start a new game\n")
6161 output.WriteString("* [Step](conway$help&func=Step) - Advance one generation (high gas usage!)\n")
@@ -65,7 +65,7 @@ func (r *Renderer) RenderHelp(patternManager *PatternManager) string {
6565 output.WriteString("* [LoadPattern](conway$help&func=LoadPattern) pattern x y - Load pattern using numeric coordinates\n")
6666 output.WriteString("* [LoadPatternAt](conway$help&func=LoadPatternAt) pattern coordinate - Load pattern using letter coordinates\n")
6767 output.WriteString("* [Clear](conway$help&func=Clear) - Clear the grid\n\n")
68-
68+
6969 output.WriteString("Example commands (use --broadcast for single-step execution):\n")
7070 output.WriteString("```\n")
7171 output.WriteString("# Start new game\n")
@@ -77,7 +77,7 @@ func (r *Renderer) RenderHelp(patternManager *PatternManager) string {
7777 output.WriteString("# Set cell at (5,5) to alive (using numeric coordinates)\n")
7878 output.WriteString("gnokey maketx call -pkgpath \"gno.land/r/demo/games/conway\" -func \"SetCell\" -args \"5\" -args \"5\" -args \"true\" -gas-fee 1000000ugnot -gas-wanted 5000000 -send \"\" --broadcast ADDRESS\n")
7979 output.WriteString("```\n\n")
80-
80+
8181 // List available patterns
8282 patterns := patternManager.GetAvailablePatterns()
8383 output.WriteString("Available patterns: ")
@@ -88,6 +88,6 @@ func (r *Renderer) RenderHelp(patternManager *PatternManager) string {
8888 output.WriteString(pattern)
8989 }
9090 output.WriteString("\n\n")
91-
91+
9292 return output.String()
93- }
93+ }
0 commit comments