Advertisement
Spocoman

Illuminati Lock

Oct 10th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.75 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "strings"
  6. )
  7.  
  8. func main() {
  9.     var n int
  10.     fmt.Scanln(&n)
  11.    
  12.     fmt.Printf("%s%s%s\n", strings.Repeat(".", n), strings.Repeat("#", n), strings.Repeat(".", n))
  13.  
  14.     for i := 0; i < n - 1; i += 2 {
  15.         fmt.Printf("%s##%s#%s#%s##%s\n", strings.Repeat(".", n - i - 2), strings.Repeat(".", i), strings.Repeat(".", n - 2), strings.Repeat(".", i), strings.Repeat(".", n - i - 2))
  16.     }
  17.  
  18.     for i := n - 3; i >= 0; i -= 2 {
  19.         fmt.Printf("%s##%s#%s#%s##%s\n", strings.Repeat(".", n - i - 2), strings.Repeat(".", i), strings.Repeat(".", n - 2), strings.Repeat(".", i), strings.Repeat(".", n - i - 2))
  20.     }
  21.  
  22.     fmt.Printf("%s%s%s\n", strings.Repeat(".", n), strings.Repeat("#", n), strings.Repeat(".", n))
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement