update,
This commit is contained in:
124
task1/_docs/draft.md
Normal file
124
task1/_docs/draft.md
Normal file
@@ -0,0 +1,124 @@
|
||||
### Player VS Computer
|
||||
|
||||
1. game mode select
|
||||
2. player vs computer
|
||||
3. player login (username and password)
|
||||
4. Game run (player vs computer)
|
||||
5. Game finish
|
||||
6. Show ranking
|
||||
7. Back to start
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A[Game Mode Select] --> B[Player vs Computer];
|
||||
B --> C["Player Login (Username and Password)"];
|
||||
C --> D["Game Run (Player vs Computer)"];
|
||||
D --> E[Game Finish];
|
||||
E --> F[Show Ranking?];
|
||||
F --> H[show ranking to user];
|
||||
H --> G[Back to Start];
|
||||
F --> G[Back to Start];
|
||||
```
|
||||
|
||||
### Player VS Player
|
||||
|
||||
1. game mode select
|
||||
2. player vs computer
|
||||
3. player1 login (username and password)
|
||||
3. player2 login (username and password)
|
||||
4. Game run (player vs computer)
|
||||
5. Game finish
|
||||
6. Show ranking
|
||||
7. Back to start
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A[Start] --> B[Game Mode Select];
|
||||
B --> C[Player VS Computer];
|
||||
C --> D["Player1 Login (username and password)"];
|
||||
D --> E["Player2 Login (username and password)"];
|
||||
E --> F["Game Run (Player VS Computer)"];
|
||||
F --> G[Game Finish];
|
||||
G --> H[Show Ranking?];
|
||||
H --> J[show ranking to user];
|
||||
H --> I[Back to Start];
|
||||
J --> I;
|
||||
I --> A;
|
||||
```
|
||||
|
||||
### show ranking
|
||||
|
||||
1. read ranking
|
||||
2. show to user
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A[Start] --> B[Read Ranking];
|
||||
B --> C[Show Ranking to User];
|
||||
C --> D[End];
|
||||
```
|
||||
|
||||
### change password
|
||||
|
||||
1. open password file `ac.txt`
|
||||
2. read passwords
|
||||
3. find current user
|
||||
4. change password when username match
|
||||
5. save to file
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A[Start] --> B["Open Password File ac.txt"];
|
||||
B --> C[Read Passwords];
|
||||
C --> D[Find Current User];
|
||||
D -->|Username Match| E[Change Password];
|
||||
D -->|Username Not Found| F[Display Error Message];
|
||||
E --> G[Save to File];
|
||||
G --> H[End];
|
||||
F --> H[End];
|
||||
```
|
||||
|
||||
|
||||
### create player
|
||||
|
||||
1. get username and password from user
|
||||
2. check if username or password is empty
|
||||
3. show missing to user if empty
|
||||
4. username and password ok
|
||||
5. write to account file
|
||||
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A[Start] --> B[Get Username and Password from User];
|
||||
B --> C[Check if Username or Password is Empty];
|
||||
C -->|Username or Password is Empty| D[Show Missing Fields to User];
|
||||
C -->|Username and Password are Not Empty| E[Write to Account File];
|
||||
D --> F[End];
|
||||
E --> F[End];
|
||||
```
|
||||
|
||||
|
||||
### delete player
|
||||
|
||||
1. open password file `ac.txt`
|
||||
2. read username
|
||||
3. if username found in file
|
||||
4. delete user
|
||||
5. write change to file
|
||||
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A[Start] --> B["Open Password File ac.txt"];
|
||||
B --> C[Read Username];
|
||||
C --> D[Username Found in File?];
|
||||
D -->|Yes| E[Delete User];
|
||||
D -->|No| F[Display Error Message];
|
||||
E --> G[Write Changes to File];
|
||||
G --> H[End];
|
||||
F --> H[End];
|
||||
A@{ shape: circle}
|
||||
H@{ shape: circle}
|
||||
D@{ shape: diamond }
|
||||
```
|
Reference in New Issue
Block a user