justjavac
V2EX  ›  问与答

贪吃蛇大结局,这个用了什么算法?

  •  
  •   justjavac · May 22, 2015 · 4872 views
    This topic created in 4192 days ago, the information mentioned may be changed or developed.

    今天在微博看到一张gif图,贪吃蛇大结局。
    http://ww3.sinaimg.cn/large/7ff49915gw1es9dtm5xnng208b08bdv0.gif

    这个用了什么算法?

    4 replies  •  2015-05-22 13:51:38 +08:00
    chenhui7373
    chenhui7373
    May 22, 2015
    1
    http://www.douban.com/group/topic/38324363/
    这去年在startup news发过,不知道是不是这个。
    mcone
    mcone
    May 22, 2015
    3
    哈哈 我去年看到这个图的时候,也考虑过这个问题,我写的很简单,主要是BFS+一些人工指定的启发式算法(后期用到的)

    既然楼上都丢了链接,我也丢一个吧,https://github.com/halida/snake-challenge/wiki, 我写完之后才发现的,感觉对我的启发很大

    另外建议楼主多用google
    invite
    invite
    May 22, 2015
    4
    很明显,这样的算法太弱了,搞那么复杂干嘛,直接像显示器那样,逐行扫描好了。来来回回,随便怎么搞了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   967 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:33 · PVG 06:33 · LAX 14:33 · JFK 17:33
    ♥ Do have faith in what you're doing.