Merge branch 'main' of github.com:wyifei26/ChatDev

This commit is contained in:
wyifei26 2023-11-02 19:37:04 +08:00
commit dcea26c8d8
21 changed files with 6425 additions and 37 deletions

View File

@ -1,5 +1,5 @@
Task:
[Write a Python program that generates company business card.Your program should accept name,title and email information entered by the user. Then, the designed business card image should contain these three pieces of information.I hope there will be a unified slogan in the lower right corner of the business card: AGI For Lives and there here is a company name in the upper right corner: ModelBest. Finally, the program should save the business card image to a file, allowing the user to specify the file name and format (e.g., PNG, JPG).Make sure to provide a user-friendly interface that guides the user through the process of inputting the data and specifying the file name and format for the business card image. Test your program with various inputs to ensure it generates valid business card and handles different data types gracefully.]
[Write a Python program that generates company business card.Your program should accept name, title and email information entered by the user. Then, the designed business card image should contain these three pieces of information. I hope there will be a unified slogan in the lower right corner of the business card: AGI For Lives and there here is a company name in the upper right corner: ModelBest. Finally, the program should save the business card image to a file, allowing the user to specify the file name and format (e.g., PNG, JPG).Make sure to provide a user-friendly interface that guides the user through the process of inputting the data and specifying the file name and format for the business card image. Test your program with various inputs to ensure it generates valid business card and handles different data types gracefully.]
Config:
ChatEnvConfig.clear_structure: True

View File

@ -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"
}

View File

@ -0,0 +1,23 @@
产品名称:网页版弹珠游戏
一、随时随地的乐趣
网页版弹珠游戏无需下载,无需安装,只要打开网页就能玩。无论是在家中、在办公室,还是公共场所,只要有网络就能享受到弹珠游戏的乐趣。轻松愉快的游戏氛围,让您在繁忙的生活中找到一份轻松和愉悦。
二、怀旧与创新完美结合
这款游戏借鉴了经典弹珠游戏的经典设计,能唤起您对传统弹珠游戏的回忆。同时,我们加入了独特的创新元素,如丰富的游戏地图、动态的游戏难度等,让游戏更具挑战性和趣味性。
三、竞技与友谊并存
网页版弹珠游戏支持多人在线游戏,您可以邀请朋友一起加入游戏,共同体验成长的快乐。在游戏中,您可以与朋友竞技,争夺高分;也可以携手合作,共同闯关。这种社交化的玩法,让您在游戏中感受到友谊与欢乐。
四、丰富的游戏内容
游戏内含多种模式,包括经典模式、速度模式、多人对战等,满足您不同的游戏需求。同时,游戏地图丰富多样,从经典的砖墙地图到充满挑战的迷宫地图,让您总有新的惊喜。
五、操作简单,易于上手
网页版弹珠游戏的操作非常简单,只需使用鼠标或触摸屏进行操作,无论您是新手还是老手,都能轻松上手。游戏进程中,系统会智能匹配玩家的等级,保证游戏的公平性和趣味性。
网页版弹珠游戏,简单而富有挑战,让您在轻松愉快中度过休闲时光。快来加入我们吧!

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,277 @@
{
"DemandAnalysis": {
"assistant_role_name": "Chief Product Officer",
"user_role_name": "Chief Executive Officer",
"phase_prompt": [
"ChatDev has made products in the following form before:",
"Image: can present information in line chart, bar chart, flow chart, cloud chart, Gantt chart, etc.",
"Document: can present information via .docx files.",
"PowerPoint: can present information via .pptx files.",
"Excel: can present information via .xlsx files.",
"PDF: can present information via .pdf files.",
"Website: can present personal resume, tutorial, products, or ideas, via .html files.",
"Application: can implement visualized game, software, tool, etc, via python.",
"Dashboard: can display a panel visualizing real-time information.",
"Mind Map: can represent ideas, with related concepts arranged around a core concept.",
"As the {assistant_role}, to satisfy the new user's demand and the product should be realizable, you should keep discussing with me to decide which product modality do we want the product to be?",
"Note that we must ONLY discuss the product modality and do not discuss anything else! Once we all have expressed our opinion(s) and agree with the results of the discussion unanimously, any of us must actively terminate the discussion by replying with only one line, which starts with a single word <INFO>, followed by our final product modality without any other words, e.g., \"<INFO> PowerPoint\"."
]
},
"LanguageChoose": {
"assistant_role_name": "Chief Technology Officer",
"user_role_name": "Chief Executive Officer",
"phase_prompt": [
"According to the new user's task and some creative brainstorm ideas listed below: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Ideas: \"{ideas}\".",
"We have decided to complete the task through a executable software implemented via a programming language. ",
"As the {assistant_role}, to satisfy the new user's demand and make the software realizable, you should propose a concrete programming language. If python can complete this task via Python, please answer Python; otherwise, answer another programming language (e.g., Java, C++, etc,).",
"Note that we must ONLY discuss the target programming language and do not discuss anything else! Once we all have expressed our opinion(s) and agree with the results of the discussion unanimously, any of us must actively terminate the discussion and conclude the best programming language we have discussed without any other words or reasons, return only one line using the format: \"<INFO> *\" where \"*\" represents a programming language."
]
},
"Coding": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"According to the new user's task and our software designs listed below: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Ideas:\"{ideas}\"",
"We have decided to complete the task through a executable software with multiple files implemented via {language}. As the {assistant_role}, to satisfy the new user's demands, you should write one or multiple files and make sure that every detail of the architecture is, in the end, implemented as code. {gui}",
"Think step by step and reason yourself to the right decisions to make sure we get it right.",
"You will first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose.",
"Then you will output the content of each file including complete code. Each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"You will start with the \"main\" file, then go to the ones that are imported by that file, and so on.",
"Please note that the code should be fully functional. Ensure to implement all functions. No placeholders (such as 'pass' in Python)."
]
},
"ArtDesign": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Creative Officer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Task: \"{task}\".",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Note that each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and equip the software with a beautiful graphical user interface (GUI), we will discuss and design many decorative images for GUI decoration. Now, we keep discussing the GUI beautification by listing some functionally independent elements in GUI that are being considered to be decorated by different pictures. For example, ten digits (0-9) in a calculator are functionally independent.",
"To answer, use the format: \" FILENAME.png: DESCRIPTION\" where \"FILENAME\" is the filename of the image and \"DESCRIPTION\" denotes the detailed description of the independent elements. For example:",
"'''",
"button_1.png: The button with the number \"1\" on it.",
"button_multiply.png: The button with the multiplication symbol (\"*\") on it.",
"background.png: the background color to decorate the Go game",
"'''",
"Now, list all functionally independent elements as much as possible."
]
},
"ArtIntegration": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Creative Officer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Task: \"{task}\".",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Note that each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and equip the software with a beautiful graphical user interface (GUI), you will incorporate our designed images for GUI decoration. Here are some ready-made high-quality pictures and corresponding descriptions:",
"{images}",
"Note that the designed images have a fixed size of 256x256 pixels and the images are located in the same directory as all the Python files; please dynamically scaling these images according to the size of GUI, and use \"self.*\" to avoid displaying-related problems caused by automatic garbage collection. For example:",
"```",
"self.image = ImageTk.PhotoImage(Image.open(\"./image.png\").resize((50, 50)))",
"```",
"Now, use some or all of the pictures into the GUI to make it more beautiful and creative. Output codes strictly following the required format mentioned above."
]
},
"CodeComplete": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"According to the new user's task and our software designs listed below: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Codes:",
"\"{codes}\"",
"Unimplemented File:",
"\"{unimplemented_file}\"",
"In our software, each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the complete function of our developed software, you have to implement all methods in the {unimplemented_file} file which contains a unimplemented class. Now, implement all methods of the {unimplemented_file} and all other codes needed, then output the fully implemented codes, strictly following the required format."
]
},
"CodeReviewComment": {
"assistant_role_name": "Code Reviewer",
"user_role_name": "Programmer",
"phase_prompt": [
"According to the new user's task and our software designs: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Ideas: \"{ideas}\"",
"Codes:",
"\"{codes}\"",
"As the {assistant_role}, to make the software directly operable without further coding, ChatDev have formulated the following regulations:",
"1) all referenced classes should be imported;",
"2) all methods should be implemented;",
"3) all methods need to have the necessary comments;",
"4) no potential bugs;",
"5) The entire project conforms to the tasks proposed by the user;",
"6) most importantly, do not only check the errors in the code, but also the logic of code. Make sure that user can interact with generated software without losing any feature in the requirement;",
"Now, you should check the above regulations one by one and review the codes in detail, propose one comment with the highest priority about the codes, and give me instructions on how to fix. Tell me your comment with the highest priority and corresponding suggestions on revision. If the codes are perfect and you have no comment on them, return only one line like \"<INFO> Finished\"."
]
},
"CodeReviewModification": {
"assistant_role_name": "Programmer",
"user_role_name": "Code Reviewer",
"phase_prompt": [
"According to the new user's task, our designed product modality, languages and ideas, our developed first-edition source codes are listed below: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Ideas: \"{ideas}\"",
"Codes: ",
"\"{codes}\"",
"Comments on Codes:",
"\"{comments}\"",
"In the software, each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code. Format:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and make the software creative, executive and robust, you should modify corresponding codes according to the comments. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
]
},
"TestErrorSummary": {
"assistant_role_name": "Programmer",
"user_role_name": "Software Test Engineer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Test Reports of Source Codes:",
"\"{test_reports}\"",
"According to my test reports, please locate and summarize the bugs that cause the problem."
]
},
"TestModification": {
"assistant_role_name": "Programmer",
"user_role_name": "Software Test Engineer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Test Reports of Source Codes:",
"\"{test_reports}\"",
"Error Summary of Test Reports:",
"\"{error_summary}\"",
"Note that each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and make the software execute smoothly and robustly, you should modify the codes based on the error summary. Now, use the format exemplified above and modify the problematic codes based on the error summary. Output the codes that you fixed based on the test reported and corresponding explanations (strictly follow the format defined above, including FILENAME, LANGUAGE, DOCSTRING and CODE; incomplete \"TODO\" codes are strictly prohibited). If no bugs are reported, please return only one line like \"<INFO> Finished\"."
]
},
"EnvironmentDoc": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"The new user's task and our developed codes are listed: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Ideas: \"{ideas}\"",
"Codes: ",
"\"{codes}\"",
"As the {assistant_role}, you should write a requirements.txt file, which is commonly used in Python projects to specify the dependencies or packages required for the project to run properly. It serves as a way to document and manage the project's dependencies in a standardized format. For example:",
"requirements.txt",
"```",
"numpy==1.19.2",
"pandas>=1.1.4",
"```",
"According to the codes and file format listed above, write a requirements.txt file to specify the dependencies or packages required for the project to run properly."
]
},
"Manual": {
"assistant_role_name": "Chief Product Officer",
"user_role_name": "Chief Executive Officer",
"phase_prompt": [
"The new user's task, our developed codes and required dependencies are listed: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Ideas: \"{ideas}\"",
"Codes: ",
"\"{codes}\"",
"Requirements:",
"\"{requirements}\"",
"As the {assistant_role}, by using Markdown, you should write a manual.md file which is a detailed user manual to use the software, including introducing main functions of the software, how to install environment dependencies and how to use/play it. For example:",
"manual.md",
"```",
"# LangChain",
"Building applications with LLMs through composability",
"Looking for the JS/TS version? Check out LangChain.js.",
"**Production Support:** As you move your LangChains into production, we'd love to offer more comprehensive support.",
"Please fill out this form and we'll set up a dedicated support Slack channel.",
"## Quick Install",
"`pip install langchain`",
"or",
"`conda install langchain -c conda-forge`",
"## 🤔 What is this?",
"Large language models (LLMs) are emerging as a transformative technology, enabling developers to build applications that they previously could not. However, using these LLMs in isolation is often insufficient for creating a truly powerful app - the real power comes when you can combine them with other sources of computation or knowledge.",
"This library aims to assist in the development of those types of applications. Common examples of these applications include:",
"**❓ Question Answering over specific documents**",
"- Documentation",
"- End-to-end Example: Question Answering over Notion Database",
"**🤖 Agents**",
"- Documentation",
"- End-to-end Example: GPT+WolframAlpha",
"## 📖 Documentation",
"Please see [here](https://python.langchain.com) for full documentation on:",
"- Getting started (installation, setting up the environment, simple examples)",
"- How-To examples (demos, integrations, helper functions)",
"- Reference (full API docs)",
"- Resources (high-level explanation of core concepts)",
"```"
]
}
}

View File

@ -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."
]
}

View File

@ -0,0 +1,19 @@
'''
This file contains the Game class which manages the pinball game.
'''
import tkinter as tk
from player import Player
class Game:
def __init__(self, window):
self.window = window
self.canvas = tk.Canvas(self.window, width=800, height=600)
self.canvas.pack()
self.player = Player(self.canvas)
def start(self):
self.canvas.bind("<Button-1>", self.player.move)
self.canvas.focus_set()
self.update()
def update(self):
self.player.update()
self.window.after(10, self.update)
# player.py

View File

@ -0,0 +1,17 @@
'''
This is the main file for the web-based pinball game.
'''
import tkinter as tk
from game import Game
def main():
# Create the game window
window = tk.Tk()
window.title("Web-based Pinball Game")
# Create the game instance
game = Game(window)
# Start the game loop
game.start()
# Run the main event loop
window.mainloop()
if __name__ == "__main__":
main()

View File

@ -0,0 +1,45 @@
# Web-based Pinball Game User Manual
## Introduction
Welcome to the Web-based Pinball Game! This game is designed to provide you with a fun and enjoyable experience, allowing you to relax and have a good time. With its simple controls and challenging gameplay, it is suitable for both beginners and experienced players. Whether you are at home, in the office, or in a public place, you can easily access and play the game through a web browser. This user manual will guide you through the installation process and explain how to play the game.
## Installation
To play the Web-based Pinball Game, you don't need to download or install anything. Simply open a web browser and access the game website. Make sure you have a stable internet connection to ensure smooth gameplay.
## Gameplay
### Controls
- Mouse: Use the mouse to control the paddle and hit the ball. Move the mouse left or right to move the paddle accordingly.
### Game Modes
The Web-based Pinball Game offers multiple game modes to suit your preferences:
1. Classic Mode: This mode follows the traditional pinball game rules and mechanics. Your goal is to score as many points as possible by hitting targets and keeping the ball in play.
2. Speed Mode: In this mode, the ball moves at a faster pace, providing a more challenging gameplay experience. Test your reflexes and see how many points you can score.
3. Multiplayer Mode: Challenge your friends in this mode and compete for the highest score. Invite your friends to join the game and enjoy the fun of playing together.
### Game Content
The Web-based Pinball Game offers a variety of game content to keep you entertained:
1. Diverse Game Maps: From classic brick wall maps to challenging maze maps, there is always something new and exciting to explore. Each map offers unique gameplay elements and challenges.
2. Dynamic Game Difficulty: The game features dynamic difficulty adjustments to provide a balanced and enjoyable experience. As you progress in the game, the difficulty level will increase, keeping you engaged and motivated.
### Social Features
The Web-based Pinball Game includes social features to enhance your gaming experience:
1. Multiplayer Online Gaming: Play with your friends and compete against each other for the highest score. Enjoy the thrill of friendly competition and see who can achieve the best results.
2. Cooperative Gameplay: Instead of competing, you can also choose to cooperate with your friends and work together to overcome challenges and complete levels. Team up and experience the joy of collaboration.
## Conclusion
The Web-based Pinball Game offers a simple yet challenging gameplay experience, allowing you to relax and have fun in your leisure time. With its easy-to-use controls and diverse game content, it caters to players of all skill levels. Whether you want to reminisce about classic pinball games or explore new and innovative gameplay elements, this game has something for everyone. So, what are you waiting for? Join us now and start enjoying the Web-based Pinball Game!

View File

@ -0,0 +1,52 @@
Task:
产品名称:网页版弹珠游戏
一、随时随地的乐趣
网页版弹珠游戏无需下载,无需安装,只要打开网页就能玩。无论是在家中、在办公室,还是公共场所,只要有网络就能享受到弹珠游戏的乐趣。轻松愉快的游戏氛围,让您在繁忙的生活中找到一份轻松和愉悦。
二、怀旧与创新完美结合
这款游戏借鉴了经典弹珠游戏的经典设计,能唤起您对传统弹珠游戏的回忆。同时,我们加入了独特的创新元素,如丰富的游戏地图、动态的游戏难度等,让游戏更具挑战性和趣味性。
三、竞技与友谊并存
网页版弹珠游戏支持多人在线游戏,您可以邀请朋友一起加入游戏,共同体验成长的快乐。在游戏中,您可以与朋友竞技,争夺高分;也可以携手合作,共同闯关。这种社交化的玩法,让您在游戏中感受到友谊与欢乐。
四、丰富的游戏内容
游戏内含多种模式,包括经典模式、速度模式、多人对战等,满足您不同的游戏需求。同时,游戏地图丰富多样,从经典的砖墙地图到充满挑战的迷宫地图,让您总有新的惊喜。
五、操作简单,易于上手
网页版弹珠游戏的操作非常简单,只需使用鼠标或触摸屏进行操作,无论您是新手还是老手,都能轻松上手。游戏进程中,系统会智能匹配玩家的等级,保证游戏的公平性和趣味性。
网页版弹珠游戏,简单而富有挑战,让您在轻松愉快中度过休闲时光。快来加入我们吧!
Config:
ChatEnvConfig.clear_structure: True
ChatEnvConfig.git_management: False
ChatEnvConfig.gui_design: True
Roster:
Chief Executive Officer, Counselor, Chief Human Resource Officer, Chief Product Officer, Chief Technology Officer, Programmer, Code Reviewer, Software Test Engineer, Chief Creative Officer
Modality:
website
Ideas:
Language:
Python
Code_Version:
5.0
Proposed_images:
0
Incorporated_images:
0

View File

@ -0,0 +1,69 @@
'''
This file contains the Player class which represents the player in the pinball game.
'''
class Player:
def __init__(self, canvas):
self.canvas = canvas
self.score = 0
self.level = 1
self.ball = self.canvas.create_oval(395, 295, 405, 305, fill="red")
self.player_shape = self.canvas.create_rectangle(50, 50, 100, 100, fill="blue")
self.velocity_x = 1
self.velocity_y = -1
# self.ball_coords = self.canvas.coords(self.ball)
# self.player_coords = self.canvas.coords(self.player_shape)
def update(self):
self.canvas.move(self.ball, self.velocity_x, self.velocity_y)
# self.check_collision()
self.check_collision_with_player()
self.check_collision_with_walls()
# def check_collision(self):
# ball_coords = self.canvas.coords(self.ball)
# if ball_coords[0] <= 0 or ball_coords[2] >= 800:
# self.velocity_x *= -1
# if ball_coords[1] <= 0 or ball_coords[3] >= 600:
# self.velocity_y *= -1
def check_collision_with_walls(self):
ball_coords = self.canvas.coords(self.ball)
if ball_coords[0] <= 0 or ball_coords[2] >= 800:
self.velocity_x *= -1
if ball_coords[1] <= 0 or ball_coords[3] >= 600:
self.velocity_y *= -1
def check_collision_with_player(self):
ball_coords = self.canvas.coords(self.ball)
player_coords = self.canvas.coords(self.player_shape)
# 检测玩家和球是否发生碰撞
if (player_coords[0] < ball_coords[2] and
player_coords[2] > ball_coords[0] and
player_coords[1] < ball_coords[3] and
player_coords[3] > ball_coords[1]):
# 发生碰撞,可以在这里执行相应的操作
self.score += 10 # 假设得分增加
def move(self, event):
# 获取鼠标点击的位置
mouse_x = event.x
mouse_y = event.y
# 计算玩家当前位置
player_x, player_y, _, _ = self.canvas.coords(self.player_shape)
self.canvas.coords(self.player_shape, mouse_x - 25, mouse_y - 25, mouse_x + 25, mouse_y + 25)
# 计算移动速度
speed = 2
# 计算移动方向
dx = mouse_x - player_x
dy = mouse_y - player_y
# 计算归一化向量
length = (dx ** 2 + dy ** 2) ** 0.5
if length > 0:
dx /= length
dy /= length
# 设置新的速度
self.x_speed = dx * speed
self.y_speed = dy * speed

View File

@ -0,0 +1,2 @@
Comments:
The code is missing the import statement for the Player class in the game.py file. To fix this, add the following line at the top of the game.py file:

View File

@ -1,5 +1,5 @@
Task:
Desgin a basic RGB color picker and slider with a GUI. Display the equivalent hex color code.
Design a basic RGB color picker and slider with a GUI. Display the equivalent hex color code.
Config:
ChatEnvConfig.clear_structure: True

View File

@ -1,5 +1,5 @@
Task:
design a pingpong game: create a two-player interactive game where each player controls a paddle to hit a ball back and forth. the game should have a visually appealing user interface with smooth animations and sound effects. implement different game modes, including single-player against an ai opponent, multiplayer over a network, and a practice mode with adjustable difficulty levels. consider incorporating power-ups, customizable paddle designs, and a scoring system. ensure the game is intuitive to play, responsive to user input, and provides an enjoyable gaming experience.
design a Ping-Pong game: create a two-player interactive game where each player controls a paddle to hit a ball back and forth. the game should have a visually appealing user interface with smooth animations and sound effects. implement different game modes, including single-player against an ai opponent, multiplayer over a network, and a practice mode with adjustable difficulty levels. consider incorporating power-ups, customizable paddle designs, and a scoring system. ensure the game is intuitive to play, responsive to user input, and provides an enjoyable gaming experience.
Config:
ChatEnvConfig.clear_structure: True

View File

@ -155,9 +155,9 @@ Voor meer gedetailleerde informatie, verwijzen wij u graag naar onze [Wiki](../w
## 🤝 Erkenningen
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="../misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="../misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="../misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://aibrb.com/introducing-herbie-your-super-employee-for-streamlined-productivity/"><img src="https://aibrb.com/wp-content/uploads/2023/09/Featured-on-AIBRB.com-white-1.png" height=50pt></a>
## 📬 Contact

View File

@ -183,9 +183,9 @@ https://github.com/OpenBMB/ChatDev/assets/11889052/80d01d2f-677b-4399-ad8b-f7af9
## 🤝 स्वीकृतियाँ
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="../misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="../misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="../misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://aibrb.com/introducing-herbie-your-super-employee-for-streamlined-productivity/"><img src="https://aibrb.com/wp-content/uploads/2023/09/Featured-on-AIBRB.com-white-1.png" height=50pt></a>
## 📬 संपर्क

View File

@ -24,7 +24,11 @@
## 🎉 ニュース
* **2023年9月25日: **Git** 機能が利用可能になりました**、プログラマー <img src='../online_log/static/figures/programmer.png' height=20> がバージョン管理に GitHub を利用できるようになります。この機能を有効にするには、``ChatChainConfig.json`` で ``"git_management"`` を ``"True"`` に設定するだけです。
* **2023年10月26日: ChatDev が安全な実行のために Docker に対応しました** ([ManindraDeMel](https://github.com/ManindraDeMel) のコントリビュートに感謝します)。[Docker スタートガイド](../wiki.md#docker-start)を参照してください。
<p align="center">
<img src='../misc/docker.png' width=400>
</p>
* 2023年9月25日: **Git** 機能が利用可能になりました、プログラマー <img src='../online_log/static/figures/programmer.png' height=20> がバージョン管理に GitHub を利用できるようになります。この機能を有効にするには、``ChatChainConfig.json`` で ``"git_management"`` を ``"True"`` に設定するだけです。
<p align="center">
<img src='../misc/github.png' width=600>
</p>
@ -49,6 +53,8 @@ https://github.com/OpenBMB/ChatDev/assets/11889052/80d01d2f-677b-4399-ad8b-f7af9
## ⚡️ クイックスタート
### 🖥️ ターミナルでクイックスタート
開始するには、以下の手順に従ってください:
1. **GitHub リポジトリのクローン:** コマンドを使ってリポジトリのクローンを作成する:
@ -100,6 +106,9 @@ https://github.com/OpenBMB/ChatDev/assets/11889052/80d01d2f-677b-4399-ad8b-f7af9
python main.py
```
### 🐳 Docker のクイックスタート
- Docker のサポートを提供してくれた [ManindraDeMel](https://github.com/ManindraDeMel) に感謝します。[Docker スタートガイド](wiki.md#docker-start)を参照してください。
## ✨️ 高度なスキル
より詳細な情報については、私たちの [Wiki](../wiki.md) を参照してください:
@ -138,20 +147,11 @@ https://github.com/OpenBMB/ChatDev/assets/11889052/80d01d2f-677b-4399-ad8b-f7af9
### 👨‍💻 ソフトウェア共有者
<a href="https://github.com/qianc62"><img src="https://avatars.githubusercontent.com/u/48988402?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/thinkwee"><img src="https://avatars.githubusercontent.com/u/11889052?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/NA-Wen"><img src="https://avatars.githubusercontent.com/u/92134380?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/JiahaoLi2003"><img src="https://avatars.githubusercontent.com/u/111221887?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Alphamasterliu"><img src="https://avatars.githubusercontent.com/u/110011045?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/GeekyWizKid"><img src="https://avatars.githubusercontent.com/u/133981481?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Munsif-Raza-T"><img src="https://avatars.githubusercontent.com/u/76085202?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/djbritt"><img src="https://avatars.githubusercontent.com/u/28036018?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Classified3939"><img src="https://avatars.githubusercontent.com/u/102702965?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/chenilim"><img src="https://avatars.githubusercontent.com/u/46905241?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/delconis"><img src="https://avatars.githubusercontent.com/u/5824478?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/eMcQuill"><img src="https://avatars.githubusercontent.com/u/139025701?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Aizhouym"><img src="https://avatars.githubusercontent.com/u/105852026?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/OpenBMB/ChatDev/graphs/contributors">
<img src="https://contrib.rocks/image?repo=OpenBMB/ChatDev" />
</a>
[contrib.rocks](https://contrib.rocks) を使用して作成。
## 🔎 引用
```
@ -177,9 +177,9 @@ https://github.com/OpenBMB/ChatDev/assets/11889052/80d01d2f-677b-4399-ad8b-f7af9
## 🤝 謝辞
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="../misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="../misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="../misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://aibrb.com/introducing-herbie-your-super-employee-for-streamlined-productivity/"><img src="https://aibrb.com/wp-content/uploads/2023/09/Featured-on-AIBRB.com-white-1.png" height=50pt></a>
## 📬 お問い合わせ

View File

@ -171,9 +171,9 @@ Para obter informações mais detalhadas, consulte nossa Wiki, onde você pode e
## 🤝 Agradecimentos
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="../misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="../misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="../misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://aibrb.com/introducing-herbie-your-super-employee-for-streamlined-productivity/"><img src="https://aibrb.com/wp-content/uploads/2023/09/Featured-on-AIBRB.com-white-1.png" height=50pt></a>
## 📬 Contato

View File

@ -181,9 +181,9 @@ vytvorí softvérový balík a vygeneruje priečinok s názvom ``/WareHouse/2048
## 🤝 Poďakovania
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="../misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="../misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="../misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://aibrb.com/introducing-herbie-your-super-employee-for-streamlined-productivity/"><img src="https://aibrb.com/wp-content/uploads/2023/09/Featured-on-AIBRB.com-white-1.png" height=50pt></a>
## 📬 Kontakt

View File

@ -175,9 +175,9 @@ un paquete de software y generará una carpeta llamada ``/WareHouse/2048_THUNLP_
## 🤝 Agradecimientos
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="http://nlp.csai.tsinghua.edu.cn/"><img src="../misc/thunlp.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://modelbest.cn/"><img src="../misc/modelbest.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://github.com/OpenBMB/AgentVerse/"><img src="../misc/agentverse.png" height=50pt></a>&nbsp;&nbsp;
<a href="https://aibrb.com/introducing-herbie-your-super-employee-for-streamlined-productivity/"><img src="https://aibrb.com/wp-content/uploads/2023/09/Featured-on-AIBRB.com-white-1.png" height=50pt></a>
## 📬 Contacto

13
wiki.md
View File

@ -137,10 +137,19 @@ then go to [Local Demo Website](http://127.0.0.1:8000/) to see an online visuali
- Customize ChatChain
- Customize Phase
- Customize Role
- Here is the overview architecture of ChatDev, which illustrates the relationships among above three classes:
- Here is the overview architecture of ChatDev, which illustrates the relationships among the above three classes:
![arch](misc/arch.png)
- All the configuration content related to ChatDev (such as the background prompt of the agent employee, the work content of each Phase, and how the Phase is combined into a ChatChain), are called a **CompanyConfig** (because ChatDev is like a virtual software company). These CompanyConfigs are in the ChatDev project Under ``CompanyConfig/``. You can check this [directory](https://github.com/OpenBMB/ChatDev/tree/main/CompanyConfig). In this directory, you will see different CompanyConfig (such as Default, Art, Human). Generally speaking, each CompanyConfig will contain 3 configuration files.
1. ChatChainConfig.json, which controls the overall development process of ChatDev, including which Phase each step is, how many times each Phase needs to be cycled, whether reflect is needed, etc.
2. PhaseConfig.json, which controls each Phase, and corresponds to ``chatdev/phase.py`` or ``chatdev/composed_phase.py`` in the ChatDev project. The Python file realizes the specific working logic of each phase. The json file here contains the configuration of each phase, such as background prompt, which employees are participating in the phase, etc.
3. RoleConfig.json contains the configuration of each employee (agent). Currently, it only contains the background prompt of each employee, which is a bunch of text containing placeholders.
- If a CompanyConfig does not contain all three configuration files (such as Art and Human), it means that the configuration files missing from this CompanyConfig are set according to Default. The official CompanyConfigs currently provided include:
1. Default, default configuration
2. Art, allows ChatDev to create image files according to needs, automatically generate image description prompts and call the openai Wenshengtu API to generate images
3. Human, allowing human users to participate in ChatDevs code review process
### Customize ChatChain
- see ``CompanyConfig/Default/ChatChainConfig.json``
@ -363,4 +372,4 @@ then go to [Local Demo Website](http://127.0.0.1:8000/) to see an online visuali
```
If you add and commit the software log file under the software folder, there will be no ``Changes not staged for commit:``
- Some phase executions may not change the code, and thereby there is no commit. For example, the software is tested without problems and there is no modification, so the test phase would leave no commit.