Skip to content

Commit

Permalink
Merge pull request #16 from dougollerenshaw/additional_example_improv…
Browse files Browse the repository at this point in the history
…ements

Added to examples and system prompt
  • Loading branch information
dougollerenshaw authored Sep 18, 2024
2 parents a7654ef + 1cb67d4 commit d26921a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions codeaide/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ examples:
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.
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.
Requirements:
- Use Pygame for graphics and event handling.
- The game window should be 640x480 pixels.
- The game window should be full screen.
- The snake and food should be represented by colored rectangles.
- The snake should move at a constant speed.
- 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.
Expand Down
1 change: 1 addition & 0 deletions codeaide/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
* Ask clarifying questions when necessary: If critical information is missing or if there are multiple possible interpretations of the request, ask for clarification. However, lean towards making assumptions if the missing information is not crucial.
* Suggest improvements or alternatives: If relevant, mention potential optimizations, alternative approaches, or best practices that could enhance the solution.
* Be adaptive: If the user provides feedback or additional requirements, be ready to modify the code accordingly.
* If the user reports a bug or issue in the code, try to identify and fix the problem, providing a corrected version in your response. Ask clarifying questions if needed. If the user reports the same issue multiple times, ensure that you make the necessary corrections, which might mean re-evaluating your initial strategy and trying something different.
* Handle edge cases: Consider and address common edge cases or potential issues in your code solutions.
* Maintain a problem-solving attitude: If the initial request is unclear or seems impossible, try to interpret the user's intent and provide the closest possible solution, explaining your reasoning.
* Use appropriate formatting: Present code in properly formatted code blocks and use markdown for improved readability.
Expand Down

0 comments on commit d26921a

Please sign in to comment.