-
Notifications
You must be signed in to change notification settings - Fork 1
/
textmode.go
64 lines (52 loc) · 1.26 KB
/
textmode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package main
// NOTE: this file can probably be deleted. input/output in text mode
/*
func describe_wind_direction(g *Game) string {
if g.wind < 0 {
return "west"
} else {
return "east"
}
}
func capture_angle(angle *int) bool {
fmt.Scanln(angle)
if *angle < 0 || *angle > 90 {
fmt.Println("Angle must be between 0 and 90. Please try again.")
return false
} else {
return true
}
}
func capture_velocity(velocity *int) bool {
fmt.Scanln(velocity)
if *velocity < 1 || *velocity > 200 {
fmt.Println("Velocity must be between 1 and 200. Please try again.")
return false
} else {
return true
}
}
func turn(p *player) {
var angle, velocity int
fmt.Printf("%s's turn!\n", p.name)
fmt.Println("Enter an angle between 0 and 90: ")
for {
if capture_angle(&angle) {
break
}
}
fmt.Println("Enter a velocity between 1 and 200: ")
for {
if capture_velocity(&velocity) {
break
}
}
fmt.Printf("Firing at an angle of %d and a velocity of %d...\n",angle, velocity)
}
func capture_player_name(number int) string {
var name_input string
fmt.Printf("Enter player %d name: ", number)
fmt.Scanln(&name_input)
return name_input
}
*/