![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
This package is my own implementation on Snake game with Gym integration.
import gym
import snake_gym_grid
env = gym.make("snake-gym-10x20-normal-v0")
env.reset()
done = False # whether the snake dies
"""
action ranges from 0 to 3.
0 - LEFT
1 - RIGHT
2 - UP
3 - DOWN
"""
action = ...
observation = env.reset()
while not done:
env.render()
observation, reward, done, info = env.step(action)
env.close()
snake-gym-grid-10x20-normal-v0
: Snake game with 10 x 20 board and 500 x 900 observationsnake-gym-grid-10x20-tiny-v0
: Snake game with 10 x 20 board and 80 x 80 observationsnake-gym-grid-10x20-1d-v0
: Snake game with 10 x 20 board and summarized observation. Observation in this case is vector [dangerRight, dangerLeft, dangerBelow, dangerAbove, foodBelow, foodAbove, foodRight, foodLeft]
.Note:
danger<Direction>
= neighbor block of snake head in the <Direction>
is occupied by a snake body or is out of game board.
food<Direction>
= is the food in the <Direction>
of the snake head?
For any other environment, observation is the raw image from the game view. For tiny, the size is 80 x 80 and for normal, it's 500 x 900.
Instead of using registered environment, one can utilize the built-in SnakeGymGrid
class.
# this import is kinda ugly but I have no choice but to follow the gym standard
from snake_gym_grid.envs.snake_gym_grid import SnakeGymGrid
env = SnakeGymGrid(width=..., height=..., n_rows=..., n_cols=...)
...
FAQs
An implementation on Snake game with grid display
We found that snake-gym-grid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.