Selaa lähdekoodia

Merge 678aa9e796e091eb95d44ea999bf9d214fc3d747 into 2286bf332a6a66859fa1ab1a7063f5e3ecc912fc

KATRINAHIGH 6 vuotta sitten
vanhempi
commit
939d135fa8
No account linked to committer's email

+ 1
- 1
.idea/misc.xml Näytä tiedosto

@@ -7,5 +7,5 @@
7 7
       </list>
8 8
     </option>
9 9
   </component>
10
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_9" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
10
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_9" default="false" project-jdk-name="9.0" project-jdk-type="JavaSDK" />
11 11
 </project>

+ 151
- 129
.idea/workspace.xml Näytä tiedosto

@@ -1,7 +1,12 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4
-    <list default="true" id="e282cee1-bfe9-42a3-9794-9633eb4654d1" name="Default" comment="" />
4
+    <list default="true" id="e282cee1-bfe9-42a3-9794-9633eb4654d1" name="Default" comment="">
5
+      <change beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
6
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
7
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/zipcodeconway/ConwayGameOfLife.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodeconway/ConwayGameOfLife.java" />
8
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/zipcodeconway/SimpleWindow.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodeconway/SimpleWindow.java" />
9
+    </list>
5 10
     <ignored path="$PROJECT_DIR$/target/" />
6 11
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
7 12
     <option name="TRACKING_ENABLED" value="true" />
@@ -11,12 +16,12 @@
11 16
     <option name="LAST_RESOLUTION" value="IGNORE" />
12 17
   </component>
13 18
   <component name="FileEditorManager">
14
-    <leaf>
19
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
15 20
       <file leaf-file-name="SimpleWindow.java" pinned="false" current-in-tab="false">
16 21
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/SimpleWindow.java">
17 22
           <provider selected="true" editor-type-id="text-editor">
18
-            <state relative-caret-position="289">
19
-              <caret line="17" column="42" lean-forward="false" selection-start-line="17" selection-start-column="42" selection-end-line="17" selection-end-column="42" />
23
+            <state relative-caret-position="90">
24
+              <caret line="6" column="24" lean-forward="true" selection-start-line="6" selection-start-column="24" selection-end-line="6" selection-end-column="24" />
20 25
               <folding>
21 26
                 <element signature="imports" expanded="true" />
22 27
               </folding>
@@ -24,18 +29,12 @@
24 29
           </provider>
25 30
         </entry>
26 31
       </file>
27
-      <file leaf-file-name="ConwayGameOfLife.java" pinned="false" current-in-tab="false">
32
+      <file leaf-file-name="ConwayGameOfLife.java" pinned="false" current-in-tab="true">
28 33
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/ConwayGameOfLife.java">
29 34
           <provider selected="true" editor-type-id="text-editor">
30
-            <state relative-caret-position="164">
31
-              <caret line="20" column="0" lean-forward="false" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
32
-              <folding>
33
-                <element signature="e#585#586#0" expanded="true" />
34
-                <element signature="e#676#677#0" expanded="true" />
35
-                <element signature="e#712#713#0" expanded="true" />
36
-                <element signature="e#1429#1430#0" expanded="true" />
37
-                <element signature="e#1453#1454#0" expanded="true" />
38
-              </folding>
35
+            <state relative-caret-position="360">
36
+              <caret line="24" column="8" lean-forward="false" selection-start-line="24" selection-start-column="8" selection-end-line="24" selection-end-column="8" />
37
+              <folding />
39 38
             </state>
40 39
           </provider>
41 40
         </entry>
@@ -47,12 +46,14 @@
47 46
               <ID>JAVA</ID>
48 47
               <OriginalElement>com.zipcodeconway.ConwayGameOfLife</OriginalElement>
49 48
               <nodes>
50
-                <node x="-54.0" y="-179.0">com.zipcodeconway.ConwayGameOfLife</node>
49
+                <node x="0.0" y="0.0">com.zipcodeconway.ConwayGameOfLife</node>
51 50
               </nodes>
