From fb0b968e020e5a60224def3fa183cf21bbcb6440 Mon Sep 17 00:00:00 2001 From: dougollerenshaw Date: Fri, 4 Oct 2024 13:58:48 -0700 Subject: [PATCH] Remove snake example, add pong example --- codeaide/examples.yaml | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/codeaide/examples.yaml b/codeaide/examples.yaml index 637395f..b8e4b85 100644 --- a/codeaide/examples.yaml +++ b/codeaide/examples.yaml @@ -7,30 +7,18 @@ examples: • Decay rate: Approximately 20% of peak amplitude by 10 seconds • Line color: Black - - description: Create a Simple Snake Game using Pygame + - description: Create a Pong Game using Pygame prompt: | - Create a Python script that implements a basic Snake game using Pygame. The game should have the following features: + Create a Pong game with these features: - 1. A snake that moves around the screen, controlled by arrow keys. - 2. Food items that appear randomly on the screen. - 3. The snake grows longer when it eats food. - 4. The game ends if the snake hits the screen edges or itself, or if the user hits 'esc'. - 5. Display the current score (number of food items eaten). - 6. A simple "Game Over" screen that shows the final score and allows restarting the game. + • Left paddle controlled by player (up/down keys) + • Right paddle controlled by simple AI (add a small delay to make it beatable) + • Ball that bounces off paddles and screen edges + • Score display for player and AI + • Game ends when one side reaches 5 points + • Full screen display - Requirements: - - Use Pygame for graphics and event handling. - - The game window should be full screen. - - The snake and food should be represented by colored rectangles. - - There should be 5 food items on the screen at any time with new ones appearing randomly after the snake eats them. - - The snake should move at a constant speed that increases by 5% every time it eats a piece of food. - - The snake should start with a length of 3 and grow by 1 each time it eats food. - - Be sure to include robust logic for collision detection between the snake, food, and screen edges. - - Use a clock to control the game's frame rate. - - Include comments explaining key parts of the code. - - Handle keyboard events for moving the snake and restarting the game. - - Please provide the complete Python code to implement this Snake game, including necessary imports and comments explaining each major step. + Provide complete, commented Python code for this game. Ensure the AI paddle moves smoothly and provides a fair challenge. - description: Simple MNIST Image Classifier with PyTorch prompt: | @@ -95,4 +83,4 @@ examples: Please provide the complete Python code for both the `check_password_strength` function and its associated unit test, including necessary imports and comments explaining the implementation and test cases. Please provide a good docstring for the function explaining its purpose and expected input/output. - For simplicity, please put the function and test in the same file. \ No newline at end of file + For simplicity, please put the function and test in the same file.