blob: 15077fa34be42230f13101a78c10902c206a3339 [file] [log] [blame]
// +build ignore,OMIT
package main
import (
"bytes"
"fmt"
)
type Point struct {
X, Y int
}
type Rectangle struct {
Min, Max Point
}
func (r Rectangle) String() string { // HL
var buf bytes.Buffer
for h := 0; h < r.Max.Y-r.Min.Y; h++ {
for w := 0; w < r.Max.X-r.Min.X; w++ {
buf.WriteString("#")
}
buf.WriteString("\n")
}
return buf.String()
}
func main() {
r := Rectangle{Max: Point{20, 5}}
s := r.String() // HL
fmt.Println(s)
}
// EOF OMIT