Commit 1f09dfe0 authored by Derek Schaab's avatar Derek Schaab

Tweak ASCII output

parent 3bce22aa
......@@ -12,7 +12,6 @@ func WriteASCII(w io.Writer, g chess.Game, o Options) (err error) {
f := s.File()
if s == chess.A8 {
dst.write(asciiTopRow)
dst.writeByte(byte(g.ToMove.Color().Rune()))
dst.write(newline)
} else if f == 'a' {
dst.write(asciiInterRow)
......@@ -20,6 +19,8 @@ func WriteASCII(w io.Writer, g chess.Game, o Options) (err error) {
}
if f == 'a' {
dst.writeByte(byte(s.Rank()))
dst.write(space)
dst.write(asciiDoubleVertical)
} else {
dst.write(asciiSingleVertical)
}
......@@ -44,6 +45,9 @@ func WriteASCII(w io.Writer, g chess.Game, o Options) (err error) {
}
dst.write(asciiBottomRow)
dst.write(newline)
dst.writeByte(byte(g.ToMove.Color().Rune()))
dst.write(asciiFiles)
dst.write(newline)
err = dst.err
return
}
......@@ -55,9 +59,10 @@ type asciiWriter struct {
}
var (
asciiTopRow = []byte("╔═══╤═══╤═══╤═══╤═══╤═══╤═══╤═══")
asciiInterRow = []byte("╟───┼───┼───┼───┼───┼───┼───┼───╢")
asciiBottomRow = []byte("╚═a═╧═b═╧═c═╧═d═╧═e═╧═f═╧═g═╧═h═╝")
asciiTopRow = []byte(" ╔═══╤═══╤═══╤═══╤═══╤═══╤═══╤═══╗")
asciiInterRow = []byte(" ╟───┼───┼───┼───┼───┼───┼───┼───╢")
asciiBottomRow = []byte(" ╚═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╝")
asciiFiles = []byte(" a b c d e f g h ")
asciiSingleVertical = []byte("│")
asciiDoubleVertical = []byte("║")
space = []byte(" ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment