Skip to content

Commit 4e0e4c0

Browse files
committed
Ninja level 1 solutions
1 parent b9f9822 commit 4e0e4c0

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package main
2+
3+
import "fmt"
4+
5+
var x int = 42
6+
var y string = "James Bond"
7+
var z bool = true
8+
9+
type abk_int int
10+
type hotdog int
11+
12+
var x_myint abk_int
13+
14+
func main() {
15+
16+
// exercise3()
17+
// exercise4()
18+
exercise5()
19+
20+
}
21+
22+
func exercise3() {
23+
24+
s := fmt.Sprintf("%d %s %t",x,y,z)
25+
fmt.Println(s)
26+
}
27+
28+
func exercise4() {
29+
fmt.Printf("%d %T\n",x_myint,x_myint)
30+
x_myint = abk_int(100)
31+
32+
fmt.Printf("%d %T\n",x_myint,x_myint)
33+
}
34+
35+
func exercise5() {
36+
fmt.Printf("%d %T\n",x_myint,x_myint)
37+
x_myint = abk_int(100)
38+
fmt.Printf("%d %T\n",x_myint,x_myint)
39+
40+
x = int(x_myint)
41+
fmt.Printf("%d %T\n",x, x)
42+
43+
}

0 commit comments

Comments
 (0)