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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Boxes

52 点作者 sidbatra大约 11 年前

20 条评论

ronaldx大约 11 年前
Current thoughts on strategy:<p>You shouldn&#x27;t care how you are affecting your opponent&#x27;s board (you are affecting it randomly). So just play for your own board.<p>On an empty board:<p><pre><code> The centre square is the most valuable, crossing 4 lines The diagonals are also valuable, crossing 3 lines All the other squares are equally not-valuable, crossing 2 lines. However - the squares change their value (a lot) depending on what your opponent plays. </code></pre> A good strategy is therefore to wait and see what your opponent plays, then greedily collect the lines that they nearly fill in by random chance.<p>To acheive this... fill the valuable squares: centre and diagonals, while your opponent fills other places randomly. I guess they are doing the same.<p>Once you&#x27;re done with the diagonals: fill the line which is most close to completed. This does not require too much thought - once you start filling a line, it&#x27;s nearly always right to keep filling it.<p>You can break ties between lines, where necessary, by looking at which crossing lines are nearly filled.<p>Although the robot has the advantage of seeing what the player plays, I believe the first move outweighs this advantage (especially on the larger boards?)
评论 #7789936 未加载
评论 #7786867 未加载
Cogito大约 11 年前
This was quite interesting, but it&#x27;s so annoying to see multiple 1 line comments from new accounts, and accounts that have very little history. Even more annoying, the older &quot;spammy&quot; accounts all seem to be linked to accredible, the site hosting the game. Over half the contributions on this page are from those accounts; <i>niveshi</i>, <i>lateguy</i>, <i>aheppenstall</i>, <i>ambitionvc</i>, <i>amarsaurabh</i>, <i>rachana318</i>.<p>Apart from all that, this looks like it would be fun to turn into a pure javascript clone. The network connection seems completely unnecessary, and it would be fun to create competing AIs.
评论 #7790650 未加载
hypersoar大约 11 年前
Neat! This was fun to think about.<p>Given the complete lack of relationship between the two matrices, the fact that you&#x27;re playing against a computer seems immaterial. You make a move, and then a random square is filled in. You lose if you don&#x27;t achieve the win condition in some number of turns (I wanna say around n^2&#x2F;2).<p>That said, here&#x27;s a greedy algorithm I&#x27;ve arrived at, similar (but not identical to) ronaldx&#x27;s:<p>For an unfilled point p on an unfinished line, define its value, v(p). There are a bunch of ways to do this, but one that I&#x27;ve thought of is: the number of x&#x27;s on all unfinished lines through that point.<p>1. Fill in the center square<p>2. Choose an unfinished line with a maximal number of x&#x27;s such that the sum of the values of all its unfilled points is &#x2F;maximal&#x2F;<p>3. Fill in a point p on that line with v(p) &#x2F;minimal&#x2F;<p>4. Goto: step 2<p>Reasoning for step 1: The center space opens up the most options, lying on more lines than any other point.<p>Reasoning for step 2: You want to pick a line to fill in. Moreover, you want the filling in of its points to benefit your efforts elsewhere as much as possible.<p>Reasoning for step 3: Now that you&#x27;ve picked a line, you&#x27;re going to fill in all its points. You pick the points in ascending order of value to give the robot as much time as possible to fill in the best points for you.
Glyptodon大约 11 年前
There should be an option to let the computer play first.
squidpie大约 11 年前
This is a good time, but it would be nice to see what the robot is doing, having their game board visible but no numbers showing would nice.
swang大约 11 年前
There is a bug in the game where if your search page 503s I lose a turn (computer takes a square, the square I clicked isn&#x27;t acknowledged).
waterfowl大约 11 年前
Was having fun but I think HN just killed it. Alas!
评论 #7786333 未加载
评论 #7786339 未加载
carb大约 11 年前
Why would you disable the context menu? For something so simple, this application&#x27;s front-end seems incredibly over-complicated.
farnsworth大约 11 年前
Fun! But why is the AI done server-side? So slow!
评论 #7787106 未加载
ahassan大约 11 年前
I&#x27;m kinda confused about how to win. Do I choose a number and if the computer also chooses that number, we both get X&#x27;s?
Oculus大约 11 年前
I think it&#x27;d be nice to see the NPC board even if it&#x27;s just a grid of blank squares.
rachana318大约 11 年前
@lateguy - am one of the developers. try figuring it out ;)
评论 #7786606 未加载
DanBC大约 11 年前
Is &quot;the robot&quot; just &quot;other humans&quot;?
评论 #7787017 未加载
nikunjk大约 11 年前
Exciting game. Please build a mobile version of this!
aheppenstall大约 11 年前
Really like it - what algorithm are you using for the robot?
评论 #7785980 未加载
ambitionvc大约 11 年前
Really cool!
niveshi大约 11 年前
This is awesome
ckarthikv大约 11 年前
Good stuff, addictive!
lateguy大约 11 年前
I beated till 3 levels, really cool. What algo you are using?
amarsaurabh大约 11 年前
I liked the game. Super cool stuff. Pretty addictive. I could cross level 4.