forked from OpenBMB/ChatDev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MazeGame upload
- Loading branch information
Showing
10 changed files
with
3,767 additions
and
0 deletions.
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
WareHouse/Maze_THUNLP_20231006154305/ChatChainConfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"chain": [ | ||
{ | ||
"phase": "DemandAnalysis", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": -1, | ||
"need_reflect": "True" | ||
}, | ||
{ | ||
"phase": "LanguageChoose", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": -1, | ||
"need_reflect": "True" | ||
}, | ||
{ | ||
"phase": "Coding", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
}, | ||
{ | ||
"phase": "CodeCompleteAll", | ||
"phaseType": "ComposedPhase", | ||
"cycleNum": 10, | ||
"Composition": [ | ||
{ | ||
"phase": "CodeComplete", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
] | ||
}, | ||
{ | ||
"phase": "CodeReview", | ||
"phaseType": "ComposedPhase", | ||
"cycleNum": 3, | ||
"Composition": [ | ||
{ | ||
"phase": "CodeReviewComment", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
}, | ||
{ | ||
"phase": "CodeReviewModification", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
] | ||
}, | ||
{ | ||
"phase": "Test", | ||
"phaseType": "ComposedPhase", | ||
"cycleNum": 3, | ||
"Composition": [ | ||
{ | ||
"phase": "TestErrorSummary", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
}, | ||
{ | ||
"phase": "TestModification", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
] | ||
}, | ||
{ | ||
"phase": "EnvironmentDoc", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "True" | ||
}, | ||
{ | ||
"phase": "Manual", | ||
"phaseType": "SimplePhase", | ||
"max_turn_step": 1, | ||
"need_reflect": "False" | ||
} | ||
], | ||
"recruitments": [ | ||
"Chief Executive Officer", | ||
"Counselor", | ||
"Chief Human Resource Officer", | ||
"Chief Product Officer", | ||
"Chief Technology Officer", | ||
"Programmer", | ||
"Code Reviewer", | ||
"Software Test Engineer", | ||
"Chief Creative Officer" | ||
], | ||
"clear_structure": "True", | ||
"brainstorming": "False", | ||
"gui_design": "True", | ||
"git_management": "False", | ||
"self_improve": "False" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"Chief Executive Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Executive Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"Your main responsibilities include being an active decision-maker on users' demands and other key policy issues, leader, manager, and executor. Your decision-making role involves high-level decisions about policy and strategy; and your communicator role can involve speaking to the organization's management and employees.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs." | ||
], | ||
"Chief Product Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Product Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You are responsible for all product-related matters in ChatDev. Usually includes product design, product strategy, product vision, product innovation, project management and product marketing.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Counselor": [ | ||
"{chatdev_prompt}", | ||
"You are Counselor. Now, we share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"Your main responsibilities include asking what user and customer think and provide your valuable suggestions. ", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs." | ||
], | ||
"Chief Technology Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Technology Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You are very familiar to information technology. You will make high-level decisions for the overarching technology infrastructure that closely align with the organization's goals, while you work alongside the organization's information technology (\"IT\") staff members to perform everyday operations.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, You must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Chief Human Resource Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Human Resource Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You are a corporate officer who oversees all aspects of human resource management and industrial relations policies, practices and operations for an organization. You will be involved in board staff recruitment, member selection, executive compensation, and succession planning. Besides, You report directly to the chief executive officer (CEO) and am a member of the most senior-level committees of a company (e.g., executive committee or office of CEO).", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Programmer": [ | ||
"{chatdev_prompt}", | ||
"You are Programmer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You can write/create computer software or applications by providing a specific programming language to the computer. You have extensive computing and coding experience in many varieties of programming languages and platforms, such as Python, Java, C, C++, HTML, CSS, JavaScript, XML, SQL, PHP, etc,.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Code Reviewer": [ | ||
"{chatdev_prompt}", | ||
"You are Code Reviewer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You can help programmers to assess source codes for software troubleshooting, fix bugs to increase code quality and robustness, and offer proposals to improve the source codes.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Software Test Engineer": [ | ||
"{chatdev_prompt}", | ||
"You are Software Test Engineer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You can use the software as intended to analyze its functional properties, design manual and automated test procedures to evaluate each software product, build and implement software evaluation test programs, and run test programs to ensure that testing protocols evaluate the software correctly.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
], | ||
"Chief Creative Officer": [ | ||
"{chatdev_prompt}", | ||
"You are Chief Creative Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.", | ||
"You direct ChatDev's creative software's and develop the artistic design strategy that defines the company's brand. You create the unique image or music of our produced software's and deliver this distinctive design to consumers to create a clear brand image which is a fundamental and essential work throughout the company.", | ||
"Here is a new customer's task: {task}.", | ||
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs." | ||
] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
''' | ||
This is the main file of the maze game application. | ||
''' | ||
import tkinter as tk | ||
from maze import Maze | ||
class MazeGameApp(tk.Tk): | ||
def __init__(self): | ||
super().__init__() | ||
self.title("Maze Game") | ||
self.geometry("400x400") | ||
self.maze = Maze() | ||
self.canvas = tk.Canvas(self, width=400, height=400) | ||
self.canvas.pack() | ||
self.draw_maze() | ||
self.bind("<KeyPress>", self.move_player) | ||
self.game_over = False | ||
def draw_maze(self): | ||
for row in range(self.maze.rows): | ||
for col in range(self.maze.cols): | ||
if self.maze.maze[row][col] == 1: | ||
self.canvas.create_rectangle(col*40, row*40, (col+1)*40, (row+1)*40, fill="black") | ||
def move_player(self, event): | ||
if not self.game_over: | ||
if event.keysym == "Up": | ||
self.maze.move_player("up") | ||
elif event.keysym == "Down": | ||
self.maze.move_player("down") | ||
elif event.keysym == "Left": | ||
self.maze.move_player("left") | ||
elif event.keysym == "Right": | ||
self.maze.move_player("right") | ||
self.canvas.delete("player") | ||
self.canvas.create_oval(self.maze.player_col*40, self.maze.player_row*40, (self.maze.player_col+1)*40, (self.maze.player_row+1)*40, fill="red", tags="player") | ||
if self.maze.player_row == self.maze.goal_row and self.maze.player_col == self.maze.goal_col: | ||
self.canvas.create_text(200, 200, text="Congratulations! You have reached the goal!", font=("Arial", 16), fill="white") | ||
self.game_over = True | ||
if __name__ == "__main__": | ||
app = MazeGameApp() | ||
app.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Maze Game User Manual | ||
|
||
## Introduction | ||
Welcome to the Maze Game! This user manual will guide you through the installation process and explain how to play the game. | ||
|
||
## Installation | ||
To install the Maze Game, please follow the steps below: | ||
|
||
1. Make sure you have Python installed on your computer. If not, you can download it from the official Python website (https://www.python.org/downloads/). | ||
|
||
2. Open a terminal or command prompt and navigate to the directory where you have saved the `main.py` and `maze.py` files. | ||
|
||
3. Install the required dependencies by running the following command: | ||
``` | ||
pip install tkinter | ||
``` | ||
|
||
4. Once the installation is complete, you are ready to play the Maze Game! | ||
|
||
## How to Play | ||
To play the Maze Game, follow these instructions: | ||
|
||
1. Open a terminal or command prompt and navigate to the directory where you have saved the `main.py` and `maze.py` files. | ||
|
||
2. Run the following command to start the game: | ||
``` | ||
python main.py | ||
``` | ||
|
||
3. A new window will open with the Maze Game interface. | ||
|
||
4. The objective of the game is to navigate the player (represented by a red oval) from the top-left corner to the bottom-right corner of the maze. | ||
|
||
5. Use the arrow keys on your keyboard to move the player up, down, left, or right. | ||
|
||
6. Avoid the black walls in the maze. If the player collides with a wall, it cannot pass through. | ||
|
||
7. Once you reach the goal (bottom-right corner), a message will be displayed on the screen congratulating you. | ||
|
||
8. To play again, close the game window and run the `main.py` file again. | ||
|
||
## Conclusion | ||
Congratulations! You have successfully installed and played the Maze Game. Enjoy navigating through the maze and have fun! If you have any questions or need further assistance, please refer to the documentation or contact our support team. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
please design a maze game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
''' | ||
This file contains the Maze class that represents the maze in the game. | ||
''' | ||
import random | ||
import tkinter as tk | ||
class Maze: | ||
def __init__(self): | ||
self.rows = 10 | ||
self.cols = 10 | ||
self.maze = [[0] * self.cols for _ in range(self.rows)] | ||
self.player_row = 0 | ||
self.player_col = 0 | ||
self.goal_row = self.rows - 1 | ||
self.goal_col = self.cols - 1 | ||
self.generate_maze() | ||
def generate_maze(self): | ||
# Generate a random maze | ||
for row in range(self.rows): | ||
for col in range(self.cols): | ||
if random.random() < 0.3: | ||
self.maze[row][col] = 1 | ||
def move_player(self, direction): | ||
if direction == "up" and self.player_row > 0 and self.maze[self.player_row-1][self.player_col] != 1: | ||
self.player_row -= 1 | ||
elif direction == "down" and self.player_row < self.rows-1 and self.maze[self.player_row+1][self.player_col] != 1: | ||
self.player_row += 1 | ||
elif direction == "left" and self.player_col > 0 and self.maze[self.player_row][self.player_col-1] != 1: | ||
self.player_col -= 1 | ||
elif direction == "right" and self.player_col < self.cols-1 and self.maze[self.player_row][self.player_col+1] != 1: | ||
self.player_col += 1 | ||
if self.player_row == self.goal_row and self.player_col == self.goal_col: | ||
print("Congratulations! You have reached the goal!") |
Oops, something went wrong.