52 51
               <notes />
53 52
               <edges />
54
-              <settings layout="Hierarchic Group" zoom="1.0" x="-203.0" y="-1.0" />
55
-              <SelectedNodes />
53
+              <settings layout="Hierarchic Group" zoom="1.0" x="94.5" y="-86.5" />
54
+              <SelectedNodes>
55
+                <node>com.zipcodeconway.ConwayGameOfLife</node>
56
+              </SelectedNodes>
56 57
               <Categories>
57 58
                 <Category>Constructors</Category>
58 59
                 <Category>Methods</Category>
@@ -63,12 +64,22 @@
63 64
           </provider>
64 65
         </entry>
65 66
       </file>
67
+      <file leaf-file-name="ConwayGameOfLifeTest.java" pinned="false" current-in-tab="false">
68
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodeconway/ConwayGameOfLifeTest.java">
69
+          <provider selected="true" editor-type-id="text-editor">
70
+            <state relative-caret-position="150">
71
+              <caret line="12" column="32" lean-forward="true" selection-start-line="12" selection-start-column="32" selection-end-line="12" selection-end-column="32" />
72
+              <folding />
73
+            </state>
74
+          </provider>
75
+        </entry>
76
+      </file>
66 77
       <file leaf-file-name="README.md" pinned="false" current-in-tab="false">
67
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/README.md">
78
+        <entry file="file://$PROJECT_DIR$/README.md">
68 79
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
69 80
             <state split_layout="SPLIT">
70
-              <first_editor relative-caret-position="236">
71
-                <caret line="52" column="194" lean-forward="false" selection-start-line="52" selection-start-column="194" selection-end-line="52" selection-end-column="194" />
81
+              <first_editor relative-caret-position="15">
82
+                <caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
72 83
                 <folding />
73 84
               </first_editor>
74 85
               <second_editor />
@@ -76,16 +87,6 @@
76 87
           </provider>
77 88
         </entry>
78 89
       </file>
79
-      <file leaf-file-name="ConwayGameOfLifeTest.java" pinned="false" current-in-tab="true">
80
-        <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodeconway/ConwayGameOfLifeTest.java">
81
-          <provider selected="true" editor-type-id="text-editor">
82
-            <state relative-caret-position="510">
83
-              <caret line="32" column="32" lean-forward="false" selection-start-line="32" selection-start-column="32" selection-end-line="32" selection-end-column="32" />
84
-              <folding />
85
-            </state>
86
-          </provider>
87
-        </entry>
88
-      </file>
89 90
     </leaf>
90 91
   </component>
91 92
   <component name="FileTemplateManagerImpl">
@@ -126,8 +127,8 @@
126 127
         <option value="$PROJECT_DIR$/src/main/java/ConwayGameOfLife.java" />
127 128
         <option value="$PROJECT_DIR$/src/main/java/Life.java" />
128 129
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodeconway/ConwayGameOfLifeTest.java" />
129
-        <option value="$PROJECT_DIR$/src/main/java/com/zipcodeconway/SimpleWindow.java" />
130 130
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodeconway/README.md" />
131
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcodeconway/SimpleWindow.java" />
131 132
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodeconway/ConwayGameOfLife.java" />
132 133
       </list>
133 134
     </option>
@@ -138,7 +139,7 @@
138 139
     <detection-done>true</detection-done>
139 140
     <sorting>DEFINITION_ORDER</sorting>
140 141
   </component>
141
-  <component name="ProjectFrameBounds">
142
+  <component name="ProjectFrameBounds" extendedState="6">
142 143
     <option name="x" value="82" />
143 144
     <option name="y" value="32" />
144 145
     <option name="width" value="1440" />
@@ -159,55 +160,57 @@
159 160
       <foldersAlwaysOnTop value="true" />
160 161
     </navigator>
161 162
     <panes>
163
+      <pane id="AndroidView" />
164
+      <pane id="Scope" />
162 165
       <pane id="ProjectPane">
163 166
         <subPane>
164 167
           <expand>
165 168
             <path>
166
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
167
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
169
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
170
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
168 171
             </path>
169 172
             <path>
170
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
171
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
173
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
174
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
172 175
               <item name="src" type="462c0819:PsiDirectoryNode" />
173 176
             </path>
174 177
             <path>
175
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
176
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
178
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
179
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
177 180
               <item name="src" type="462c0819:PsiDirectoryNode" />
178 181
               <item name="main" type="462c0819:PsiDirectoryNode" />
179 182
             </path>
180 183
             <path>
181
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
182
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
184
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
185
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
183 186
               <item name="src" type="462c0819:PsiDirectoryNode" />
184 187
               <item name="main" type="462c0819:PsiDirectoryNode" />
185 188
               <item name="java" type="462c0819:PsiDirectoryNode" />
186 189
             </path>
187 190
             <path>
188
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
189
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
191
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
192
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
190 193
               <item name="src" type="462c0819:PsiDirectoryNode" />
191 194
               <item name="main" type="462c0819:PsiDirectoryNode" />
192 195
               <item name="java" type="462c0819:PsiDirectoryNode" />
193 196
               <item name="zipcodeconway" type="462c0819:PsiDirectoryNode" />
194 197
             </path>
195 198
             <path>
196
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
197
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
199
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
200
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
198 201
               <item name="src" type="462c0819:PsiDirectoryNode" />
199 202
               <item name="test" type="462c0819:PsiDirectoryNode" />
200 203
             </path>
201 204
             <path>
202
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
203
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
205
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
206
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
204 207
               <item name="src" type="462c0819:PsiDirectoryNode" />
205 208
               <item name="test" type="462c0819:PsiDirectoryNode" />
206 209
               <item name="java" type="462c0819:PsiDirectoryNode" />
207 210
             </path>
208 211
             <path>
209
-              <item name="Game-Of-Life-Java" type="b2602c69:ProjectViewProjectNode" />
210
-              <item name="Game-Of-Life-Java" type="462c0819:PsiDirectoryNode" />
212
+              <item name="ConwayGameOfLife" type="b2602c69:ProjectViewProjectNode" />
213
+              <item name="ConwayGameOfLife" type="462c0819:PsiDirectoryNode" />
211 214
               <item name="src" type="462c0819:PsiDirectoryNode" />
212 215
               <item name="test" type="462c0819:PsiDirectoryNode" />
213 216
               <item name="java" type="462c0819:PsiDirectoryNode" />
@@ -218,16 +221,14 @@
218 221
         </subPane>
219 222
       </pane>
220 223
       <pane id="PackagesPane" />
221
-      <pane id="AndroidView" />
222 224
       <pane id="Scratches" />
223
-      <pane id="Scope" />
224 225
     </panes>
225 226
   </component>
226 227
   <component name="PropertiesComponent">
227 228
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
228 229
     <property name="WebServerToolWindowFactoryState" value="false" />
229 230
     <property name="aspect.path.notification.shown" value="true" />
230
-    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
231
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
231 232
     <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
232 233
     <property name="project.structure.last.edited" value="Modules" />
233 234
     <property name="project.structure.proportion" value="0.15" />
@@ -260,7 +261,7 @@
260 261
       </list>
261 262
     </option>
262 263
   </component>
263
-  <component name="RunManager" selected="JUnit.ConwayGameOfLifeTest">
264
+  <component name="RunManager" selected="Application.ConwayGameOfLife">
264 265
     <configuration default="true" type="Applet" factoryName="Applet">
265 266
       <option name="HTML_USED" value="false" />
266 267
       <option name="WIDTH" value="400" />
@@ -481,8 +482,8 @@
481 482
     </list>
482 483
     <recent_temporary>
483 484
       <list size="5">
