-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharraygame.cpp
More file actions
62 lines (46 loc) · 897 Bytes
/
arraygame.cpp
File metadata and controls
62 lines (46 loc) · 897 Bytes
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
// arrays example
#include <iostream>
using namespace std;
int foo[] = { 16, 2, 77, 40, 12071 };
int n, result = 0;
enum PlayerStatus {
PS_Crouched,
PS_Standing,
PS_Running,
PS_Sprinting
};
enum HemStatus {
Is_PickedUp = 1,
Is_Dropped,
Is_Equipped
};
enum GameState { GS_Paused, GS_Play };
enum Currency {
Copper = 1,
Silver = 100,
Gold = 1000
};
int main()
{
for (n = 0; n < 5; ++n)
{
result += foo[n];
}
cout << result;
cout << endl;
for (int i = 0; i < 20; i++) {
cout << "*";
}
cout << endl;
// int arr[] = { 1,5 }; also works fine
int arr[] = { {1},{5} };
for (int i = 0; i < 2; i++) {
cout << arr[i]<<endl;
}
PlayerStatus status;
status = PS_Crouched;
if (status == PS_Crouched)
{
cout << " The Player is Crouching! ";
}
}