这是正确的方法吗?
你好,我必须为“Game of Life”
游戏编写java代码。细胞的数量必须是无限的。 方法正确吗?我的意思是设计方面它们紧密耦合吗?
Class Universe
{
Cell cells[];
}
Class cell
{
boolean live;
}
Hi i have to write java code for the "Game of Life"
game. The number of cells must be infinite.
Is the approach correct? I mean Design wise are they tightly coupled?
Class Universe
{
Cell cells[];
}
Class cell
{
boolean live;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要“无限”数量的单元格,请使用某种类型的可扩展列表(ArrayList、LinkedList 等)。
但是,您只能分配计算机内存允许的尽可能多的单元格。
不太清楚紧密/松散耦合是什么意思......解释一下?
If you want an "infinite" amount of cells, then use some type of expandable list (ArrayList, LinkedList, etc).
However, you'll only be able to allocate as many cells as your computer memory will allow.
Don't really know what you mean by tightly/loosely coupled... explain?