484
-        <item index="0" class="java.lang.String" itemvalue="JUnit.ConwayGameOfLifeTest" />
485
-        <item index="1" class="java.lang.String" itemvalue="Application.ConwayGameOfLife" />
485
+        <item index="0" class="java.lang.String" itemvalue="Application.ConwayGameOfLife" />
486
+        <item index="1" class="java.lang.String" itemvalue="JUnit.ConwayGameOfLifeTest" />
486 487
         <item index="2" class="java.lang.String" itemvalue="JUnit.ConwayGameOfLifeTest.runTest2" />
487 488
         <item index="3" class="java.lang.String" itemvalue="JUnit.ConwayGameOfLifeTest.runTest" />
488 489
         <item index="4" class="java.lang.String" itemvalue="Application.GameofLife" />
@@ -503,13 +504,11 @@
503 504
       <option name="presentableId" value="Default" />
504 505
       <updated>1519668901598</updated>
505 506
       <workItem from="1519668902904" duration="14517000" />
507
+      <workItem from="1520900922785" duration="4605000" />
506 508
     </task>
507 509
     <servers />
508 510
   </component>
509 511
   <component name="TestHistory">
510
-    <history-entry file="ConwayGameOfLifeTest - 2018.02.26 at 15h 45m 01s.xml">
511
-      <configuration name="ConwayGameOfLifeTest" configurationId="JUnit" />
512
-    </history-entry>
513 512
     <history-entry file="ConwayGameOfLifeTest - 2018.02.26 at 15h 59m 00s.xml">
514 513
       <configuration name="ConwayGameOfLifeTest" configurationId="JUnit" />
515 514
     </history-entry>
@@ -525,6 +524,12 @@
525 524
     <history-entry file="ConwayGameOfLifeTest - 2018.02.26 at 16h 06m 11s.xml">
526 525
       <configuration name="ConwayGameOfLifeTest" configurationId="JUnit" />
527 526
     </history-entry>
527
+    <history-entry file="ConwayGameOfLifeTest - 2018.03.12 at 22h 10m 44s.xml">
528
+      <configuration name="ConwayGameOfLifeTest" configurationId="JUnit" />
529
+    </history-entry>
530
+    <history-entry file="ConwayGameOfLifeTest - 2018.03.12 at 22h 11m 05s.xml">
531
+      <configuration name="ConwayGameOfLifeTest" configurationId="JUnit" />
532
+    </history-entry>
528 533
     <history-entry file="ConwayGameOfLifeTest_runTest - 2018.02.26 at 15h 41m 14s.xml">
529 534
       <configuration name="ConwayGameOfLifeTest.runTest" configurationId="JUnit" />
530 535
     </history-entry>
@@ -536,39 +541,39 @@
536 541
     </history-entry>
537 542
   </component>
538 543
   <component name="TimeTrackingManager">
539
-    <option name="totallyTimeSpent" value="14517000" />
544
+    <option name="totallyTimeSpent" value="19122000" />
540 545
   </component>
541 546
   <component name="ToolWindowManager">
542
-    <frame x="82" y="32" width="1440" height="821" extended-state="0" />
547
+    <frame x="0" y="23" width="1280" height="722" extended-state="6" />
543 548
     <editor active="true" />
544 549
     <layout>
545
-      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
550
+      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
546 551
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
547
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32833788" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
548
-      <window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
549
-      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
550
-      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
551
-      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
552
-      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
553
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32561308" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
554
-      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
555
-      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32970026" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
556
-      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
557
-      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
558
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
559
-      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
552
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32833788" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
553
+      <window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
554
+      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
555
+      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
556
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
557
+      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
558
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32376397" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
559
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
560
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32970026" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
561
+      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
562
+      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
563
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2536349" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
564
+      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
560 565
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
561 566
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
562
-      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
563
-      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
567
+      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
568
+      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
564 569
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
565
-      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
570
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
566 571
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
567
-      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
568 572
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
569 573
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
570
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
574
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
571 575
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
576
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
572 577
     </layout>
