aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Albert Örwall <albert@platform24.com> 2024-02-20 11:52:59 +0100
committerGravatar GitHub <noreply@github.com> 2024-02-20 11:52:59 +0100
commit4ef912d73450056d12c32cd5ff365182af093848 (patch)
treeba541698523aaa73a440cf93459b63a8f0751bba
parentfix(agent/setup): Fix revising constraints and best practices (#6777) (diff)
downloadAuto-GPT-4ef912d73450056d12c32cd5ff365182af093848.tar.gz
Auto-GPT-4ef912d73450056d12c32cd5ff365182af093848.tar.bz2
Auto-GPT-4ef912d73450056d12c32cd5ff365182af093848.zip
fix(benchmark/challenges): Improve spec and eval of TicTacToe challenge
* In challenge specification, specify `subprocess.PIPE` for `stdin` and `stderr` for completeness * Additional tweak: let Pytest load only the current file when running the test file as a script Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
-rw-r--r--benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/custom_python/test.py2
-rw-r--r--benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.json2
2 files changed, 2 insertions, 2 deletions
diff --git a/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/custom_python/test.py b/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/custom_python/test.py
index 94b778208..01180015b 100644
--- a/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/custom_python/test.py
+++ b/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/custom_python/test.py
@@ -38,4 +38,4 @@ def test_game(inputs, expected_output):
if __name__ == "__main__":
- pytest.main()
+ pytest.main([__file__])
diff --git a/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.json b/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.json
index 63f19ce6f..e46c51bd3 100644
--- a/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.json
+++ b/benchmark/agbenchmark/challenges/verticals/code/5_tic_tac_toe/data.json
@@ -25,5 +25,5 @@
"side_effects": []
},
"name": "TicTacToe",
- "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdout=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```"
+ "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdin=subprocess.PIPE,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```"
}