René's URL Explorer Experiment


Title: On names and parameter orders of coodinates · Issue #50 · brean/python-pathfinding · GitHub

Open Graph Title: On names and parameter orders of coodinates · Issue #50 · brean/python-pathfinding

X Title: On names and parameter orders of coodinates · Issue #50 · brean/python-pathfinding

Description: Hi, It is my first time to use python-pathfinding, it's nice but sth make me confused... To be brief, I am writing a bot to play a game, this is what I try to do tonight: def ParseMap(map:List[Map]) -> (List[List[Map]], List[List[List[tu...

Open Graph Description: Hi, It is my first time to use python-pathfinding, it's nice but sth make me confused... To be brief, I am writing a bot to play a game, this is what I try to do tonight: def ParseMap(map:List[Map]...

X Description: Hi, It is my first time to use python-pathfinding, it's nice but sth make me confused... To be brief, I am writing a bot to play a game, this is what I try to do tonight: def ParseMap(map:List[...

Opengraph URL: https://github.com/brean/python-pathfinding/issues/50

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On names and parameter orders of coodinates","articleBody":"Hi,\r\nIt is my first time to use python-pathfinding, it's nice but sth make me confused...\r\nTo be brief, I am writing a bot to play a game, this is what I try to do tonight:\r\n```python\r\n   def ParseMap(map:List[Map]) -\u003e (List[List[Map]], List[List[List[tuple]]], tuple):\r\n    parsedMap = [[Map() for i in range(MapEdgeLength)] for j in range(MapEdgeLength)]\r\n    paths = [[[] for i in range(MapEdgeLength)] for j in range(MapEdgeLength)]\r\n    accessableNow = [[1 for i in range(MapEdgeLength)] for j in range(MapEdgeLength)]\r\n    playerPosition = None\r\n    for grid in map:\r\n        parsedMap[grid.x][grid.y] = grid\r\n        for obj in grid.objs:\r\n            if obj.type == ObjType.Player and obj.property.player_id != gContext[\"playerID\"] and playerPosition is None:\r\n                playerPosition = (grid.x, grid.y)\r\n            if obj.type == ObjType.Block or obj.type == ObjType.Bomb:\r\n                accessableNow[grid.x][grid.y] = 0 # (a)\r\n    # pfGrid: an abbreviation of pathfinding grid\r\n    pfGrid = Grid(matrix=accessableNow)\r\n    for grid in map:\r\n        pfGrid.cleanup()\r\n        finder = AStarFinder(diagonal_movement=DiagonalMovement.never)\r\n        newPath, _ = finder.find_path(pfGrid.node(playerPosition[0], playerPosition[1]),\r\n                                        pfGrid.node(grid.x, grid.y, pfGrid) #(b)\r\n        myNewPath = [(newPath[i].x, newPath[i].y) for i in range(len(newPath))]\r\n        paths[grid.x][grid.y] = myNewPath\r\n    return parsedMap, paths, playerPosition\r\n```\r\nSome names of variables in the code above are provided by the organizer of the contest I am taking part in. \r\nMy code above failed to get correct answer until I rewite `(a)` as:\r\n```python\r\n accessableNow[grid.y][grid.x] = 0\r\n```\r\nor rewrite `(b)` as:\r\n```python\r\n newPath, _ = finder.find_path(pfGrid.node(playerPosition[1], playerPosition[0]),\r\n                                        pfGrid.node(grid.y, grid.x, pfGrid) #(b)\r\n```\r\nLater, I refer to the `docs` but find nothing about parameter order.\r\nAs I look into the grid.py i found:\r\n```python\r\n       def node(self, x, y) -\u003e GridNode:\r\n        \"\"\"\r\n            get node at position\r\n            :param x: x pos\r\n            :param y: y pos\r\n            :return:\r\n        \"\"\"\r\n        return self.nodes[y][x]\r\n```\r\nBelow is what I suggest: Rearrangeing parameters `x` and `y` as the order they appear in the List indexes:\r\n```python\r\n       def node(self, y, x) -\u003e GridNode:\r\n           return self.nodes[y][x]\r\n```\r\nor rename them to the form `xi` where `i` is the order they appear in the indexes:\r\n```python\r\n       def node(self, x1, x2) -\u003e GridNode:\r\n           return self.nodes[x1][x2]\r\n```\r\nso that People who use the `pathfinding` can access a `node` not according to a specific name convention, but the order they pass parameters to these functions before. ","author":{"url":"https://github.com/XinyiLiu577086410","@type":"Person","name":"XinyiLiu577086410"},"datePublished":"2023-11-17T15:47:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/50/python-pathfinding/issues/50"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:48bb05bd-a705-7e60-1138-58feb443c66e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8E2E:245634:45036:5796A:698D2421
html-safe-nonceb76a6a2341347e5ea5bdcbe3b7178067bce0b80e48ed96b4453e84197451b39b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTJFOjI0NTYzNDo0NTAzNjo1Nzk2QTo2OThEMjQyMSIsInZpc2l0b3JfaWQiOiI0MjAzNzMwMzgxMjQzNzUzNTA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd51fe7773b7e156c816f20f88d89c20dc6dcaa3e3cfa50956d79b927d4d22c38
hovercard-subject-tagissue:1999423382
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/brean/python-pathfinding/50/issue_layout
twitter:imagehttps://opengraph.githubassets.com/796ae1cf2aad05876ea574e1e2dcfd84679d71b1552b5f732eb423d84e6db049/brean/python-pathfinding/issues/50
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/796ae1cf2aad05876ea574e1e2dcfd84679d71b1552b5f732eb423d84e6db049/brean/python-pathfinding/issues/50
og:image:altHi, It is my first time to use python-pathfinding, it's nice but sth make me confused... To be brief, I am writing a bot to play a game, this is what I try to do tonight: def ParseMap(map:List[Map]...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameXinyiLiu577086410
hostnamegithub.com
expected-hostnamegithub.com
Nonec25395580e1e3bf82d705e0982a1b24255366088720fef945f1493d5e3e67954
turbo-cache-controlno-preview
go-importgithub.com/brean/python-pathfinding git https://github.com/brean/python-pathfinding.git
octolytics-dimension-user_id229768
octolytics-dimension-user_loginbrean
octolytics-dimension-repository_id32716626
octolytics-dimension-repository_nwobrean/python-pathfinding
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id32716626
octolytics-dimension-repository_network_root_nwobrean/python-pathfinding
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1fa2bc33fc715bfb2cb9dd8a9cad4f811c16c371
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/50#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrean%2Fpython-pathfinding%2Fissues%2F50
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrean%2Fpython-pathfinding%2Fissues%2F50
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=brean%2Fpython-pathfinding
Reloadhttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/50
Reloadhttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/50
Reloadhttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/50
brean https://patch-diff.githubusercontent.com/brean
python-pathfindinghttps://patch-diff.githubusercontent.com/brean/python-pathfinding
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fbrean%2Fpython-pathfinding
Fork 73 https://patch-diff.githubusercontent.com/login?return_to=%2Fbrean%2Fpython-pathfinding
Star 370 https://patch-diff.githubusercontent.com/login?return_to=%2Fbrean%2Fpython-pathfinding
Code https://patch-diff.githubusercontent.com/brean/python-pathfinding
Issues 24 https://patch-diff.githubusercontent.com/brean/python-pathfinding/issues
Pull requests 0 https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulls
Actions https://patch-diff.githubusercontent.com/brean/python-pathfinding/actions
Projects 2 https://patch-diff.githubusercontent.com/brean/python-pathfinding/projects
Wiki https://patch-diff.githubusercontent.com/brean/python-pathfinding/wiki
Security 0 https://patch-diff.githubusercontent.com/brean/python-pathfinding/security
Insights https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulse
Code https://patch-diff.githubusercontent.com/brean/python-pathfinding
Issues https://patch-diff.githubusercontent.com/brean/python-pathfinding/issues
Pull requests https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulls
Actions https://patch-diff.githubusercontent.com/brean/python-pathfinding/actions
Projects https://patch-diff.githubusercontent.com/brean/python-pathfinding/projects
Wiki https://patch-diff.githubusercontent.com/brean/python-pathfinding/wiki
Security https://patch-diff.githubusercontent.com/brean/python-pathfinding/security
Insights https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/brean/python-pathfinding/issues/50
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/brean/python-pathfinding/issues/50
On names and parameter orders of coodinateshttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/50#top
good first issueGood for newcomershttps://github.com/brean/python-pathfinding/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
help wantedExtra attention is neededhttps://github.com/brean/python-pathfinding/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
questionFurther information is requestedhttps://github.com/brean/python-pathfinding/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com/XinyiLiu577086410
https://github.com/XinyiLiu577086410
XinyiLiu577086410https://github.com/XinyiLiu577086410
on Nov 17, 2023https://github.com/brean/python-pathfinding/issues/50#issue-1999423382
good first issueGood for newcomershttps://github.com/brean/python-pathfinding/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
help wantedExtra attention is neededhttps://github.com/brean/python-pathfinding/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
questionFurther information is requestedhttps://github.com/brean/python-pathfinding/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.