573 578
   </component>
574 579
   <component name="TypeScriptGeneratedFilesManager">
@@ -584,42 +589,83 @@
584 589
     <watches-manager />
585 590
   </component>
586 591
   <component name="editorHistoryManager">
587
-    <entry file="file://$PROJECT_DIR$/pom.xml">
592
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/SimpleWindow.java">
588 593
       <provider selected="true" editor-type-id="text-editor">
589
-        <state relative-caret-position="187">
590
-          <caret line="11" column="10" lean-forward="false" selection-start-line="11" selection-start-column="10" selection-end-line="11" selection-end-column="10" />
594
+        <state relative-caret-position="240">
595
+          <caret line="17" column="42" lean-forward="false" selection-start-line="17" selection-start-column="42" selection-end-line="17" selection-end-column="42" />
596
+          <folding>
597
+            <element signature="imports" expanded="true" />
598
+          </folding>
599
+        </state>
600
+      </provider>
601
+    </entry>
602
+    <entry file="uml://JAVA/com.zipcodeconway.ConwayGameOfLife">
603
+      <provider selected="true" editor-type-id="UmlEditorProvider">
604
+        <state>
605
+          <ID>JAVA</ID>
606
+          <OriginalElement>com.zipcodeconway.ConwayGameOfLife</OriginalElement>
607
+          <nodes>
608
+            <node x="0.0" y="0.0">com.zipcodeconway.ConwayGameOfLife</node>
609
+          </nodes>
610
+          <notes />
611
+          <edges />
612
+          <settings layout="Hierarchic Group" zoom="1.0" x="94.5" y="-86.5" />
613
+          <SelectedNodes>
614
+            <node>com.zipcodeconway.ConwayGameOfLife</node>
615
+          </SelectedNodes>
616
+          <Categories>
617
+            <Category>Constructors</Category>
618
+            <Category>Methods</Category>
619
+          </Categories>
620
+          <SCOPE>All</SCOPE>
621
+          <VISIBILITY>private</VISIBILITY>
622
+        </state>
623
+      </provider>
624
+    </entry>
625
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/ConwayGameOfLife.java">
626
+      <provider selected="true" editor-type-id="text-editor">
627
+        <state relative-caret-position="300">
628
+          <caret line="20" column="0" lean-forward="false" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
591 629
           <folding />
592 630
         </state>
593 631
       </provider>
594 632
     </entry>
595
-    <entry file="file://$PROJECT_DIR$/src/main/java/LifeStarts.java">
633
+    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodeconway/ConwayGameOfLifeTest.java">
596 634
       <provider selected="true" editor-type-id="text-editor">
597
-        <state relative-caret-position="272">
598
-          <caret line="16" column="5" lean-forward="false" selection-start-line="7" selection-start-column="0" selection-end-line="16" selection-end-column="5" />
635
+        <state relative-caret-position="450">
636
+          <caret line="32" column="32" lean-forward="false" selection-start-line="32" selection-start-column="32" selection-end-line="32" selection-end-column="32" />
599 637
           <folding />
600 638
         </state>
601 639
       </provider>
602 640
     </entry>
603
-    <entry file="file://$PROJECT_DIR$/src/main/java/Life.java">
641
+    <entry file="file://$PROJECT_DIR$/pom.xml">
604 642
       <provider selected="true" editor-type-id="text-editor">
605
-        <state relative-caret-position="669">
606
-          <caret line="87" column="5" lean-forward="true" selection-start-line="47" selection-start-column="0" selection-end-line="87" selection-end-column="5" />
643
+        <state relative-caret-position="187">
644
+          <caret line="11" column="10" lean-forward="false" selection-start-line="11" selection-start-column="10" selection-end-line="11" selection-end-column="10" />
607 645
           <folding />
608 646
         </state>
609 647
       </provider>
610 648
     </entry>
649
+    <entry file="file://$PROJECT_DIR$/src/main/java/LifeStarts.java" />
650
+    <entry file="file://$PROJECT_DIR$/src/main/java/Life.java" />
651
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/README.md" />
652
+    <entry file="file://$USER_HOME$/Downloads/ConwayLifeRandomat50.png" />
653
+    <entry file="file://$USER_HOME$/Documents/gitea/gitea/custom/public/img/ConwayLifeUML.png" />
654
+    <entry file="file://$PROJECT_DIR$/src/main/java/GameofLife.java" />
611 655
     <entry file="uml://JAVA/com.zipcodeconway.ConwayGameOfLife">
612 656
       <provider selected="true" editor-type-id="UmlEditorProvider">
613 657
         <state>
614 658
           <ID>JAVA</ID>
615 659
           <OriginalElement>com.zipcodeconway.ConwayGameOfLife</OriginalElement>
616 660
           <nodes>
617
-            <node x="-54.0" y="-179.0">com.zipcodeconway.ConwayGameOfLife</node>
661
+            <node x="0.0" y="0.0">com.zipcodeconway.ConwayGameOfLife</node>
618 662
           </nodes>
619 663
           <notes />
620 664
           <edges />
621
-          <settings layout="Hierarchic Group" zoom="1.0" x="-203.0" y="-1.0" />
622
-          <SelectedNodes />
665
+          <settings layout="Hierarchic Group" zoom="1.0" x="94.5" y="-86.5" />
666
+          <SelectedNodes>
667
+            <node>com.zipcodeconway.ConwayGameOfLife</node>
668
+          </SelectedNodes>
623 669
           <Categories>
624 670
             <Category>Constructors</Category>
625 671
             <Category>Methods</Category>
@@ -629,39 +675,29 @@
629 675
         </state>
630 676
       </provider>
631 677
     </entry>
632
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/README.md">
678
+    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodeconway/ConwayGameOfLifeTest.java">
679
+      <provider selected="true" editor-type-id="text-editor">
680
+        <state relative-caret-position="150">
681
+          <caret line="12" column="32" lean-forward="true" selection-start-line="12" selection-start-column="32" selection-end-line="12" selection-end-column="32" />
682
+          <folding />
683
+        </state>
684
+      </provider>
685
+    </entry>
686
+    <entry file="file://$PROJECT_DIR$/README.md">
633 687
       <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
634 688
         <state split_layout="SPLIT">
635
-          <first_editor relative-caret-position="236">
636
-            <caret line="52" column="194" lean-forward="false" selection-start-line="52" selection-start-column="194" selection-end-line="52" selection-end-column="194" />
689
+          <first_editor relative-caret-position="15">
690
+            <caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
637 691
             <folding />
638 692
           </first_editor>
639 693
           <second_editor />
640 694
         </state>
641 695
       </provider>
642 696
     </entry>
643
-    <entry file="file://$USER_HOME$/Downloads/ConwayLifeRandomat50.png">
644
-      <provider selected="true" editor-type-id="images">
645
-        <state />
646
-      </provider>
647
-    </entry>
648
-    <entry file="file://$USER_HOME$/Documents/gitea/gitea/custom/public/img/ConwayLifeUML.png">
649
-      <provider selected="true" editor-type-id="images">
650
-        <state />
651
-      </provider>
652
-    </entry>
653
-    <entry file="file://$PROJECT_DIR$/src/main/java/GameofLife.java">
654
-      <provider selected="true" editor-type-id="text-editor">
655
-        <state relative-caret-position="334">
656
-          <caret line="83" column="17" lean-forward="false" selection-start-line="82" selection-start-column="30" selection-end-line="83" selection-end-column="17" />
657
-          <folding />
658
-        </state>
659
-      </provider>
660
-    </entry>
661 697
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/SimpleWindow.java">
662 698
       <provider selected="true" editor-type-id="text-editor">
