{ "info": { "author": "Sanyam Kapoor", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "Gym 2048\n=========\n\n.. image:: https://travis-ci.com/activatedgeek/gym-2048.svg?branch=master\n :target: https://travis-ci.com/activatedgeek/gym-2048\n\n.. image:: https://badge.fury.io/py/gym-2048.svg\n :target: https://pypi.org/project/gym-2048/\n\nThis package implements the classic grid game 2048\nfor OpenAI gym environment.\n\nInstall\n--------\n\n.. code:: shell\n\n pip install gym-2048\n\nEnvironment(s)\n---------------\n\nThe package currently contains two environments\n\n- ``Tiny2048-v0``: A ``2 x 2`` grid game.\n- ``2048-v0``: The standard ``4 x 4`` grid game.\n\n\nAttributes\n^^^^^^^^^^^\n\n- **Observation**: All observations are ``n x n`` numpy arrays\n representing the grid. The array is ``0`` for empty locations\n and numbered ``2, 4, 8, ...`` wherever the tiles are placed.\n\n- **Actions**: There are four actions defined by integers.\n - ``LEFT = 0``\n - ``UP = 1``\n - ``RIGHT = 2``\n - ``DOWN = 3``\n\n- **Reward**: Reward is the total score obtained by merging any\n potential tiles for a given action. Score obtained by merging\n two tiles is simply the sum of values of those two tiles.\n\nRendering\n^^^^^^^^^^\n\nCurrently only basic print rendering (``mode='human'``) is supported.\nGraphic rendering support is coming soon.\n\nUsage\n------\n\nHere is a sample rollout of the game which follows the same API as\nOpenAI ``gym.Env``.\n\n.. code:: python\n\n import gym_2048\n import gym\n\n\n if __name__ == '__main__':\n env = gym.make('2048-v0')\n env.seed(42)\n\n env.reset()\n env.render()\n\n done = False\n moves = 0\n while not done:\n action = env.np_random.choice(range(4), 1).item()\n next_state, reward, done, info = env.step(action)\n moves += 1\n\n print('Next Action: \"{}\"\\n\\nReward: {}'.format(\n gym_2048.Base2048Env.ACTION_STRING[action], reward))\n env.render()\n\n print('\\nTotal Moves: {}'.format(moves))\n\n\n**NOTE**: Top level ``import gym_2048`` is needed to ensure registration with\n``Gym``.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.github.com/activatedgeek/gym-2048", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gym-2048", "package_url": "https://pypi.org/project/gym-2048/", "platform": "", "project_url": "https://pypi.org/project/gym-2048/", "project_urls": { "Homepage": "https://www.github.com/activatedgeek/gym-2048" }, "release_url": "https://pypi.org/project/gym-2048/0.2.6/", "requires_dist": null, "requires_python": "", "summary": "OpenAI Gym Environment for 2048", "version": "0.2.6" }, "last_serial": 4832371, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "e2c185898f8aa5bdbb20a5ff4f306381", "sha256": "8077af1ab22b4c6ddb9d39e523334a039785d50e0efacd85a6d86ac56a0e54f1" }, "downloads": -1, "filename": "gym-2048-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e2c185898f8aa5bdbb20a5ff4f306381", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4211, "upload_time": "2018-07-05T23:09:08", "url": "https://files.pythonhosted.org/packages/0e/6a/49c3fb30e9b281ea04c8f416563c0cf1f81692c3e5ba3d6b9ff986a3cb57/gym-2048-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1e28455aa6275e694b340bf1447b4aff", "sha256": "36d802b58d70ad8903915c0da2eadcb3633808b574a0d8229d7bd690d0ad769c" }, "downloads": -1, "filename": "gym-2048-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1e28455aa6275e694b340bf1447b4aff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4464, "upload_time": "2018-07-07T20:57:07", "url": "https://files.pythonhosted.org/packages/ae/88/b3e8e5cc08a4029bcb300064bb285c4fb8d50317e68eb239bb3144183b56/gym-2048-0.2.0.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "710db56253212cbd81d32ae58a85d03a", "sha256": "e90730d70a73ba5117fa5190f6d17516359aa07e29eebbb5afbe50858846412e" }, "downloads": -1, "filename": "gym-2048-0.2.4.tar.gz", "has_sig": false, "md5_digest": "710db56253212cbd81d32ae58a85d03a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4487, "upload_time": "2018-07-09T23:44:40", "url": "https://files.pythonhosted.org/packages/93/f8/de5b06ccf0d1d520d94daa120ac6fc70f4a15dfbec246fccd024b81264be/gym-2048-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "b6a2c631ab179d3f2a3e110916012ebd", "sha256": "b33481b9a30a78f0579eb4eab8f15f3619ee1177ec3677f184b2705ec59e26ee" }, "downloads": -1, "filename": "gym-2048-0.2.5.tar.gz", "has_sig": false, "md5_digest": "b6a2c631ab179d3f2a3e110916012ebd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4519, "upload_time": "2018-07-09T23:46:59", "url": "https://files.pythonhosted.org/packages/5f/dc/fc4aeb9b02542b772af2dad991ec3be703a63f03062a1c00ca309a525c0d/gym-2048-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "75c53e794d6d77db06bb90009b597b2a", "sha256": "13b15d0cd5ee556df33eab6861bfa94ae88aeb063fc1fd6d3e7fee230a0fa662" }, "downloads": -1, "filename": "gym-2048-0.2.6.tar.gz", "has_sig": false, "md5_digest": "75c53e794d6d77db06bb90009b597b2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4599, "upload_time": "2019-02-17T21:23:05", "url": "https://files.pythonhosted.org/packages/47/47/a1f06f3a6a05b78ffee842a7cd6f6734f97b0c3600f69df7654c232f0adc/gym-2048-0.2.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "75c53e794d6d77db06bb90009b597b2a", "sha256": "13b15d0cd5ee556df33eab6861bfa94ae88aeb063fc1fd6d3e7fee230a0fa662" }, "downloads": -1, "filename": "gym-2048-0.2.6.tar.gz", "has_sig": false, "md5_digest": "75c53e794d6d77db06bb90009b597b2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4599, "upload_time": "2019-02-17T21:23:05", "url": "https://files.pythonhosted.org/packages/47/47/a1f06f3a6a05b78ffee842a7cd6f6734f97b0c3600f69df7654c232f0adc/gym-2048-0.2.6.tar.gz" } ] }