Skip to content

Commit

Permalink
maybe final
Browse files Browse the repository at this point in the history
  • Loading branch information
HirojiFukuyama committed Jun 27, 2022
1 parent 2a89782 commit bada7b7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

中文名:用于二维模型的并行计算机

这是北京大学**程序设计实习**课程的QT大作业项目
本项目为北京大学**程序设计实习**课程的QT大作业

__作者__: 所以爱会消失对不队

Expand Down Expand Up @@ -45,7 +45,7 @@ __作者__: 所以爱会消失对不队
- [x] 修改单个细胞功能
- [x] 特殊图案功能
- [x] 菜单、帮助页面
- [ ] 更多玩法...
- [x] 更多玩法...

## Demo

Expand Down
2 changes: 1 addition & 1 deletion gamewig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void gameWig::evolve() {
deadTime[i][j]++;
}
}
else if (tmp == N) {
else if (tmp == N-1) {
if (liveTime[i][j] > autoDead) {
//活得太久了,要死去
tmpVal[i][j] = 0;
Expand Down
27 changes: 18 additions & 9 deletions help.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>420</width>
<height>404</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -16,8 +16,8 @@
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>40</x>
<y>260</y>
<x>60</x>
<y>360</y>
<width>341</width>
<height>32</height>
</rect>
Expand All @@ -32,18 +32,27 @@
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>70</x>
<y>41</y>
<width>256</width>
<height>201</height>
<x>25</x>
<y>21</y>
<width>371</width>
<height>321</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:24pt;&quot;&gt;详见&lt;/span&gt;&lt;a href=&quot;https://kryptonite.work/qt_game_of_life&quot;&gt;&lt;span style=&quot; font-size:24pt; text-decoration: underline; color:#0068da;&quot;&gt;项目网站&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:24pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;h1 style=&quot; margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:xx-large; font-weight:600;&quot;&gt;基础规则&lt;/span&gt;&lt;/h1&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;在网格中,每一个格点有0,1两种状态,并在每一个时刻进行一次演化。每次演化中,对任一个格点,其新状态由原有状态即其周围的8个邻居的状态唯一决定。设置中包含稀疏(a)、繁殖(b)、拥挤(c)三个变量,若邻居中1的个数x不大于a或不小于c都会导致该格被置为0;若邻居中1的个数恰好等于b,则该格会被置为1;否则不变。&lt;/p&gt;
&lt;h1 style=&quot; margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:xx-large; font-weight:600;&quot;&gt;预设图案&lt;/span&gt;&lt;/h1&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;这些图案都是基于预设规则(a=1,b=3,c=4)而预置的。&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;这些图案都有各自的稳定演化过程。其中除航空母舰外,其他的所有图案都将在各自的周期后以相同的结构移动一定距离;宇宙飞船能够清理飞行过程中路径旁的一些杂物;航空母舰则能周期性地发射出滑翔机。&lt;/p&gt;
&lt;h1 style=&quot; margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:xx-large; font-weight:600;&quot;&gt;高级设置&lt;/span&gt;&lt;/h1&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;高级设置给出更复杂的自定义规则框架。&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;千丝万缕&lt;/span&gt;允许你添加更多的状态,从而制定更为复杂的规则;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;凛冬已至&lt;/span&gt;规定每一个活细胞会在一定时间后自动消亡;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;不毛之地&lt;/span&gt;则代表一个活细胞死亡后,该格在一定时间内不能重新产生活细胞。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
Expand Down
2 changes: 1 addition & 1 deletion info.ui
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ p, li { white-space: pre-wrap; }
&lt;h1 style=&quot; margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:xx-large; font-weight:600;&quot;&gt;理论计算机意义&lt;/span&gt;&lt;/h1&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DengXian'; font-size:12pt;&quot;&gt;这类程序实际上就是所谓的元胞自动机。实际上,自然界几乎所有的复杂作用都可拆解为邻近的微小单元之间的相互作用。那么,由小的计算机或部件按邻域连接方式就可连接成较大的并行工作的计算机或部件。它不仅是形式上的并行计算机理论模型,同时也推进了细胞阵列形式集成电路的研究。&lt;/span&gt; &lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DengXian'; font-size:12pt;&quot;&gt;细胞自动机在识别技术上也有其应用。比如如果采用特定的规则,细胞可以应用各自的局部信息提取出全局特征。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DengXian'; font-size:12pt;&quot;&gt;项目仓库请参见&lt;/span&gt;&lt;a href=&quot;https://github.com/HirojiFukuyama/qt_game_of_life&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0068da;&quot;&gt;此处&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DengXian'; font-size:12pt;&quot;&gt;项目仓库请参见 https://github.com/HirojiFukuyama/qt_PC2DM&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
Expand Down

0 comments on commit bada7b7

Please sign in to comment.