663
-        <state relative-caret-position="289">
664
-          <caret line="17" column="42" lean-forward="false" selection-start-line="17" selection-start-column="42" selection-end-line="17" selection-end-column="42" />
699
+        <state relative-caret-position="90">
700
+          <caret line="6" column="24" lean-forward="true" selection-start-line="6" selection-start-column="24" selection-end-line="6" selection-end-column="24" />
665 701
           <folding>
666 702
             <element signature="imports" expanded="true" />
667 703
           </folding>
@@ -670,22 +706,8 @@
670 706
     </entry>
671 707
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodeconway/ConwayGameOfLife.java">
672 708
       <provider selected="true" editor-type-id="text-editor">
673
-        <state relative-caret-position="164">
674
-          <caret line="20" column="0" lean-forward="false" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
675
-          <folding>
676
-            <element signature="e#585#586#0" expanded="true" />
677
-            <element signature="e#676#677#0" expanded="true" />
678
-            <element signature="e#712#713#0" expanded="true" />
679
-            <element signature="e#1429#1430#0" expanded="true" />
680
-            <element signature="e#1453#1454#0" expanded="true" />
681
-          </folding>
682
-        </state>
683
-      </provider>
684
-    </entry>
685
-    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodeconway/ConwayGameOfLifeTest.java">
686
-      <provider selected="true" editor-type-id="text-editor">
687
-        <state relative-caret-position="510">
688
-          <caret line="32" column="32" lean-forward="false" selection-start-line="32" selection-start-column="32" selection-end-line="32" selection-end-column="32" />
709
+        <state relative-caret-position="360">
710
+          <caret line="24" column="8" lean-forward="false" selection-start-line="24" selection-start-column="8" selection-end-line="24" selection-end-column="8" />
689 711
           <folding />
690 712
         </state>
691 713
       </provider>

BIN
Screen Shot 2018-03-12 at 10.26.42 PM.png Näytä tiedosto


+ 94
- 8
src/main/java/com/zipcodeconway/ConwayGameOfLife.java Näytä tiedosto

@@ -2,33 +2,73 @@ package com.zipcodeconway;
2 2
 
3 3
 public class ConwayGameOfLife {
4 4
 
5
+    private int[][] currentGen;
6
+    private int[][] nextGen;
7
+    private SimpleWindow displayWindow;
8
+
5 9
     public ConwayGameOfLife(Integer dimension) {
6
-     }
10
+
11
+        currentGen = createRandomStart(dimension);
12
+        nextGen = new int[dimension][dimension];
13
+        this.displayWindow = new SimpleWindow(dimension);
14
+
15
+    }
7 16
 
8 17
     public ConwayGameOfLife(Integer dimension, int[][] startmatrix) {
18
+
19
+        currentGen = startmatrix;
20
+        nextGen = new int[dimension][dimension];
21
+        this.displayWindow = new SimpleWindow(dimension);
9 22
     }
10 23
 
11 24
     public static void main(String[] args) {
25
+        
12 26
         ConwayGameOfLife sim = new ConwayGameOfLife(50);
13 27
         int[][] endingWorld = sim.simulate(50);
14 28
     }
15 29
 
16
-    // Contains the logic for the starting scenario.
17
-    // Which cells are alive or dead in generation 0.
18
-    // allocates and returns the starting matrix of size 'dimension'
30
+
19 31
     private int[][] createRandomStart(Integer dimension) {
20
-        return new int[1][1];
32
+        int[][] newRandomArray = new int[dimension][dimension];
33
+        for (int row = 0; row < newRandomArray.length; row++) {
34
+            for (int column = 0; column < newRandomArray[row].length; column++) {
35
+                newRandomArray[row][column] = (int) (Math.random() * 2);
36
+            }
37
+        }
38
+        return newRandomArray;
21 39
     }
22 40
 
23 41
     public int[][] simulate(Integer maxGenerations) {
24
-        return new int[1][1];
42
+        int generations = 0;
43
+        while (generations <= maxGenerations) {
44
+            displayWindow.display(currentGen, generations);
45
+            for (int row = 0; row < currentGen.length; row++) {
46
+                for (int column = 0; column < currentGen[row].length; column++) {
47
+                    nextGen[row][column] = isAlive(row, column, currentGen);
48
+                }
49
+            }
50
+
51
+            copyAndZeroOut(nextGen, currentGen);
52
+            displayWindow.sleep(125);
53
+            generations++;
54
+
55
+        }
56
+        return currentGen;
25 57
     }
26 58
 
59
+
27 60
     // copy the values of 'next' matrix to 'current' matrix,
28 61
     // and then zero out the contents of 'next' matrix
29
-    public void copyAndZeroOut(int [][] next, int[][] current) {
62
+    public void copyAndZeroOut(int[][] next, int[][] current) {
63
+
64
+        for (int row = 0; row < current.length; row++)
65
+            for (int column = 0; column < current[row].length; column++) {
66
+                current[row][column] = next[row][column];
67
+                next[row][column] = 0;
68
+            }
30 69
     }
31 70
 
71
+
32 72
     // Calculate if an individual cell should be alive in the next generation.
33 73
     // Based on the game logic:
34 74
 	/*
@@ -38,6 +78,52 @@ public class ConwayGameOfLife {
38 78
 		Any dead cell with exactly three live neighbours cells will come to life.
39 79
 	*/
40 80
     private int isAlive(int row, int col, int[][] world) {
41
-        return 0;
81
+
82
+        int north = col - 1;
83
+        int south = col + 1;
84
+        int east = row + 1;
85
+        int west = row - 1;
86
+        int countNeighborAlive = 0;
87
+
88
+
89
+        if (north < 0) {
90
+            north = world[row].length - 1;
91
+        }
92
+        if (south == world[row].length) {
93
+            south = 0;
94
+        }
95
+        if (east == world[col].length) {
96
+            east = 0;
97
+        }
98
+        if (west < 0) {
99
+            west = world[col].length - 1;
100
+        }
101
+
102
+
103
+        //check how many neighbors are alive
104
+        if (world[east][north] == 1) countNeighborAlive++;
105
+        if (world[east][south] == 1) countNeighborAlive++;
106
+        if (world[east][col] == 1) countNeighborAlive++;
107
+
108
+        if (world[west][north] == 1) countNeighborAlive++;
109
+        if (world[west][south] == 1) countNeighborAlive++;
110
+        if (world[west][col] == 1) countNeighborAlive++;
111
+
112
+        if (world[row][north] == 1) countNeighborAlive++;
113
+        if (world[row][south] == 1) countNeighborAlive++;
114
+
115
+
116
+
117
+        if (countNeighborAlive < 2 || countNeighborAlive > 3) {
118
+            return 0;
119
+        } else if (countNeighborAlive == 3) {
120
+            return 1;
121
+        } else
122
+            return world[row][col];
42 123
     }
43 124
 }
125
+
126
+
127
+
128
+
129
+

+ 2
- 2
src/main/java/com/zipcodeconway/SimpleWindow.java Näytä tiedosto

@@ -39,11 +39,11 @@ public class SimpleWindow {
39 39
             for (int j = 0; j < array[0].length; j++) {
40 40
                 g.drawRect(i * BOX_DIM, j * BOX_DIM, 10, 10);
41 41
                 if (array[i][j] == 0) {
42
-                    g.setColor(Color.WHITE);
42
+                    g.setColor(Color.gray);
43 43
                     g.fillRect(i * BOX_DIM, j * BOX_DIM, 10, 10);
44 44
                 }
45 45
                 if (array[i][j] == 1) {
46
-                    g.setColor(Color.BLACK);
46
+                    g.setColor(Color.pink);
47 47
                     g.fillRect(i * BOX_DIM, j * BOX_DIM, 10, 10);
48 48
                 }
49 49
             }