add: unfinished code. people are having problems
This commit is contained in:
28
14-arrays/06-compare-unnamed/main.go
Normal file
28
14-arrays/06-compare-unnamed/main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
// STORY:
|
||||
// You want to compare two bookcases,
|
||||
// whether they're equal or not.
|
||||
|
||||
func main() {
|
||||
type (
|
||||
bookcase [5]int
|
||||
cabinet [5]int
|
||||
)
|
||||
|
||||
blue := bookcase{6, 9, 3, 2, 1}
|
||||
red := cabinet{6, 9, 3, 2, 1}
|
||||
|
||||
fmt.Print("Are they equal? ")
|
||||
|
||||
if cabinet(blue) == red {
|
||||
fmt.Println("✅")
|
||||
} else {
|
||||
fmt.Println("❌")
|
||||
}
|
||||
|
||||
fmt.Printf("blue: %#v\n", blue)
|
||||
fmt.Printf("red : %#v\n", bookcase(red))
|
||||
}
|
||||
Reference in New Issue
Block a user