Skip to content

Commit

Permalink
Remove snake example, add pong example
Browse files Browse the repository at this point in the history
  • Loading branch information
dougollerenshaw committed Oct 4, 2024
1 parent ee7d054 commit fb0b968
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions codeaide/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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.
For simplicity, please put the function and test in the same file.

0 comments on commit fb0b968

Please sign in to comment.