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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: C4 – Connect Four, with AI

48 点作者 kenrick95超过 10 年前

14 条评论

kenrick95超过 10 年前
How I build this project: It was mid-2013 when I wanted to apply what I've learned from the MOOC CS188.1x Artificial Intelligence offered at edx.org. Around December 2013, I joined a bootcamp held in my university (Nanyang Technological University, Singapore) in which some of the speaker came from Mozilla. Here, I learned a lot of stuffs on JavaScript (they also introduced us to HN). Later, I thought of applying what I've learned to a game. I then started the project and finished it during January 2014.
评论 #8887710 未加载
评论 #8887528 未加载
smilliken超过 10 年前
We did a friendly programming competition at MixRank last year writing AIs for Connect Four.<p>It&#x27;s really a great game for playing with AI strategies since it&#x27;s so simple. You can borrow our game runner and write your own: <a href="https://github.com/smilliken/aigames/tree/master/connect-four" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;smilliken&#x2F;aigames&#x2F;tree&#x2F;master&#x2F;connect-fou...</a><p>You can use any language since it just talks over pipes. There&#x27;s a few bots in there you can play against.
评论 #8889874 未加载
RMarcus超过 10 年前
I wrote a C version of a connect 4 AI and used emscripten to build a JavaScript &#x2F; AngularJS version. You can check it out for comparison: <a href="http://rmarcus.info/blog/2014/12/23/connect4.html" rel="nofollow">http:&#x2F;&#x2F;rmarcus.info&#x2F;blog&#x2F;2014&#x2F;12&#x2F;23&#x2F;connect4.html</a><p>Edit --<p>Github is here: <a href="https://github.com/RyanMarcus/connect4" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RyanMarcus&#x2F;connect4</a><p>Looks like my AI beats your AI. ;)
评论 #8887848 未加载
cl42超过 10 年前
Not to be a pessimist, but Connect Four is a solved problem: <a href="http://en.wikipedia.org/wiki/Connect_Four" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Connect_Four</a> Wouldn&#x27;t that mean the best AI should always win if it&#x27;s first (alternatively, you should always win if you&#x27;re first)?
评论 #8890175 未加载
vapter超过 10 年前
Nice work! I was actually planning to do a similar project in the near future. However, it troubles me that I was able to win when your AI didn&#x27;t &quot;block&quot; me when I put 3 aligned circles. Shouldn&#x27;t that be the very first rule for such an AI?
评论 #8890209 未加载
austinhutch超过 10 年前
Finally got a win, took me about 10 rounds. Really cool thanks for sharing.
评论 #8888179 未加载
mlamat超过 10 年前
I won in the 2nd round.
lwgdhn超过 10 年前
Every once in a while a new game pops up on HN and I always pay the price in time. Not complaining!
hitchhiker999超过 10 年前
Note to future readers: This is how we ended up training our new robot overlords wasn&#x27;t it?
bluehazed超过 10 年前
Wow, I really suck at Connect Four.
kenrick超过 10 年前
Wow another developer named kenrick :)
评论 #8890217 未加载
noso超过 10 年前
Really nice work and very cool
JamyDev超过 10 年前
Nice, I just beat it :)
评论 #8887326 未加载
alacritythief超过 10 年前
I want to note that you can win every time by dropping wherever first, then on your next moves dropping every piece on top of the AI&#x27;s pieces.
评论 #8887707 未加载
评论 #8888876 未加载
评论 #8887979 未加载