-
Notifications
You must be signed in to change notification settings - Fork 0
/
fort.go
57 lines (45 loc) · 759 Bytes
/
fort.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
package main
import (
"fmt"
"math"
)
// ***STOPPING AT FORT***
//
// 2290
func fort() {
fmt.Println("ENTER WHAT YOU WISH TO SPEND ON THE FOLLOWING")
// 2300
fmt.Print("FOOD ")
fortSubRoutine()
F = F + 2/3.0*P
// 2420
fmt.Print("AMMUNITION ")
fortSubRoutine()
B = math.Floor(B + 2/3.0*P*50)
// 2450
fmt.Print("CLOTHING ")
fortSubRoutine()
C = C + 2/3.0*P
// 2480
fmt.Print("MISCELLANEOUS SUPPLIES")
fortSubRoutine()
M1 = M1 + 2/3.0*P
M = M - 45
// 2520
beforeEating() // 2720
}
// 2330
func fortSubRoutine() {
input(&P)
if P < 0 {
return
}
T = T - P
if T >= 0 {
return
}
fmt.Println("YOU DON'T HAVE THAT MUCH--KEEP YOUR SPENDING DOWN")
fmt.Println("YOU MISS YOUR CHANCE TO SPEND ON THAT ITEM")
T = T + P
P = 0
}