Skip to content

Instantly share code, notes, and snippets.

@vxcute
Last active February 1, 2023 05:29
Show Gist options
  • Select an option

  • Save vxcute/aa28cb46ed39c2b2099e84d09bf8491d to your computer and use it in GitHub Desktop.

Select an option

Save vxcute/aa28cb46ed39c2b2099e84d09bf8491d to your computer and use it in GitHub Desktop.
package main
import "fmt"
func draw(w, h int) {
for i := 0; i < h; i++ {
if i % 2 == 0 {
for i := 0; i < w - 2; i++ {
for i := 0; i < w; i++ {
for j := 0; j < w; j++ {
fmt.Print("*")
}
for j := 0; j < w; j++ {
fmt.Print(" ")
}
}
fmt.Print("\n")
}
} else {
for i := 0; i < w - 2; i++ {
for i := 0; i < w - 1; i++ {
for j := 0; j < w ; j++ {
fmt.Print(" ")
}
for j := 0; j < w; j++ {
fmt.Print("*")
}
}
fmt.Print("\n")
}
}
}
}
func main() {
/*
***** ***** ***** ***** *****
***** ***** ***** ***** *****
***** ***** ***** ***** *****
***** ***** ***** *****
***** ***** ***** *****
***** ***** ***** *****
***** ***** ***** ***** *****
***** ***** ***** ***** *****
***** ***** ***** ***** *****
***** ***** ***** *****
***** ***** ***** *****
***** ***** ***** *****
***** ***** ***** ***** *****
***** ***** ***** ***** *****
***** ***** ***** ***** *****
*/
draw(5,5)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment