From ba02df8f470a8aa4442bdabdf53b1249a92f4ec6 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 13 May 2023 12:34:49 -0700 Subject: [PATCH] copy --- examples/2048-game.md | 17 ++++++++++------- examples/hello-world-flask.md | 6 +++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/examples/2048-game.md b/examples/2048-game.md index 92143d007..67fea9f79 100644 --- a/examples/2048-game.md +++ b/examples/2048-game.md @@ -1,10 +1,13 @@ # Modify an open source 2048 game with aider and gpt-4 -> In this chat transcript, the user explores and modifies the open source javascript 2048 game codebase from https://github.com/gabrielecirulli/2048 -> -> Notice that GPT-4 asks to see a particular source file, and aider automatically includes it in the chat session after getting permission from the user. +In this chat transcript, the user explores and modifies the open source javascript 2048 game codebase from https://github.com/gabrielecirulli/2048 +Notice that GPT-4 asks to see a particular source file, and aider automatically includes it in the chat session after getting permission from the user. + +## Chat transcript + +> 2048$ aider app.py --- #### > what is this repo? @@ -18,8 +21,8 @@ If you need help with any specific part of the code or want to add new features, To help you with the scoring mechanism, I need to see the relevant code. Please provide the contents of the `js/game_manager.js` file, as it is likely to contain the scoring logic. -_js/game_manager.js_ -_Add these files to the chat? y_ +> js/game_manager.js +> Add these files to the chat? y Apologies for the oversight. I see the contents of the `js/game_manager.js` file now. @@ -77,6 +80,6 @@ js/game_manager.js This change will give the user a 10x bonus 10% of the time when two tiles merge. -_Applied edit to js/game_manager.js_ -_Commit eb9d882 aider: Added a 10% chance of giving the user a 10x bonus when two tiles merge._ +> Applied edit to js/game_manager.js +> Commit eb9d882 aider: Added a 10% chance of giving the user a 10x bonus when two tiles merge. diff --git a/examples/hello-world-flask.md b/examples/hello-world-flask.md index 2cf0c6a3d..8c7be5c03 100644 --- a/examples/hello-world-flask.md +++ b/examples/hello-world-flask.md @@ -2,12 +2,13 @@ # Create a simple flask app with aider and gpt-4 In this chat transcript, the user asks aider to make a simple flask app with various endpoints. + ## Chat transcript > hello-world-flask$ aider app.py > Creating app.py > Added app.py to the chat - +--- #### > make a flask app with a /hello endpoint that returns hello world To create a Flask app with a `/hello` endpoint that returns "Hello, World!", we need to install Flask, import it, create an app instance, and define a route for the `/hello` endpoint. Here's how to update the `app.py` file: @@ -35,6 +36,7 @@ Make sure to install Flask in your project environment using `pip install flask` > Applied edit to app.py > Commit 414c394 aider: Added a `/hello` endpoint that returns "Hello, World!" to the Flask app. +--- #### > add an endpoint like /add/3/5 which returns the sum of the 2 numbers To add an endpoint like `/add/3/5` that returns the sum of the two numbers, you can create a new route with two URL parameters. Update the `app.py` file as follows: @@ -61,6 +63,7 @@ Now, when you visit `/add/3/5`, it will return the sum of the two numbers, which > Applied edit to app.py > Commit 0872c51 aider: Added an endpoint `/add//` that returns the sum of the two numbers. +--- #### > add /fibonacci/X To add a `/fibonacci/X` endpoint that returns the Xth number in the Fibonacci sequence, you can create a new route with a URL parameter for X and a function to calculate the Fibonacci number. Update the `app.py` file as follows: @@ -100,6 +103,7 @@ Now, when you visit `/fibonacci/X`, it will return the Xth number in the Fibonac > Applied edit to app.py > Commit 163fba8 aider: Added a `/fibonacci/X` endpoint that returns the Xth number in the Fibonacci sequence. +--- #### > remove the hello endpoint To remove the `/hello` endpoint, you can simply delete the corresponding route and function in the `app.py` file. Here's the update: