Last active
February 1, 2023 05:29
-
-
Save vxcute/aa28cb46ed39c2b2099e84d09bf8491d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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