TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Help me on a fun little project?

1 点作者 bluemetal超过 15 年前
Hey HN, this morning I stumbled across a very basic flash version of Snake and decided to make a script that would play out the perfect game, even if it took a little while to rack up the points. If anything I'd learn a few little new skills and be able to confuse a friend with my impossible high scores.<p>After a quick Google I had learnt about and downloaded AutoHotKey (www.autohotkey.com), it seemed to promise what I would need and maybe after this I could use it for anything similar that might ever come up.<p>Armed with the help file that comes with the program I started on a very limited version of the script that used hard-coded time interval values to trigger the turns which proved to be useless because the slightest lag or activity on my computer made these totally inaccurate. A little disheartened I had a quick look though the documentation before giving up on the puzzle and stumbled across a command to get the pixel colour of a given coordinate, maybe my friend would get his ass kicked after all.<p>So far the script doesn't work but it gets awfully close. Around half way through worming its way around the grid one of the coordinates I calculate to turn the snake at slips over into the wrong grid square and never fires. (at least I think this is my problem)<p>I have tried a few changes which are now commented out because they seemed to make things worse. Rather than give up I figured maybe there was at least one person on HN that might get a kick out of something small like this so I decided to share it with you. If anyone can get it to work then even better.<p>Since my usual webhost is down at the moment I zipped up my stuff (the macro, some images of the game, the game itself and an open office document with a grid and highlights on the squares that the snake should make its moves at) and uploaded it to the first free upload site I found, hope it doesn't cause any problems.<p>If no one wants to download a .zip file I can go back and upload them all separately for you.<p>http://www.wikiupload.com/download_page.php?id=198583 (the goods)

暂无评论

暂无评论