Advertisement
Guest User

Code 3

a guest
Jun 16th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.39 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func hasBlock(x, y int) bool {
  8.     if x < 0 || x >= 1 {
  9.         return false
  10.     }
  11.     return true
  12. }
  13.  
  14. func main() {
  15.     ok := false
  16.  
  17.     for x := 0; x < 1; x++ {
  18.         for y := 0; y < 1; y++ {
  19.             if !hasBlock(x - 1, y) {
  20.                 ok = true
  21.             } else {
  22.                 fmt.Println(x, y, hasBlock(-1, 0), hasBlock(x - 1, y))
  23.             }
  24.         }
  25.     }
  26.  
  27.     if !ok {
  28.         fmt.Println("A bug?")
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement