Skip to content

Commit 7c262f1

Browse files
committed
update comments
1 parent 2438d15 commit 7c262f1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

examples/OpenEnv_Tutorial.ipynb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,14 @@
691691
"\n",
692692
"```\n",
693693
"⬜ ⬜ 🔴 ⬜ ⬜\n",
694+
"⬜ ⬜ ⬜ ⬜ ⬜\n",
694695
"⬜ ⬜ ⬜ ⬜ ⬜ Ball\n",
696+
"⬜ ⬜ ⬜ ⬜ ⬜\n",
695697
"⬜ ⬜ ⬜ ⬜ ⬜ falls\n",
698+
"⬜ ⬜ ⬜ ⬜ ⬜\n",
696699
"⬜ ⬜ ⬜ ⬜ ⬜ down\n",
700+
"⬜ ⬜ ⬜ ⬜ ⬜\n",
701+
"⬜ ⬜ ⬜ ⬜ ⬜\n",
697702
"⬜ ⬜ 🏓 ⬜ ⬜\n",
698703
" Paddle\n",
699704
"```\n",
@@ -702,7 +707,7 @@
702707
"<td width=\"60%\">\n",
703708
"\n",
704709
"**Rules:**\n",
705-
"- 5×5 grid\n",
710+
"- 10×5 grid\n",
706711
"- Ball falls from random column\n",
707712
"- Move paddle left/right to catch it\n",
708713
"\n",
@@ -1007,15 +1012,15 @@
10071012
"\n",
10081013
" def select_action(self, obs: OpenSpielObservation) -> int:\n",
10091014
" # Parse OpenSpiel observation\n",
1010-
" # For Catch: info_state is a flattened 5x5 grid\n",
1015+
" # For Catch: info_state is a flattened 10x5 grid\n",
10111016
" # Ball position and paddle position encoded in the vector\n",
10121017
" info_state = obs.info_state\n",
10131018
"\n",
10141019
" # Find ball and paddle positions from info_state\n",
1015-
" # Catch uses a 5x5 grid, so 25 values\n",
1020+
" # Catch uses a 10x5 grid, so 50 values\n",
10161021
" grid_size = 5\n",
10171022
"\n",
1018-
" # Find positions (ball = 1.0, paddle = 0.5 in the flattened grid)\n",
1023+
" # Find positions (ball = 1.0 in the flattened grid, paddle = 1.0 in the last row of the flattened grid)\n",
10191024
" ball_col = None\n",
10201025
" paddle_col = None\n",
10211026
"\n",
@@ -1025,7 +1030,7 @@
10251030
" break\n",
10261031
"\n",
10271032
" last_row = info_state[-grid_size:]\n",
1028-
" paddle_col = last_row.index(1.0)\n",
1033+
" paddle_col = last_row.index(1.0) # Paddle\n",
10291034
"\n",
10301035
" if ball_col is not None and paddle_col is not None:\n",
10311036
" if paddle_col < ball_col:\n",

0 commit comments

Comments
 (0)