Spaces:
Runtime error
Runtime error
Sasha Rush
commited on
Commit
·
9c5cde1
1
Parent(s):
24b2eb2
Evil map version
Browse files- GPT4_game.ipynb +11 -4
GPT4_game.ipynb
CHANGED
|
@@ -531,6 +531,8 @@
|
|
| 531 |
"def prompt(game):\n",
|
| 532 |
" \"\"\"\n",
|
| 533 |
" You should fill these sections out to teach the AI how to play the game.\n",
|
|
|
|
|
|
|
| 534 |
" \"\"\"\n",
|
| 535 |
" print(f\"\"\"\n",
|
| 536 |
"# TODO: DESCRIBE THE GAME\n",
|
|
@@ -557,7 +559,7 @@
|
|
| 557 |
"# ------------\n",
|
| 558 |
"\"\"\")\n",
|
| 559 |
"\n",
|
| 560 |
-
" # Create a few shot example
|
| 561 |
" board = Game(boundary=(3, 3), key=(1, 1), flag=(2, 2), init=(0, 0), walls=[(2, 0)])\n",
|
| 562 |
" actions = [Actions.DOWNRIGHT, Actions.PICKUP, Actions.DOWNRIGHT]\n",
|
| 563 |
" example(board, actions)\n",
|
|
@@ -594,11 +596,16 @@
|
|
| 594 |
"game = Game(boundary=(3, 3), key=(1, 1), flag=(2, 2), init=(0, 0), walls=[])\n",
|
| 595 |
"\n",
|
| 596 |
"# Medium\n",
|
| 597 |
-
"#game = Game(boundary=(5, 5), key=(3, 1), flag=(4, 4), init=(0, 0), walls=[(1, 1)])\n",
|
| 598 |
"\n",
|
| 599 |
-
"# Hard\n",
|
| 600 |
"#game = Game(boundary=(8, 15), key=(3, 1), flag=(7, 13), init=(0, 0), walls=[(2, 2), (1, 1), (5, 3), (1, 11), (5, 5), (6, 6), (6, 10), (2, 6), (4, 12)])\n",
|
| 601 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 602 |
"f = io.StringIO()\n",
|
| 603 |
"with redirect_stdout(f):\n",
|
| 604 |
" ex = 0\n",
|
|
@@ -973,7 +980,7 @@
|
|
| 973 |
"metadata": {
|
| 974 |
"colab": {
|
| 975 |
"provenance": [],
|
| 976 |
-
"authorship_tag": "
|
| 977 |
"include_colab_link": true
|
| 978 |
},
|
| 979 |
"kernelspec": {
|
|
|
|
| 531 |
"def prompt(game):\n",
|
| 532 |
" \"\"\"\n",
|
| 533 |
" You should fill these sections out to teach the AI how to play the game.\n",
|
| 534 |
+
"\n",
|
| 535 |
+
" Or you may do your own thing :)\n",
|
| 536 |
" \"\"\"\n",
|
| 537 |
" print(f\"\"\"\n",
|
| 538 |
"# TODO: DESCRIBE THE GAME\n",
|
|
|
|
| 559 |
"# ------------\n",
|
| 560 |
"\"\"\")\n",
|
| 561 |
"\n",
|
| 562 |
+
" # Create a few shot example (you may not need this)\n",
|
| 563 |
" board = Game(boundary=(3, 3), key=(1, 1), flag=(2, 2), init=(0, 0), walls=[(2, 0)])\n",
|
| 564 |
" actions = [Actions.DOWNRIGHT, Actions.PICKUP, Actions.DOWNRIGHT]\n",
|
| 565 |
" example(board, actions)\n",
|
|
|
|
| 596 |
"game = Game(boundary=(3, 3), key=(1, 1), flag=(2, 2), init=(0, 0), walls=[])\n",
|
| 597 |
"\n",
|
| 598 |
"# Medium\n",
|
| 599 |
+
"# game = Game(boundary=(5, 5), key=(3, 1), flag=(4, 4), init=(0, 0), walls=[(1, 1)])\n",
|
| 600 |
"\n",
|
| 601 |
+
"# Hard (This is the main one)\n",
|
| 602 |
"#game = Game(boundary=(8, 15), key=(3, 1), flag=(7, 13), init=(0, 0), walls=[(2, 2), (1, 1), (5, 3), (1, 11), (5, 5), (6, 6), (6, 10), (2, 6), (4, 12)])\n",
|
| 603 |
"\n",
|
| 604 |
+
"# Evil\n",
|
| 605 |
+
"#game = Game(boundary=(8, 15), key=(5, 1), flag=(7, 13), init=(0, 0), walls=[(2, 2), (3, 3), (4, 2), (1, 1), (2, 4), (7, 11), (5, 3), (1, 11), (5, 5), (6, 6), (6, 10), (2, 6), (4, 12)])\n",
|
| 606 |
+
"\n",
|
| 607 |
+
"display(draw_board(game.board.grid))\n",
|
| 608 |
+
"\n",
|
| 609 |
"f = io.StringIO()\n",
|
| 610 |
"with redirect_stdout(f):\n",
|
| 611 |
" ex = 0\n",
|
|
|
|
| 980 |
"metadata": {
|
| 981 |
"colab": {
|
| 982 |
"provenance": [],
|
| 983 |
+
"authorship_tag": "ABX9TyPJWk0bOFJAbdEiv2IItRfR",
|
| 984 |
"include_colab_link": true
|
| 985 |
},
|
| 986 |
"kernelspec": {
|