├── LICENSE ├── README.md └── Reversi ├── Assembly-CSharp-vs.csproj ├── Assembly-CSharp.csproj ├── Assets ├── Resources.meta ├── Resources │ ├── Black Material.mat │ ├── Black Material.mat.meta │ ├── Black.prefab │ ├── Black.prefab.meta │ ├── Tile Material.mat │ ├── Tile Material.mat.meta │ ├── Tile.prefab │ ├── Tile.prefab.meta │ ├── White Material.mat │ ├── White Material.mat.meta │ ├── White.prefab │ └── White.prefab.meta ├── Scenes.meta ├── Scenes │ ├── Othello.unity │ └── Othello.unity.meta ├── Scripts.meta └── Scripts │ ├── AIManager.cs │ ├── AIManager.cs.meta │ ├── Board.cs │ ├── Board.cs.meta │ ├── CameraManager.cs │ ├── CameraManager.cs.meta │ ├── GameManager.cs │ ├── GameManager.cs.meta │ ├── MonteCarloNode.cs │ ├── MonteCarloNode.cs.meta │ ├── PlayerSettings.cs │ ├── PlayerSettings.cs.meta │ ├── Point.cs │ ├── Point.cs.meta │ ├── TileManager.cs │ ├── TileManager.cs.meta │ ├── UIManager.cs │ └── UIManager.cs.meta ├── Library ├── AnnotationManager ├── AssetImportState ├── AssetServerCacheV3 ├── AssetVersioning.db ├── BuildPlayer.prefs ├── BuildSettings.asset ├── CurrentLayout.dwlt ├── EditorUserBuildSettings.asset ├── EditorUserSettings.asset ├── FailedAssetImports.txt ├── InspectorExpandedItems.asset ├── MonoManager.asset ├── ProjectSettings.asset ├── ScriptAssemblies │ ├── Assembly-CSharp.dll │ ├── Assembly-CSharp.dll.mdb │ └── CompilationCompleted.txt ├── ScriptMapper ├── ShaderCache.db ├── assetDatabase3 ├── expandedItems ├── guidmapper └── metadata │ ├── 19 │ └── 195f2bd4bbdb8bf49ae679431bdc8cc7 │ ├── 38 │ └── 3877fd67e26f47446b900e5bf3950b6c │ ├── 39 │ └── 39b56086c12610448985df9d7f97ca44 │ ├── 54 │ └── 5412cae3a384b4b4882cc26799c86166 │ ├── 61 │ └── 61688de85be78394c900bf343d5fe373 │ ├── 80 │ └── 80a3616ca19596e4da0f10f14d241e9f │ ├── 93 │ └── 93a43d08ee7ca084e8a91de6d743b2d5 │ ├── 00 │ ├── 00000000000000001000000000000000 │ ├── 00000000000000002000000000000000 │ ├── 00000000000000003000000000000000 │ ├── 00000000000000004000000000000000 │ ├── 00000000000000004100000000000000 │ ├── 00000000000000005000000000000000 │ ├── 00000000000000005100000000000000 │ ├── 00000000000000006000000000000000 │ ├── 00000000000000006100000000000000 │ ├── 00000000000000007000000000000000 │ ├── 00000000000000008000000000000000 │ ├── 00000000000000009000000000000000 │ ├── 0000000000000000a000000000000000 │ ├── 0000000000000000b000000000000000 │ └── 0000000000000000c000000000000000 │ ├── 07 │ └── 0759df3291e498f4089d386c70545f98 │ ├── 0e │ └── 0e95b9e7440698947af8cbfa08335eef │ ├── 2b │ └── 2b7dc39a7d339364eaed72ea4d9ea32c │ ├── 2f │ └── 2f29827e3c029b44ebfb792ee989a1e9 │ ├── 3f │ └── 3faf4b5fb3378824f99d22dafd479388 │ ├── 7e │ └── 7e8dc0ef0f4226c43a3c41578bf57cc8 │ ├── ad │ └── ad13906e266c61a499ceac1f6e032cf0 │ ├── bc │ └── bc0e2f56b78cd7145977ea61b582d19e │ ├── c1 │ └── c1c2175f113618347800e5b507330c39 │ ├── d7 │ └── d77a0ca4b2a56bd498c058e0ea69b57c │ ├── d9 │ └── d96779b9f9185b74685f85c113ff00cc │ ├── f1 │ └── f13d63899ef4cab419cabf32052371cf │ ├── f5 │ └── f5f67c52d1564df4a8936ccd202a3bd8 │ └── fa │ └── fab4072002924b04c956860646777b3e ├── Othello-master-csharp.sln ├── Othello-master.sln ├── Othello-master.userprefs ├── Othello-master ├── .gitignore ├── Assets │ ├── Resources.meta │ ├── Resources │ │ ├── Black Material.mat │ │ ├── Black Material.mat.meta │ │ ├── Black.prefab │ │ ├── Black.prefab.meta │ │ ├── Tile Material.mat │ │ ├── Tile Material.mat.meta │ │ ├── Tile.prefab │ │ ├── Tile.prefab.meta │ │ ├── White.prefab │ │ └── White.prefab.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── Othello.unity │ │ └── Othello.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── AIManager.cs │ │ ├── AIManager.cs.meta │ │ ├── Board.cs │ │ ├── Board.cs.meta │ │ ├── CameraManager.cs │ │ ├── CameraManager.cs.meta │ │ ├── GameManager.cs │ │ ├── GameManager.cs.meta │ │ ├── PlayerSettings.cs │ │ ├── PlayerSettings.cs.meta │ │ ├── Point.cs │ │ ├── Point.cs.meta │ │ ├── TileManager.cs │ │ ├── TileManager.cs.meta │ │ ├── UIManager.cs │ │ └── UIManager.cs.meta ├── LICENSE.md ├── ProjectSettings │ ├── AudioManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshLayers.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── QualitySettings.asset │ ├── TagManager.asset │ └── TimeManager.asset └── README.md ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset └── sysinfo.txt /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | Copyright 2021 Scott larkin 179 | 180 | Licensed under the Apache License, Version 2.0 (the "License"); 181 | you may not use this file except in compliance with the License. 182 | You may obtain a copy of the License at 183 | 184 | http://www.apache.org/licenses/LICENSE-2.0 185 | 186 | Unless required by applicable law or agreed to in writing, software 187 | distributed under the License is distributed on an "AS IS" BASIS, 188 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 189 | See the License for the specific language governing permissions and 190 | limitations under the License. 191 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reversi---Monte-Carlo-Tree-Search-AI 2 | Implementation of a reversi game in the Unity engine using C#. This was for the "AI for games" module in my 3rd year of university. It uses a Monte Carlo tree search algorithm for the AI. 3 | -------------------------------------------------------------------------------- /Reversi/Assembly-CSharp-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_4_6_4;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_IL2CPP;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;UNITY5_SCRIPTING_IN_UNITY4;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN;UNITY_PRO_LICENSE 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 43 | 44 | 45 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | C:/Program Files (x86)/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.4/UnityEngine.UI.dll 60 | 61 | 62 | 63 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Reversi/Assembly-CSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_4_6_4;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_IL2CPP;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;UNITY5_SCRIPTING_IN_UNITY4;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN;UNITY_PRO_LICENSE 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 43 | 44 | 45 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | C:/Program Files (x86)/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.4/UnityEngine.UI.dll 60 | 61 | 62 | 63 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Reversi/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f29827e3c029b44ebfb792ee989a1e9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Black Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Assets/Resources/Black Material.mat -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Black Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d77a0ca4b2a56bd498c058e0ea69b57c 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Black.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Assets/Resources/Black.prefab -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Black.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d96779b9f9185b74685f85c113ff00cc 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Tile Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Assets/Resources/Tile Material.mat -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Tile Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad13906e266c61a499ceac1f6e032cf0 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Tile.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Assets/Resources/Tile.prefab -------------------------------------------------------------------------------- /Reversi/Assets/Resources/Tile.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e8dc0ef0f4226c43a3c41578bf57cc8 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Assets/Resources/White Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Assets/Resources/White Material.mat -------------------------------------------------------------------------------- /Reversi/Assets/Resources/White Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e95b9e7440698947af8cbfa08335eef 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Assets/Resources/White.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Assets/Resources/White.prefab -------------------------------------------------------------------------------- /Reversi/Assets/Resources/White.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93a43d08ee7ca084e8a91de6d743b2d5 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fab4072002924b04c956860646777b3e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Reversi/Assets/Scenes/Othello.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Assets/Scenes/Othello.unity -------------------------------------------------------------------------------- /Reversi/Assets/Scenes/Othello.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f13d63899ef4cab419cabf32052371cf 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc0e2f56b78cd7145977ea61b582d19e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/AIManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | public class AIManager : MonoBehaviour { 8 | 9 | private Board board; 10 | private GameManager manager; 11 | 12 | private static double Cp = 1/Mathf.Sqrt(2); 13 | public int numExpansions = 100; 14 | private double[,] lookupTable = new double[1500,1500]; 15 | 16 | private int numLookups = 0; 17 | private int numNoLookups = 0; 18 | 19 | void Awake() 20 | { 21 | manager = GameObject.Find("Managers").GetComponent(); 22 | 23 | board = GameObject.Find("Board").GetComponent(); 24 | 25 | for (int i = 1; i < 1500; ++i) 26 | for (int j = i; j < 1500; ++j) 27 | lookupTable[i,j] = (Cp * Math.Sqrt((Math.Log((double)i)) / (double)j )); 28 | 29 | 30 | } 31 | 32 | public double getRHS(int n, int nj){ 33 | if (n < 1500){ 34 | numLookups ++; 35 | return lookupTable[n, nj]; 36 | } 37 | numNoLookups++; 38 | return (2*Cp * Math.Sqrt((2*(Math.Log((double)n))) / (double)nj )); 39 | 40 | } 41 | 42 | // Generates and stores all available moves for whoever's turn it is 43 | 44 | // Returns the best possible computer move as a List, including the piece put down 45 | public List ComputerMove() 46 | { 47 | List computerMove = new List(); 48 | Point bestMove = new Point(); 49 | 50 | int mostPoints = 0; 51 | 52 | foreach (KeyValuePair> move in board.state.availableMoves) 53 | { 54 | if (move.Value.Count > mostPoints) 55 | { 56 | mostPoints = move.Value.Count; 57 | bestMove = move.Key; 58 | } 59 | // 50% chance to use an equally-viable move in order to shift the physical move distribution 60 | else if (move.Value.Count == mostPoints) 61 | { 62 | if (UnityEngine.Random.Range(0, 9) <= 4) 63 | { 64 | mostPoints = move.Value.Count; 65 | bestMove = move.Key; 66 | } 67 | } 68 | } 69 | 70 | board.state.availableMoves.TryGetValue(bestMove, out computerMove); 71 | // Have to add the move itself to the list of Points 72 | computerMove.Insert(0, bestMove); 73 | 74 | return computerMove; 75 | } 76 | 77 | public List ComputerMoveMTCS() 78 | { 79 | //Debug.Log ("computer move"); 80 | 81 | List computerMove = new List (); 82 | Point bestMove = new Point (); 83 | 84 | 85 | MonteCarloNode rootNode = new MonteCarloNode(manager.board.state, this); 86 | 87 | for (int i = 0; i < numExpansions; i++) { 88 | MonteCarloNode n = TreePolicy(rootNode); 89 | n.Backup (Simulate (n)); 90 | } 91 | //Debug.Log ("finished simulating"); 92 | MonteCarloNode maxNode = null; 93 | //Debug.Log ("maxnode set"); 94 | double maxVal = double.NegativeInfinity; 95 | 96 | foreach (MonteCarloNode node in rootNode.children) { 97 | if(node.timesVisited == 0){ 98 | continue; 99 | } 100 | if((double)node.score/(double)node.timesVisited > maxVal){ 101 | maxNode = new MonteCarloNode(node); 102 | maxVal = (double)node.score/(double)node.timesVisited; 103 | } 104 | } 105 | 106 | bestMove = maxNode.point; 107 | 108 | board.state.availableMoves.TryGetValue(bestMove, out computerMove); 109 | // Have to add the move itself to the list of Points 110 | computerMove.Insert(0, bestMove); 111 | 112 | return computerMove; 113 | } 114 | 115 | 116 | private MonteCarloNode TreePolicy(MonteCarloNode n) 117 | { 118 | MonteCarloNode v = n; 119 | 120 | while(v.board.availableMoves.Count != 0) 121 | { 122 | v.AddAvailableMoves(v.board.availableMoves.Keys.ToList()); 123 | if(v.availableMoves.Count != 0) 124 | { 125 | return v.Expand(); 126 | } 127 | else 128 | { 129 | v = v.BestChild(); 130 | } 131 | } 132 | return v; 133 | } 134 | 135 | 136 | public int Simulate(MonteCarloNode node) 137 | { 138 | //Debug.Log ("simulate" ); 139 | BoardState board = new BoardState(node.board); 140 | UnityEngine.Random.seed = (int)Time.timeSinceLevelLoad; 141 | board.GenerateAvailableMoves(); 142 | while (board.availableMoves.Count != 0) { 143 | List moves = board.availableMoves.Keys.ToList(); 144 | int i = UnityEngine.Random.Range(0,moves.Count - 1); 145 | 146 | //List p = new List();W 147 | 148 | /*if(!board.AvailableMove(moves[i], ref p)) 149 | { 150 | 151 | } 152 | 153 | Debug.Log (i + " " + moves.Count() );*/ 154 | 155 | board.ApplyMove(board.PlacePiece(moves[i])); 156 | board.GenerateAvailableMoves(); 157 | } 158 | //Debug.Log ("simulated"); 159 | if(board.WhiteCount>board.BlackCount) 160 | return 1; 161 | else if(board.WhiteCount>board.BlackCount) 162 | return-1; 163 | else 164 | return 0; 165 | 166 | } 167 | } 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/AIManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 195f2bd4bbdb8bf49ae679431bdc8cc7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/Board.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | public class BoardState 7 | { 8 | [HideInInspector] public enum Piece { None, Black, White }; 9 | [HideInInspector] public enum GameTurn { Player, Computer }; 10 | 11 | public GameTurn turn; 12 | 13 | public Piece[][] pieces; 14 | 15 | public GameObject Tile; 16 | 17 | public int Size; 18 | 19 | public int Count; 20 | public int pieceCount, WhiteCount, BlackCount; 21 | 22 | public bool GameTied; 23 | public bool GameOver; 24 | 25 | public bool PossibleToMove; 26 | 27 | public bool WhiteCantMove; 28 | public bool BlackCantMove; 29 | 30 | public Dictionary> availableMoves; 31 | 32 | public BoardState() 33 | { 34 | WhiteCantMove = false; 35 | BlackCantMove = false; 36 | 37 | Count = 0; 38 | 39 | pieceCount = 0; 40 | BlackCount = 0; 41 | WhiteCount = 0; 42 | // Dictionary that holds 43 | availableMoves = new Dictionary>(); 44 | 45 | GameOver = false; 46 | GameTied = false; 47 | PossibleToMove = false; 48 | } 49 | 50 | public void InitPieces() 51 | { 52 | pieces = new Piece[Size][]; 53 | 54 | for(int i = 0; i 85 | availableMoves = new Dictionary>(); 86 | 87 | GameOver = false; 88 | GameTied = false; 89 | PossibleToMove = bs.PossibleToMove; 90 | GenerateAvailableMoves(); 91 | } 92 | 93 | public List PlacePiece(Point coord) 94 | { 95 | List changedPieces = new List(); 96 | 97 | if(!availableMoves.TryGetValue(coord, out changedPieces)) 98 | { 99 | Debug.Log("try get fail " + coord.X + " " + coord.Y ); 100 | } 101 | 102 | changedPieces.Insert(0, coord); 103 | 104 | return changedPieces ?? new List(); 105 | } 106 | 107 | // Converts board pieces following a move 108 | public void ApplyMove(List PiecesToConvert) 109 | { 110 | 111 | if (PiecesToConvert.Count > 0) { 112 | foreach (Point point in PiecesToConvert) { 113 | WhiteCount = (turn.Equals (GameTurn.Player)) ? WhiteCount + 1 : WhiteCount - 1; 114 | BlackCount = (turn.Equals (GameTurn.Computer)) ? BlackCount + 1 : BlackCount - 1; 115 | 116 | pieces [point.X] [point.Y] = (turn.Equals (GameTurn.Player)) ? Piece.White : Piece.Black; 117 | } 118 | 119 | if (turn.Equals (GameTurn.Player)) { 120 | BlackCount++; 121 | } else { 122 | WhiteCount++; 123 | } 124 | // Adds placed piece to the total count 125 | pieceCount++; 126 | } 127 | 128 | } 129 | // Generates and stores all available moves for whoever's turn it is 130 | public void GenerateAvailableMoves() 131 | { 132 | availableMoves.Clear(); 133 | PossibleToMove = false; 134 | 135 | for (int x = 0; x < Size; x++) 136 | { 137 | for (int y = 0; y < Size; y++) 138 | { 139 | if (pieces[x][y] == Piece.None) 140 | { 141 | List moves = new List(); 142 | Point coord = new Point(x, y); 143 | 144 | AvailableUp(coord, ref moves); 145 | AvailableUpRight(coord, ref moves); 146 | AvailableRight(coord, ref moves); 147 | AvailableDownRight(coord, ref moves); 148 | AvailableDown(coord, ref moves); 149 | AvailableDownLeft(coord, ref moves); 150 | AvailableLeft(coord, ref moves); 151 | AvailableUpLeft(coord, ref moves); 152 | 153 | if (moves.Count > 0) 154 | { 155 | // If move converts at least 1 piece, add move to the dictionary of 156 | availableMoves.Add(coord, moves); 157 | PossibleToMove = true; 158 | } 159 | } 160 | } 161 | } 162 | 163 | } 164 | 165 | // Returns whether or not move is available, and if so stores list of Points to convert 166 | public bool AvailableMove(Point coord, ref List PiecesToConvert) 167 | { 168 | if (availableMoves.TryGetValue(coord, out PiecesToConvert)) 169 | { 170 | // Have to add the original move to the pieces to convert 171 | PiecesToConvert.Insert(0, coord); 172 | return true; 173 | } 174 | else 175 | { 176 | Debug.Log("Could not retrieve move " + coord.X + "," + coord.Y); 177 | return false; 178 | } 179 | } 180 | 181 | // Checks whether the game is over; i.e., lost/won or tied 182 | public int? CheckGameOver() 183 | { 184 | 185 | if ((WhiteCount == 0 || BlackCount == 0) || pieceCount == ( Size * Size)) 186 | { 187 | GameOver = true; 188 | 189 | //enabled = ! enabled; 190 | 191 | return WhiteCount > BlackCount ? 1 : -1; 192 | } 193 | 194 | if (WhiteCantMove && BlackCantMove) 195 | { 196 | GameTied = true; 197 | 198 | //enabled = ! enabled; 199 | 200 | return 0; 201 | } 202 | 203 | return null; 204 | } 205 | 206 | 207 | private void AvailableUp(Point coord, ref List PiecesToConvert) 208 | { 209 | Queue pieceQueue = new Queue(); 210 | bool foundPlayerPiece = false; 211 | Piece pieceToCheck = (turn == GameTurn.Player) ? Piece.White : Piece.Black; 212 | 213 | if (coord.Y != Size - 1) 214 | { 215 | for (int newY = coord.Y + 1; newY < Size; newY++) 216 | { 217 | if (pieces[coord.X][newY].Equals(Piece.None)) 218 | { 219 | return; 220 | } 221 | else if (pieces[coord.X][newY].Equals(pieceToCheck)) 222 | { 223 | foundPlayerPiece = true; 224 | break; 225 | } 226 | else 227 | { 228 | pieceQueue.Enqueue(new Point(coord.X, newY)); 229 | } 230 | } 231 | 232 | if (foundPlayerPiece) 233 | { 234 | while (pieceQueue.Count > 0) 235 | { 236 | PiecesToConvert.Add(pieceQueue.Dequeue()); 237 | } 238 | } 239 | } 240 | } 241 | 242 | private void AvailableUpRight(Point coord, ref List PiecesToConvert) 243 | { 244 | Queue pieceQueue = new Queue(); 245 | bool foundPlayerPiece = false; 246 | Piece pieceToCheck = (turn == GameTurn.Player) ? Piece.White : Piece.Black; 247 | 248 | if (coord.X != Size -1 && coord.Y != Size - 1) 249 | { 250 | for (int newX = coord.X + 1, newY = coord.Y + 1; newX < Size && newY < Size; newX++, newY++) 251 | { 252 | if (pieces[newX][newY].Equals(Piece.None)) 253 | { 254 | return; 255 | } 256 | else if (pieces[newX][newY].Equals(pieceToCheck)) 257 | { 258 | foundPlayerPiece = true; 259 | break; 260 | } 261 | else 262 | { 263 | pieceQueue.Enqueue(new Point(newX, newY)); 264 | } 265 | } 266 | 267 | if (foundPlayerPiece) 268 | { 269 | while (pieceQueue.Count > 0) 270 | { 271 | PiecesToConvert.Add(pieceQueue.Dequeue()); 272 | } 273 | } 274 | } 275 | } 276 | 277 | private void AvailableRight(Point coord, ref List PiecesToConvert) 278 | { 279 | Queue pieceQueue = new Queue(); 280 | bool foundPlayerPiece = false; 281 | Piece pieceToCheck = (turn == GameTurn.Player) ? Piece.White : Piece.Black; 282 | 283 | if (coord.X != Size - 1) 284 | { 285 | for (int newX = coord.X + 1; newX < Size; newX++) 286 | { 287 | if (pieces[newX][coord.Y].Equals(Piece.None)) 288 | { 289 | return; 290 | } 291 | else if (pieces[newX][coord.Y].Equals(pieceToCheck)) 292 | { 293 | foundPlayerPiece = true; 294 | break; 295 | } 296 | else 297 | { 298 | pieceQueue.Enqueue(new Point(newX, coord.Y)); 299 | } 300 | } 301 | 302 | if (foundPlayerPiece) 303 | { 304 | while (pieceQueue.Count > 0) 305 | { 306 | PiecesToConvert.Add(pieceQueue.Dequeue()); 307 | } 308 | } 309 | } 310 | } 311 | 312 | private void AvailableDownRight(Point coord, ref List PiecesToConvert) 313 | { 314 | Queue pieceQueue = new Queue(); 315 | bool foundPlayerPiece = false; 316 | Piece pieceToCheck = (turn == GameTurn.Player) ? Piece.White : Piece.Black; 317 | 318 | if (coord.X != Size - 1 && coord.Y != 0) 319 | { 320 | for (int newX = coord.X + 1, newY = coord.Y - 1; newX < Size && newY >= 0; newX++, newY--) 321 | { 322 | if (pieces[newX][newY].Equals(Piece.None)) 323 | { 324 | return; 325 | } 326 | else if (pieces[newX][newY].Equals(pieceToCheck)) 327 | { 328 | foundPlayerPiece = true; 329 | break; 330 | } 331 | else 332 | { 333 | pieceQueue.Enqueue(new Point(newX, newY)); 334 | } 335 | } 336 | 337 | if (foundPlayerPiece) 338 | { 339 | while (pieceQueue.Count > 0) 340 | { 341 | PiecesToConvert.Add(pieceQueue.Dequeue()); 342 | } 343 | } 344 | } 345 | } 346 | 347 | private void AvailableDown(Point coord, ref List PiecesToConvert) 348 | { 349 | Queue pieceQueue = new Queue(); 350 | bool foundPlayerPiece = false; 351 | Piece pieceToCheck = (turn == GameTurn.Player) ? Piece.White : Piece.Black; 352 | 353 | if (coord.Y != 0) 354 | { 355 | for (int newY = coord.Y - 1; newY >= 0; newY--) 356 | { 357 | if (pieces[coord.X][newY].Equals(Piece.None)) 358 | { 359 | return; 360 | } 361 | else if (pieces[coord.X][newY].Equals(pieceToCheck)) 362 | { 363 | foundPlayerPiece = true; 364 | break; 365 | } 366 | else 367 | { 368 | pieceQueue.Enqueue(new Point(coord.X, newY)); 369 | } 370 | } 371 | 372 | if (foundPlayerPiece) 373 | { 374 | while (pieceQueue.Count > 0) 375 | { 376 | PiecesToConvert.Add(pieceQueue.Dequeue()); 377 | } 378 | } 379 | } 380 | } 381 | 382 | private void AvailableDownLeft(Point coord, ref List PiecesToConvert) 383 | { 384 | Queue pieceQueue = new Queue(); 385 | bool foundPlayerPiece = false; 386 | Piece pieceToCheck = (turn == GameTurn.Player) ? Piece.White : Piece.Black; 387 | 388 | if (coord.X != 0 && coord.Y != 0) 389 | { 390 | for (int newX = coord.X - 1, newY = coord.Y - 1; newX >= 0 && newY >= 0; newX--, newY--) 391 | { 392 | if (pieces[newX][newY].Equals(Piece.None)) 393 | { 394 | return; 395 | } 396 | else if (pieces[newX][newY].Equals(pieceToCheck)) 397 | { 398 | foundPlayerPiece = true; 399 | break; 400 | } 401 | else 402 | { 403 | pieceQueue.Enqueue(new Point(newX, newY)); 404 | } 405 | } 406 | 407 | if (foundPlayerPiece) 408 | { 409 | while (pieceQueue.Count > 0) 410 | { 411 | PiecesToConvert.Add(pieceQueue.Dequeue()); 412 | } 413 | } 414 | } 415 | } 416 | 417 | private void AvailableLeft(Point coord, ref List PiecesToConvert) 418 | { 419 | Queue pieceQueue = new Queue(); 420 | bool foundPlayerPiece = false; 421 | Piece pieceToCheck = (turn == GameTurn.Player) ?Piece.White : Piece.Black; 422 | 423 | if (coord.X != 0) 424 | { 425 | for (int newX = coord.X - 1; newX >= 0; newX--) 426 | { 427 | if (pieces[newX][coord.Y].Equals(Piece.None)) 428 | { 429 | return; 430 | } 431 | else if (pieces[newX][coord.Y].Equals(pieceToCheck)) 432 | { 433 | foundPlayerPiece = true; 434 | break; 435 | } 436 | else 437 | { 438 | pieceQueue.Enqueue(new Point(newX, coord.Y)); 439 | } 440 | } 441 | 442 | if (foundPlayerPiece) 443 | { 444 | while (pieceQueue.Count > 0) 445 | { 446 | PiecesToConvert.Add(pieceQueue.Dequeue()); 447 | } 448 | } 449 | } 450 | } 451 | 452 | private void AvailableUpLeft(Point coord, ref List PiecesToConvert) 453 | { 454 | Queue pieceQueue = new Queue(); 455 | bool foundPlayerPiece = false; 456 | Piece pieceToCheck = (turn == GameTurn.Player) ? Piece.White : Piece.Black; 457 | 458 | if (coord.X != 0 && coord.Y != Size - 1) 459 | { 460 | for (int newX = coord.X - 1, newY = coord.Y + 1; newX >= 0 && newY < Size - 1; newX--, newY++) 461 | { 462 | if (pieces[newX][newY].Equals(Piece.None)) 463 | { 464 | return; 465 | } 466 | else if (pieces[newX][newY].Equals(pieceToCheck)) 467 | { 468 | foundPlayerPiece = true; 469 | break; 470 | } 471 | else 472 | { 473 | pieceQueue.Enqueue(new Point(newX, newY)); 474 | } 475 | } 476 | 477 | if (foundPlayerPiece) 478 | { 479 | while (pieceQueue.Count > 0) 480 | { 481 | PiecesToConvert.Add(pieceQueue.Dequeue()); 482 | } 483 | } 484 | } 485 | } 486 | }; 487 | 488 | public class Board : MonoBehaviour { 489 | 490 | public BoardState state; 491 | 492 | public GameManager gameManager; 493 | public UIManager uiManager; 494 | 495 | public GameObject[][] board; 496 | 497 | public GameObject Tile; 498 | 499 | public float Offset { get; private set; } 500 | 501 | void Awake() 502 | { 503 | Offset = 0.05f; 504 | gameManager = GameObject.Find("Managers").GetComponent(); 505 | uiManager = Camera.main.GetComponent(); 506 | state = new BoardState(); 507 | 508 | } 509 | 510 | // Sets board dimensions 511 | public void SetBoardDimensions(int boardSize) 512 | { 513 | Camera.main.GetComponent().enabled = true; 514 | 515 | state.Size = boardSize; 516 | state.InitPieces(); 517 | CreateBoard(); 518 | } 519 | 520 | // Creates game board 521 | private void CreateBoard() 522 | { 523 | InitializeBoard(); 524 | InstantiateBoard(); 525 | } 526 | 527 | // Returns the position of the tile in the world 528 | public Vector3 WorldPosition(float x, float y) 529 | { 530 | float xCoord = (x == 0) ? x + .5f : x + .5f + (Offset * x); 531 | float yCoord = (y == 0) ? y + .5f : y + .5f + (Offset * y); 532 | 533 | return new Vector3(xCoord, yCoord, -1); 534 | } 535 | 536 | // Initializes the GameObject[][] with board tiles 537 | private void InitializeBoard() 538 | { 539 | board = new GameObject[state.Size][]; 540 | 541 | for (int x = 0; x < state.Size; x++) 542 | { 543 | board[x] = new GameObject[state.Size]; 544 | 545 | for (int y = 0; y < state.Size; y++) 546 | { 547 | board[x][y] = Tile; 548 | } 549 | } 550 | } 551 | 552 | // Instantiates the board tiles 553 | private void InstantiateBoard() 554 | { 555 | for (int x = 0; x < state.Size; x++) 556 | { 557 | float xCoord = (x == 0) ? x + .5f : x + .5f + (Offset * x); 558 | 559 | for (int y = 0; y < state.Size; y++) 560 | { 561 | float yCoord = (y == 0) ? y + .5f : y + .5f + (Offset * y); 562 | 563 | Vector3 position = new Vector3(xCoord, yCoord, 0); 564 | Instantiate(board[x][y], position, Quaternion.identity); 565 | } 566 | } 567 | } 568 | } 569 | 570 | 571 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/Board.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0759df3291e498f4089d386c70545f98 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/CameraManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class CameraManager : MonoBehaviour { 5 | 6 | private Board board; 7 | 8 | void Awake() 9 | { 10 | board = GameObject.Find("Board").GetComponent(); 11 | } 12 | 13 | void Update() 14 | { 15 | // Camera zoom 16 | if (Input.GetAxis("Mouse ScrollWheel") < 0) // Mousewheeldown -> Zoom out 17 | { 18 | Camera.main.orthographicSize += 1; 19 | } 20 | if (Input.GetAxis("Mouse ScrollWheel") > 0) // Mousewheelup -> Zoom in 21 | { 22 | if (Camera.main.orthographicSize - 1 > 0) // Prevents player from zooming orthographic size to a negative number 23 | { 24 | Camera.main.orthographicSize -= 1; 25 | } 26 | } 27 | 28 | // Camera drag using arrow + WASD keys 29 | float vertical = Input.GetAxis("Vertical"); 30 | float horizontal = Input.GetAxis("Horizontal"); 31 | 32 | if (vertical != 0 || horizontal != 0) 33 | { 34 | Vector3 distToMove = new Vector3(horizontal / Camera.main.orthographicSize, vertical / Camera.main.orthographicSize); 35 | 36 | transform.Translate(distToMove, Space.World); 37 | } 38 | } 39 | 40 | // Camera initialization 41 | public void SetCamera() 42 | { 43 | Camera.main.transform.position = new Vector3((board.state.Size / 2) + ((board.state.Size / 2) * board.Offset), (board.state.Size / 2) + ((board.state.Size / 2) * board.Offset), -10); 44 | Camera.main.orthographicSize = (board.state.Size / 2) + (((board.state.Size / 2) - 1) * board.Offset); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/CameraManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61688de85be78394c900bf343d5fe373 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/GameManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | //using UnityEditor; 3 | 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Threading; 7 | using System.Reflection; 8 | 9 | public class GameManager : MonoBehaviour { 10 | 11 | 12 | 13 | public Board board; 14 | private AIManager aiManager; 15 | private PlayerSettings playerSettings; 16 | private CameraManager cameraManager; 17 | private UIManager uiManager; 18 | 19 | public GameObject[][] pieceGameObjects; 20 | 21 | [HideInInspector] public GameObject black, white; 22 | 23 | private Point playerMove; 24 | 25 | void Awake() 26 | { 27 | aiManager = GameObject.Find("Managers").GetComponent(); 28 | uiManager = Camera.main.GetComponent(); 29 | playerSettings = Camera.main.GetComponent(); 30 | cameraManager = Camera.main.GetComponent(); 31 | 32 | board = GameObject.Find("Board").GetComponent(); 33 | black = (GameObject)Resources.Load("Black"); 34 | white = (GameObject)Resources.Load("White"); 35 | 36 | board.state.turn = BoardState.GameTurn.Player; 37 | 38 | playerMove = null; 39 | } 40 | 41 | // Initializes board and camera, and starts main game loop 42 | IEnumerator Start() 43 | { 44 | // Gets player settings for board size 45 | yield return StartCoroutine(playerSettings.SettingsButton()); 46 | 47 | InitializePieces(); 48 | InstantiatePieces(); 49 | 50 | cameraManager.SetCamera(); 51 | 52 | StartCoroutine(GameLoop()); 53 | } 54 | 55 | // Main game loop handling turns 56 | private IEnumerator GameLoop() 57 | { 58 | // Run game loop while the game isn't over (won/lost) or tied 59 | while (!board.state.GameOver && !board.state.GameTied) 60 | { 61 | board.state.turn = BoardState.GameTurn.Player; 62 | 63 | List PiecesToConvert_Player = new List(); 64 | board.state.GenerateAvailableMoves(); 65 | 66 | if (board.state.PossibleToMove) 67 | { 68 | board.state.WhiteCantMove = false; 69 | 70 | while (playerMove == null) 71 | { 72 | yield return null; 73 | } 74 | // Clears the debug log 75 | // ClearLog(); 76 | 77 | Debug.Log("Player's turn."); 78 | 79 | if (board.state.AvailableMove(playerMove, ref PiecesToConvert_Player)) 80 | { 81 | Debug.Log("Converting pieces from " + playerMove.X + "," + playerMove.Y); 82 | ConvertPieces(PiecesToConvert_Player); 83 | Debug.Log("converted pieces from player"); 84 | } 85 | else 86 | { 87 | StartCoroutine(uiManager.ShowMessage("Invalid move.", 1)); 88 | playerMove = null; 89 | continue; 90 | } 91 | //Debug.Log("Done player move"); 92 | } 93 | else 94 | { 95 | Debug.Log("No possible player moves."); 96 | StartCoroutine(uiManager.ShowMessage("Player is unable to move.", 1)); 97 | board.state.WhiteCantMove = true; 98 | } 99 | 100 | 101 | yield return new WaitForSeconds(0.5f); 102 | 103 | 104 | // Check whether game over before computer turn 105 | //Debug.Log ("checking game over"); 106 | GameOver(board.state.CheckGameOver()); 107 | 108 | if (!board.state.GameOver) 109 | { 110 | Debug.Log("Computer's turn."); 111 | List PiecesToConvert_Computer = new List(); 112 | 113 | board.state.turn = BoardState.GameTurn.Computer; 114 | board.state.GenerateAvailableMoves(); 115 | 116 | // If the computer can move, make the best possible move 117 | if (board.state.PossibleToMove) 118 | { 119 | board.state.BlackCantMove = false; 120 | 121 | PiecesToConvert_Computer = aiManager.ComputerMoveMTCS(); 122 | 123 | Debug.Log("Converting pieces from " + PiecesToConvert_Computer[0].X + "," + PiecesToConvert_Computer[0].Y); 124 | ConvertPieces(PiecesToConvert_Computer); 125 | 126 | } 127 | else 128 | { 129 | Debug.Log("No possible computer moves."); 130 | StartCoroutine(uiManager.ShowMessage("Computer is unable to move.", 1)); 131 | board.state.BlackCantMove = true; 132 | } 133 | } 134 | // Check whether game over before player turn 135 | 136 | GameOver(board.state.CheckGameOver()); 137 | 138 | playerMove = null; 139 | } 140 | 141 | } 142 | 143 | 144 | private void GameOver(int? GameState){ 145 | if(GameState != null) 146 | { 147 | if(GameState != 0){ 148 | uiManager.GameOver(board.state.WhiteCount, board.state.BlackCount); 149 | } 150 | else{ 151 | uiManager.TieGame(board.state.WhiteCount, board.state.BlackCount); 152 | } 153 | enabled = !enabled; 154 | } 155 | } 156 | 157 | // Sets the player's move this turn 158 | public void SetInput(Point coord) 159 | { 160 | playerMove = coord; 161 | } 162 | 163 | // Converts board pieces following a move 164 | private void ConvertPieces(List PiecesToConvert) 165 | { 166 | 167 | 168 | board.state.ApplyMove(PiecesToConvert); 169 | 170 | foreach (Point point in PiecesToConvert) 171 | { 172 | GameObject temp = pieceGameObjects[point.X][point.Y]; 173 | 174 | // Sets game object representation to instantiated piece 175 | pieceGameObjects[point.X][point.Y] = (board.state.turn.Equals(BoardState.GameTurn.Player)) ? (GameObject)Instantiate(white, board.WorldPosition(point.X, point.Y), white.transform.rotation) 176 | : (GameObject)Instantiate(black, board.WorldPosition(point.X, point.Y), black.transform.rotation); 177 | Destroy(temp); 178 | 179 | } 180 | 181 | } 182 | 183 | #region Piece initialization methods 184 | // Initializes the Piece[][] grid of pieces 185 | private void InitializePieces() 186 | { 187 | 188 | pieceGameObjects = new GameObject[board.state.Size][]; 189 | 190 | for (int x = 0; x < board.state.Size; x++) 191 | { 192 | 193 | pieceGameObjects[x] = new GameObject[board.state.Size]; 194 | 195 | for (int y = 0; y < board.state.Size; y++) 196 | { 197 | board.state.pieces[x][y] = BoardState.Piece.None; 198 | pieceGameObjects[x][y] = null; 199 | } 200 | } 201 | 202 | Point firstPiece = new Point((board.state.Size - 1) / 2, (board.state.Size - 1) / 2); 203 | 204 | // Sets first 4 pieces (2 Black, 2 White) in diagonal pattern 205 | board.state.pieces[firstPiece.X][firstPiece.Y] = BoardState.Piece.Black; 206 | board.state.pieces[firstPiece.X + 1][firstPiece.Y] = BoardState.Piece.White; 207 | board.state.pieces[firstPiece.X][firstPiece.Y + 1] = BoardState.Piece.White; 208 | board.state.pieces[firstPiece.X + 1][firstPiece.Y + 1] = BoardState.Piece.Black; 209 | } 210 | 211 | // Instantiates board pieces 212 | private void InstantiatePieces() 213 | { 214 | for (int x = 0; x < board.state.Size; x++) 215 | { 216 | for (int y = 0; y < board.state.Size; y++) 217 | { 218 | if (board.state.pieces[x][y] == BoardState.Piece.None) 219 | { 220 | continue; 221 | } 222 | else if (board.state.pieces[x][y] == BoardState.Piece.Black) 223 | { 224 | pieceGameObjects[x][y] = (GameObject)Instantiate(black, board.WorldPosition(x, y), black.transform.rotation); 225 | board.state.pieceCount++; 226 | board.state.BlackCount++; 227 | } 228 | else 229 | { 230 | pieceGameObjects[x][y] = (GameObject)Instantiate(white, board.WorldPosition(x, y), white.transform.rotation); 231 | board.state.pieceCount++; 232 | board.state.WhiteCount++; 233 | } 234 | } 235 | } 236 | } 237 | #endregion 238 | 239 | } 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b7dc39a7d339364eaed72ea4d9ea32c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/MonteCarloNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | public class MonteCarloNode 7 | { 8 | public int score; 9 | public int timesVisited; 10 | 11 | MonteCarloNode parent; 12 | public List children; 13 | public List availableMoves; 14 | public Point point; 15 | public BoardState board; 16 | 17 | AIManager ai; 18 | 19 | public MonteCarloNode(BoardState b, AIManager AI) 20 | { 21 | score = 0; 22 | timesVisited = 0; 23 | ai = AI; 24 | parent = null; 25 | children = new List (); 26 | availableMoves = new List (); 27 | board = new BoardState(b); 28 | 29 | AddAvailableMoves(board.availableMoves.Keys.ToList()); 30 | } 31 | 32 | public MonteCarloNode(MonteCarloNode Parent, Point point) 33 | { 34 | score = 0; 35 | timesVisited = 0; 36 | ai = Parent.ai; 37 | parent = Parent; 38 | children = new List (); 39 | availableMoves = new List (parent.availableMoves); 40 | this.point = point; 41 | board = new BoardState(parent.board); 42 | board.ApplyMove(board.PlacePiece(point)); 43 | board.turn = board.turn == BoardState.GameTurn.Computer ? BoardState.GameTurn.Player : BoardState.GameTurn.Computer; 44 | board.GenerateAvailableMoves(); 45 | //AddAvailableMoves(board.availableMoves.Keys.ToList()); 46 | } 47 | 48 | public MonteCarloNode(MonteCarloNode n) 49 | { 50 | score = n.score; 51 | timesVisited = n.timesVisited; 52 | ai = n.ai; 53 | parent = n.parent; 54 | children = new List(n.children); 55 | availableMoves = new List(n.availableMoves); 56 | board = new BoardState(n.board); 57 | point = n.point; 58 | } 59 | 60 | public void Backup(int val) 61 | { 62 | score += val; 63 | timesVisited++; 64 | if (parent != null) { 65 | parent.Backup(val); 66 | } 67 | 68 | } 69 | 70 | public MonteCarloNode Expand() 71 | { 72 | if (availableMoves.Count > 0) { 73 | MonteCarloNode ret = availableMoves[0]; 74 | AddChild(ret); 75 | availableMoves.Remove(ret); 76 | return ret; 77 | } 78 | Debug.Log ("really really big problems"); 79 | return null; 80 | } 81 | 82 | public MonteCarloNode BestChild() 83 | { 84 | double bestVal = double.MinValue; 85 | MonteCarloNode bestChild = null; 86 | 87 | foreach(MonteCarloNode node in children) 88 | { 89 | double utc = ((double)node.score / (double)node.timesVisited) + ai.getRHS(timesVisited, node.timesVisited); 90 | 91 | if (utc > bestVal){ 92 | bestChild = node; 93 | bestVal = utc; 94 | } 95 | } 96 | 97 | return bestChild; 98 | } 99 | 100 | public void AddAvailableMoves(List Points) 101 | { 102 | foreach (Point p in Points) { 103 | availableMoves.Add(new MonteCarloNode (this, p)); 104 | } 105 | } 106 | 107 | 108 | public void AddChildren(List Points) 109 | { 110 | foreach (Point p in Points) { 111 | AddChild(new MonteCarloNode(this, p)); 112 | } 113 | } 114 | 115 | public void AddChild(MonteCarloNode Child) 116 | { 117 | children.Add(Child); 118 | } 119 | 120 | } 121 | 122 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/MonteCarloNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39b56086c12610448985df9d7f97ca44 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/PlayerSettings.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Text.RegularExpressions; 4 | 5 | public class PlayerSettings : MonoBehaviour { 6 | 7 | private Board board; 8 | 9 | private GUIStyle boxStyle; 10 | private GUIStyle buttonStyle; 11 | 12 | private Vector2 buttonPosition; 13 | private float buttonWidth; 14 | private float buttonHeight; 15 | 16 | private float boxMessageOffset; 17 | 18 | private int boardSize; 19 | 20 | // Setting strings 21 | private string menu = "Board size"; 22 | private string four = "4x4"; 23 | private string eight = "6X6"; 24 | private string sixteen = "8x8"; 25 | private string thirtytwo = "10x10"; 26 | 27 | void Awake() 28 | { 29 | GUI.enabled = false; 30 | board = GameObject.Find("Board").GetComponent(); 31 | 32 | buttonWidth = Screen.width * .1f; 33 | buttonHeight = Screen.height * .05f; 34 | boxMessageOffset = 50f; 35 | 36 | boardSize = -1; 37 | 38 | buttonPosition.x = (Screen.width / 2.0f) - (buttonWidth / 2); 39 | buttonPosition.y = (Screen.height / 2.0f) - (buttonHeight / 2); 40 | } 41 | 42 | void OnGUI() 43 | { 44 | // GUI.Box that frames all settings buttons in the middle of the screen 45 | boxStyle = new GUIStyle(GUI.skin.box); 46 | boxStyle.fontSize = 30; 47 | GUI.Box(new Rect(buttonPosition.x - (buttonWidth * 1.5f), buttonPosition.y - boxMessageOffset, buttonWidth * 4, buttonHeight + boxMessageOffset), menu, boxStyle); 48 | 49 | // GUI.Buttons that represent the available board sizes: 4x4, 8x8, 16x16, 32x32 50 | buttonStyle = new GUIStyle(GUI.skin.button); 51 | buttonStyle.fontSize = 16; 52 | 53 | if (GUI.Button(new Rect(buttonPosition.x - (buttonWidth * 1.5f), buttonPosition.y, buttonWidth, buttonHeight), four, buttonStyle)) 54 | { 55 | boardSize = 4; 56 | } 57 | else if (GUI.Button(new Rect(buttonPosition.x - (buttonWidth * .5f), buttonPosition.y, buttonWidth, buttonHeight), eight, buttonStyle)) 58 | { 59 | boardSize = 6; 60 | } 61 | else if (GUI.Button(new Rect(buttonPosition.x + (buttonWidth * .5f), buttonPosition.y, buttonWidth, buttonHeight), sixteen, buttonStyle)) 62 | { 63 | boardSize = 8; 64 | } 65 | else if (GUI.Button(new Rect(buttonPosition.x + (buttonWidth * 1.5f), buttonPosition.y, buttonWidth, buttonHeight), thirtytwo, buttonStyle)) 66 | { 67 | boardSize = 10; 68 | } 69 | } 70 | 71 | // Waits for player to choose board size and then sets board size 72 | public IEnumerator SettingsButton() 73 | { 74 | GUI.enabled = true; 75 | 76 | while (true) 77 | { 78 | if (boardSize != -1) 79 | { 80 | board.SetBoardDimensions(boardSize); 81 | break; 82 | } 83 | else 84 | { 85 | yield return null; 86 | } 87 | } 88 | 89 | Debug.Log("Set board size to " + boardSize + "," + boardSize); 90 | this.enabled = false; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/PlayerSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1c2175f113618347800e5b507330c39 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/Point.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Point { 5 | 6 | public int X { get; private set; } 7 | public int Y { get; private set; } 8 | 9 | public Point() 10 | { 11 | X = -1; 12 | Y = -1; 13 | } 14 | 15 | public Point(int x, int y) 16 | { 17 | X = x; 18 | Y = y; 19 | } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | if (obj == null) 24 | { 25 | return false; 26 | } 27 | 28 | if (!(obj is Point)) 29 | { 30 | return false; 31 | } 32 | 33 | return Equals((Point)obj); 34 | } 35 | 36 | public bool Equals(Point point) 37 | { 38 | if (X != point.X) 39 | { 40 | return false; 41 | } 42 | 43 | return (Y == point.Y); 44 | } 45 | 46 | public override int GetHashCode() 47 | { 48 | return X ^ Y; 49 | } 50 | } -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/Point.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3877fd67e26f47446b900e5bf3950b6c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/TileManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class TileManager : MonoBehaviour { 5 | 6 | public Color tileColor; 7 | private Board board; 8 | private Point coord; 9 | 10 | private GameManager gameManager; 11 | 12 | void Awake() 13 | { 14 | board = GameObject.Find("Board").GetComponent(); 15 | gameManager = GameObject.Find("Managers").GetComponent(); 16 | 17 | 18 | } 19 | 20 | void Start() 21 | { 22 | tileColor = renderer.material.color; 23 | board.state.Count++; 24 | 25 | coord = new Point((board.state.Count - 1) /board.state.Size, (board.state.Count - 1) % board.state.Size); 26 | } 27 | 28 | #region Mouse input methods 29 | void OnMouseEnter() 30 | { 31 | if (!board.state.GameOver) 32 | { 33 | // Highlights the tile as yellow 34 | renderer.material.color = Color.yellow; 35 | } 36 | } 37 | 38 | void OnMouseExit() 39 | { 40 | // Sets the tile back to its original color 41 | renderer.material.color = tileColor; 42 | } 43 | 44 | public void setColour(Color c) 45 | { 46 | tileColor = c; 47 | renderer.material.color = tileColor; 48 | } 49 | 50 | void OnMouseUpAsButton() 51 | { 52 | if (board.state.turn == BoardState.GameTurn.Player && !board.state.GameOver) 53 | { 54 | gameManager.SetInput(coord); 55 | } 56 | } 57 | #endregion Mouse input methods 58 | } 59 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/TileManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5412cae3a384b4b4882cc26799c86166 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/UIManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class UIManager : MonoBehaviour { 5 | 6 | private GUIStyle messageStyle; 7 | private GUIStyle buttonStyle; 8 | 9 | private bool drawGameOver; 10 | private bool drawMessage; 11 | 12 | private Vector2 buttonPosition; 13 | private Vector2 messagePosition; 14 | 15 | private float messageHeight; 16 | private float buttonHeight; 17 | 18 | private string message; 19 | 20 | void Awake() 21 | { 22 | messageHeight = Screen.height * .4f; 23 | buttonHeight = Screen.height * .4f; 24 | 25 | drawGameOver = false; 26 | drawMessage = false; 27 | } 28 | 29 | void Start() 30 | { 31 | buttonPosition.x = (Screen.width / 2.0f); 32 | buttonPosition.y = (Screen.height / 3.0f); 33 | 34 | messagePosition.x = buttonPosition.x; 35 | messagePosition.y = (Screen.height / 3f); 36 | } 37 | 38 | public IEnumerator ShowMessage(string message, int duration) 39 | { 40 | this.message = message; 41 | drawMessage = true; 42 | 43 | yield return new WaitForSeconds(duration); 44 | 45 | drawMessage = false; 46 | } 47 | 48 | public void OnGUI() 49 | { 50 | if (drawMessage && !drawGameOver) 51 | { 52 | messageStyle = new GUIStyle(GUI.skin.label); 53 | messageStyle.normal.textColor = Color.red; 54 | messageStyle.fontSize = 50; 55 | messageStyle.alignment = TextAnchor.UpperCenter; 56 | 57 | GUI.Label(new Rect(0, 0, Screen.width, messageHeight), message, messageStyle); 58 | } 59 | 60 | if (drawGameOver) 61 | { 62 | buttonStyle = new GUIStyle(GUI.skin.button); 63 | buttonStyle.fontSize = 30; 64 | buttonStyle.alignment = TextAnchor.MiddleCenter; 65 | 66 | if(GUI.Button(new Rect(0, 0, Screen.width, buttonHeight), message, buttonStyle)) 67 | { 68 | Application.LoadLevel("Othello"); 69 | } 70 | } 71 | } 72 | 73 | public void TieGame(int whiteCount, int blackCount) 74 | { 75 | if (whiteCount > blackCount) 76 | { 77 | message = string.Format("No moves left, but you have more points. You win!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 78 | } 79 | else 80 | { 81 | message = string.Format("No moves left, but you have fewer points. You lose!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 82 | } 83 | 84 | drawGameOver = true; 85 | } 86 | 87 | public void GameOver(int whiteCount, int blackCount) 88 | { 89 | if (whiteCount > blackCount) 90 | { 91 | message = string.Format("You win!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 92 | } 93 | else 94 | { 95 | message = string.Format("You lose!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 96 | } 97 | 98 | drawGameOver = true; 99 | } 100 | } 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /Reversi/Assets/Scripts/UIManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3faf4b5fb3378824f99d22dafd479388 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Library/AnnotationManager: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/AnnotationManager -------------------------------------------------------------------------------- /Reversi/Library/AssetImportState: -------------------------------------------------------------------------------- 1 | 5;0;-1 -------------------------------------------------------------------------------- /Reversi/Library/AssetServerCacheV3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/AssetServerCacheV3 -------------------------------------------------------------------------------- /Reversi/Library/AssetVersioning.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/AssetVersioning.db -------------------------------------------------------------------------------- /Reversi/Library/BuildPlayer.prefs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/BuildPlayer.prefs -------------------------------------------------------------------------------- /Reversi/Library/BuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/BuildSettings.asset -------------------------------------------------------------------------------- /Reversi/Library/CurrentLayout.dwlt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/CurrentLayout.dwlt -------------------------------------------------------------------------------- /Reversi/Library/EditorUserBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/EditorUserBuildSettings.asset -------------------------------------------------------------------------------- /Reversi/Library/EditorUserSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/EditorUserSettings.asset -------------------------------------------------------------------------------- /Reversi/Library/FailedAssetImports.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/FailedAssetImports.txt -------------------------------------------------------------------------------- /Reversi/Library/InspectorExpandedItems.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/InspectorExpandedItems.asset -------------------------------------------------------------------------------- /Reversi/Library/MonoManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/MonoManager.asset -------------------------------------------------------------------------------- /Reversi/Library/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/ProjectSettings.asset -------------------------------------------------------------------------------- /Reversi/Library/ScriptAssemblies/Assembly-CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/ScriptAssemblies/Assembly-CSharp.dll -------------------------------------------------------------------------------- /Reversi/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb -------------------------------------------------------------------------------- /Reversi/Library/ScriptAssemblies/CompilationCompleted.txt: -------------------------------------------------------------------------------- 1 | Completed 2 | -------------------------------------------------------------------------------- /Reversi/Library/ScriptMapper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/ScriptMapper -------------------------------------------------------------------------------- /Reversi/Library/ShaderCache.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/ShaderCache.db -------------------------------------------------------------------------------- /Reversi/Library/assetDatabase3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/assetDatabase3 -------------------------------------------------------------------------------- /Reversi/Library/expandedItems: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/expandedItems -------------------------------------------------------------------------------- /Reversi/Library/guidmapper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/guidmapper -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000001000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000001000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000002000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000002000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000003000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000003000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000004000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000004000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000004100000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000004100000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000005000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000005000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000005100000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000005100000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000006000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000006000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000006100000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000006100000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000007000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000007000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000008000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000008000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/00000000000000009000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/00000000000000009000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/0000000000000000a000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/0000000000000000a000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/0000000000000000b000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/0000000000000000b000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/00/0000000000000000c000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/00/0000000000000000c000000000000000 -------------------------------------------------------------------------------- /Reversi/Library/metadata/07/0759df3291e498f4089d386c70545f98: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/07/0759df3291e498f4089d386c70545f98 -------------------------------------------------------------------------------- /Reversi/Library/metadata/0e/0e95b9e7440698947af8cbfa08335eef: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/0e/0e95b9e7440698947af8cbfa08335eef -------------------------------------------------------------------------------- /Reversi/Library/metadata/19/195f2bd4bbdb8bf49ae679431bdc8cc7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/19/195f2bd4bbdb8bf49ae679431bdc8cc7 -------------------------------------------------------------------------------- /Reversi/Library/metadata/2b/2b7dc39a7d339364eaed72ea4d9ea32c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/2b/2b7dc39a7d339364eaed72ea4d9ea32c -------------------------------------------------------------------------------- /Reversi/Library/metadata/2f/2f29827e3c029b44ebfb792ee989a1e9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/2f/2f29827e3c029b44ebfb792ee989a1e9 -------------------------------------------------------------------------------- /Reversi/Library/metadata/38/3877fd67e26f47446b900e5bf3950b6c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/38/3877fd67e26f47446b900e5bf3950b6c -------------------------------------------------------------------------------- /Reversi/Library/metadata/39/39b56086c12610448985df9d7f97ca44: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/39/39b56086c12610448985df9d7f97ca44 -------------------------------------------------------------------------------- /Reversi/Library/metadata/3f/3faf4b5fb3378824f99d22dafd479388: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/3f/3faf4b5fb3378824f99d22dafd479388 -------------------------------------------------------------------------------- /Reversi/Library/metadata/54/5412cae3a384b4b4882cc26799c86166: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/54/5412cae3a384b4b4882cc26799c86166 -------------------------------------------------------------------------------- /Reversi/Library/metadata/61/61688de85be78394c900bf343d5fe373: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/61/61688de85be78394c900bf343d5fe373 -------------------------------------------------------------------------------- /Reversi/Library/metadata/7e/7e8dc0ef0f4226c43a3c41578bf57cc8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/7e/7e8dc0ef0f4226c43a3c41578bf57cc8 -------------------------------------------------------------------------------- /Reversi/Library/metadata/80/80a3616ca19596e4da0f10f14d241e9f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/80/80a3616ca19596e4da0f10f14d241e9f -------------------------------------------------------------------------------- /Reversi/Library/metadata/93/93a43d08ee7ca084e8a91de6d743b2d5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/93/93a43d08ee7ca084e8a91de6d743b2d5 -------------------------------------------------------------------------------- /Reversi/Library/metadata/ad/ad13906e266c61a499ceac1f6e032cf0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/ad/ad13906e266c61a499ceac1f6e032cf0 -------------------------------------------------------------------------------- /Reversi/Library/metadata/bc/bc0e2f56b78cd7145977ea61b582d19e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/bc/bc0e2f56b78cd7145977ea61b582d19e -------------------------------------------------------------------------------- /Reversi/Library/metadata/c1/c1c2175f113618347800e5b507330c39: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/c1/c1c2175f113618347800e5b507330c39 -------------------------------------------------------------------------------- /Reversi/Library/metadata/d7/d77a0ca4b2a56bd498c058e0ea69b57c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/d7/d77a0ca4b2a56bd498c058e0ea69b57c -------------------------------------------------------------------------------- /Reversi/Library/metadata/d9/d96779b9f9185b74685f85c113ff00cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/d9/d96779b9f9185b74685f85c113ff00cc -------------------------------------------------------------------------------- /Reversi/Library/metadata/f1/f13d63899ef4cab419cabf32052371cf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/f1/f13d63899ef4cab419cabf32052371cf -------------------------------------------------------------------------------- /Reversi/Library/metadata/f5/f5f67c52d1564df4a8936ccd202a3bd8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/f5/f5f67c52d1564df4a8936ccd202a3bd8 -------------------------------------------------------------------------------- /Reversi/Library/metadata/fa/fab4072002924b04c956860646777b3e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Library/metadata/fa/fab4072002924b04c956860646777b3e -------------------------------------------------------------------------------- /Reversi/Othello-master-csharp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{6766667D-4C25-3E60-BC90-E2369084289E}") = "Othello-master", "Assembly-CSharp-vs.csproj", "{2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | GlobalSection(MonoDevelopProperties) = preSolution 21 | StartupItem = Assembly-CSharp.csproj 22 | Policies = $0 23 | $0.TextStylePolicy = $1 24 | $1.inheritsSet = null 25 | $1.scope = text/x-csharp 26 | $0.CSharpFormattingPolicy = $2 27 | $2.inheritsSet = Mono 28 | $2.inheritsScope = text/x-csharp 29 | $2.scope = text/x-csharp 30 | $0.TextStylePolicy = $3 31 | $3.FileWidth = 120 32 | $3.TabWidth = 4 33 | $3.IndentWidth = 4 34 | $3.EolMarker = Unix 35 | $3.inheritsSet = Mono 36 | $3.inheritsScope = text/plain 37 | $3.scope = text/plain 38 | EndGlobalSection 39 | 40 | EndGlobal 41 | -------------------------------------------------------------------------------- /Reversi/Othello-master.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{6766667D-4C25-3E60-BC90-E2369084289E}") = "Othello-master", "Assembly-CSharp.csproj", "{2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {2B11E6A7-3106-3AB8-2439-3B24E1CEE9ED}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | GlobalSection(MonoDevelopProperties) = preSolution 21 | StartupItem = Assembly-CSharp.csproj 22 | Policies = $0 23 | $0.TextStylePolicy = $1 24 | $1.inheritsSet = null 25 | $1.scope = text/x-csharp 26 | $0.CSharpFormattingPolicy = $2 27 | $2.inheritsSet = Mono 28 | $2.inheritsScope = text/x-csharp 29 | $2.scope = text/x-csharp 30 | $0.TextStylePolicy = $3 31 | $3.FileWidth = 120 32 | $3.TabWidth = 4 33 | $3.IndentWidth = 4 34 | $3.EolMarker = Unix 35 | $3.inheritsSet = Mono 36 | $3.inheritsScope = text/plain 37 | $3.scope = text/plain 38 | EndGlobalSection 39 | 40 | EndGlobal 41 | -------------------------------------------------------------------------------- /Reversi/Othello-master.userprefs: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Reversi/Othello-master/.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | Temp/ 5 | Obj/ 6 | UnityGenerated/ 7 | Library/ 8 | 9 | # ===================================== # 10 | # Visual Studio / MonoDevelop generated # 11 | # ===================================== # 12 | ExportedObj/ 13 | *.svd 14 | *.userprefs 15 | *.csproj 16 | *.pidb 17 | *.suo 18 | *.sln 19 | *.user 20 | *.unityproj 21 | 22 | # ============ # 23 | # OS generated # 24 | # ============ # 25 | .DS_Store 26 | .DS_Store? 27 | ._* -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f29827e3c029b44ebfb792ee989a1e9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Black Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/Assets/Resources/Black Material.mat -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Black Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d77a0ca4b2a56bd498c058e0ea69b57c 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Black.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/Assets/Resources/Black.prefab -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Black.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d96779b9f9185b74685f85c113ff00cc 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Tile Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/Assets/Resources/Tile Material.mat -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Tile Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad13906e266c61a499ceac1f6e032cf0 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Tile.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/Assets/Resources/Tile.prefab -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/Tile.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e8dc0ef0f4226c43a3c41578bf57cc8 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/White.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/Assets/Resources/White.prefab -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Resources/White.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93a43d08ee7ca084e8a91de6d743b2d5 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fab4072002924b04c956860646777b3e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scenes/Othello.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/Assets/Scenes/Othello.unity -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scenes/Othello.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f13d63899ef4cab419cabf32052371cf 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc0e2f56b78cd7145977ea61b582d19e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/AIManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | public class AIManager : MonoBehaviour { 7 | 8 | private GameManager gameManager; 9 | private Board board; 10 | private UIManager uiManager; 11 | 12 | private Dictionary> availableMoves; 13 | 14 | public bool GameTied { get; private set; } 15 | public bool GameOver { get; private set; } 16 | 17 | public bool PossibleToMove { get; private set; } 18 | 19 | void Awake() 20 | { 21 | board = GameObject.Find("Board").GetComponent(); 22 | gameManager = GameObject.Find("Managers").GetComponent(); 23 | uiManager = Camera.main.GetComponent(); 24 | 25 | // Dictionary that holds 26 | availableMoves = new Dictionary>(); 27 | 28 | GameOver = false; 29 | GameTied = false; 30 | PossibleToMove = false; 31 | } 32 | 33 | // Generates and stores all available moves for whoever's turn it is 34 | public void GenerateAvailableMoves() 35 | { 36 | availableMoves.Clear(); 37 | PossibleToMove = false; 38 | 39 | for (int x = 0; x < board.Size; x++) 40 | { 41 | for (int y = 0; y < board.Size; y++) 42 | { 43 | if (gameManager.pieces[x][y] == GameManager.Piece.None) 44 | { 45 | List moves = new List(); 46 | Point coord = new Point(x, y); 47 | 48 | AvailableUp(coord, ref moves); 49 | AvailableUpRight(coord, ref moves); 50 | AvailableRight(coord, ref moves); 51 | AvailableDownRight(coord, ref moves); 52 | AvailableDown(coord, ref moves); 53 | AvailableDownLeft(coord, ref moves); 54 | AvailableLeft(coord, ref moves); 55 | AvailableUpLeft(coord, ref moves); 56 | 57 | if (moves.Count > 0) 58 | { 59 | // If move converts at least 1 piece, add move to the dictionary of 60 | availableMoves.Add(coord, moves); 61 | PossibleToMove = true; 62 | } 63 | } 64 | } 65 | } 66 | } 67 | 68 | // Returns whether or not move is available, and if so stores list of Points to convert 69 | public bool AvailableMove(Point coord, ref List PiecesToConvert) 70 | { 71 | if (availableMoves.TryGetValue(coord, out PiecesToConvert)) 72 | { 73 | // Have to add the original move to the pieces to convert 74 | PiecesToConvert.Insert(0, coord); 75 | return true; 76 | } 77 | else 78 | { 79 | Debug.Log("Could not retrieve move " + coord.X + "," + coord.Y); 80 | return false; 81 | } 82 | } 83 | 84 | // Returns the best possible computer move as a List, including the piece put down 85 | public List ComputerMove() 86 | { 87 | List computerMove = new List(); 88 | Point bestMove = new Point(); 89 | 90 | int mostPoints = 0; 91 | 92 | foreach (KeyValuePair> move in availableMoves) 93 | { 94 | if (move.Value.Count > mostPoints) 95 | { 96 | mostPoints = move.Value.Count; 97 | bestMove = move.Key; 98 | } 99 | // 50% chance to use an equally-viable move in order to shift the physical move distribution 100 | else if (move.Value.Count == mostPoints) 101 | { 102 | if (UnityEngine.Random.Range(0, 9) <= 4) 103 | { 104 | mostPoints = move.Value.Count; 105 | bestMove = move.Key; 106 | } 107 | } 108 | } 109 | 110 | availableMoves.TryGetValue(bestMove, out computerMove); 111 | // Have to add the move itself to the list of Points 112 | computerMove.Insert(0, bestMove); 113 | 114 | return computerMove; 115 | } 116 | 117 | // Checks whether the game is over; i.e., lost/won or tied 118 | public void CheckGameOver() 119 | { 120 | if (gameManager.Count == (board.Size * board.Size)) 121 | { 122 | GameOver = true; 123 | 124 | board.enabled = !board.enabled; 125 | gameManager.enabled = !gameManager.enabled; 126 | 127 | uiManager.GameOver(gameManager.WhiteCount, gameManager.BlackCount); 128 | } 129 | 130 | if (gameManager.WhiteCount == 0 || gameManager.BlackCount == 0) 131 | { 132 | GameOver = true; 133 | 134 | board.enabled = !board.enabled; 135 | gameManager.enabled = !gameManager.enabled; 136 | 137 | uiManager.GameOver(gameManager.WhiteCount, gameManager.BlackCount); 138 | } 139 | 140 | if (gameManager.WhiteCantMove && gameManager.BlackCantMove) 141 | { 142 | GameTied = true; 143 | 144 | board.enabled = !board.enabled; 145 | gameManager.enabled = !gameManager.enabled; 146 | 147 | uiManager.TieGame(gameManager.WhiteCount, gameManager.BlackCount); 148 | } 149 | } 150 | 151 | #region Available move helper methods 152 | private void AvailableUp(Point coord, ref List PiecesToConvert) 153 | { 154 | Queue pieceQueue = new Queue(); 155 | bool foundPlayerPiece = false; 156 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 157 | 158 | if (coord.Y != board.Size - 1) 159 | { 160 | for (int newY = coord.Y + 1; newY < board.Size; newY++) 161 | { 162 | if (gameManager.pieces[coord.X][newY].Equals(GameManager.Piece.None)) 163 | { 164 | return; 165 | } 166 | else if (gameManager.pieces[coord.X][newY].Equals(pieceToCheck)) 167 | { 168 | foundPlayerPiece = true; 169 | break; 170 | } 171 | else 172 | { 173 | pieceQueue.Enqueue(new Point(coord.X, newY)); 174 | } 175 | } 176 | 177 | if (foundPlayerPiece) 178 | { 179 | while (pieceQueue.Count > 0) 180 | { 181 | PiecesToConvert.Add(pieceQueue.Dequeue()); 182 | } 183 | } 184 | } 185 | } 186 | 187 | private void AvailableUpRight(Point coord, ref List PiecesToConvert) 188 | { 189 | Queue pieceQueue = new Queue(); 190 | bool foundPlayerPiece = false; 191 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 192 | 193 | if (coord.X != board.Size -1 && coord.Y != board.Size - 1) 194 | { 195 | for (int newX = coord.X + 1, newY = coord.Y + 1; newX < board.Size && newY < board.Size; newX++, newY++) 196 | { 197 | if (gameManager.pieces[newX][newY].Equals(GameManager.Piece.None)) 198 | { 199 | return; 200 | } 201 | else if (gameManager.pieces[newX][newY].Equals(pieceToCheck)) 202 | { 203 | foundPlayerPiece = true; 204 | break; 205 | } 206 | else 207 | { 208 | pieceQueue.Enqueue(new Point(newX, newY)); 209 | } 210 | } 211 | 212 | if (foundPlayerPiece) 213 | { 214 | while (pieceQueue.Count > 0) 215 | { 216 | PiecesToConvert.Add(pieceQueue.Dequeue()); 217 | } 218 | } 219 | } 220 | } 221 | 222 | private void AvailableRight(Point coord, ref List PiecesToConvert) 223 | { 224 | Queue pieceQueue = new Queue(); 225 | bool foundPlayerPiece = false; 226 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 227 | 228 | if (coord.X != board.Size - 1) 229 | { 230 | for (int newX = coord.X + 1; newX < board.Size; newX++) 231 | { 232 | if (gameManager.pieces[newX][coord.Y].Equals(GameManager.Piece.None)) 233 | { 234 | return; 235 | } 236 | else if (gameManager.pieces[newX][coord.Y].Equals(pieceToCheck)) 237 | { 238 | foundPlayerPiece = true; 239 | break; 240 | } 241 | else 242 | { 243 | pieceQueue.Enqueue(new Point(newX, coord.Y)); 244 | } 245 | } 246 | 247 | if (foundPlayerPiece) 248 | { 249 | while (pieceQueue.Count > 0) 250 | { 251 | PiecesToConvert.Add(pieceQueue.Dequeue()); 252 | } 253 | } 254 | } 255 | } 256 | 257 | private void AvailableDownRight(Point coord, ref List PiecesToConvert) 258 | { 259 | Queue pieceQueue = new Queue(); 260 | bool foundPlayerPiece = false; 261 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 262 | 263 | if (coord.X != board.Size - 1 && coord.Y != 0) 264 | { 265 | for (int newX = coord.X + 1, newY = coord.Y - 1; newX < board.Size && newY >= 0; newX++, newY--) 266 | { 267 | if (gameManager.pieces[newX][newY].Equals(GameManager.Piece.None)) 268 | { 269 | return; 270 | } 271 | else if (gameManager.pieces[newX][newY].Equals(pieceToCheck)) 272 | { 273 | foundPlayerPiece = true; 274 | break; 275 | } 276 | else 277 | { 278 | pieceQueue.Enqueue(new Point(newX, newY)); 279 | } 280 | } 281 | 282 | if (foundPlayerPiece) 283 | { 284 | while (pieceQueue.Count > 0) 285 | { 286 | PiecesToConvert.Add(pieceQueue.Dequeue()); 287 | } 288 | } 289 | } 290 | } 291 | 292 | private void AvailableDown(Point coord, ref List PiecesToConvert) 293 | { 294 | Queue pieceQueue = new Queue(); 295 | bool foundPlayerPiece = false; 296 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 297 | 298 | if (coord.Y != 0) 299 | { 300 | for (int newY = coord.Y - 1; newY >= 0; newY--) 301 | { 302 | if (gameManager.pieces[coord.X][newY].Equals(GameManager.Piece.None)) 303 | { 304 | return; 305 | } 306 | else if (gameManager.pieces[coord.X][newY].Equals(pieceToCheck)) 307 | { 308 | foundPlayerPiece = true; 309 | break; 310 | } 311 | else 312 | { 313 | pieceQueue.Enqueue(new Point(coord.X, newY)); 314 | } 315 | } 316 | 317 | if (foundPlayerPiece) 318 | { 319 | while (pieceQueue.Count > 0) 320 | { 321 | PiecesToConvert.Add(pieceQueue.Dequeue()); 322 | } 323 | } 324 | } 325 | } 326 | 327 | private void AvailableDownLeft(Point coord, ref List PiecesToConvert) 328 | { 329 | Queue pieceQueue = new Queue(); 330 | bool foundPlayerPiece = false; 331 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 332 | 333 | if (coord.X != 0 && coord.Y != 0) 334 | { 335 | for (int newX = coord.X - 1, newY = coord.Y - 1; newX >= 0 && newY >= 0; newX--, newY--) 336 | { 337 | if (gameManager.pieces[newX][newY].Equals(GameManager.Piece.None)) 338 | { 339 | return; 340 | } 341 | else if (gameManager.pieces[newX][newY].Equals(pieceToCheck)) 342 | { 343 | foundPlayerPiece = true; 344 | break; 345 | } 346 | else 347 | { 348 | pieceQueue.Enqueue(new Point(newX, newY)); 349 | } 350 | } 351 | 352 | if (foundPlayerPiece) 353 | { 354 | while (pieceQueue.Count > 0) 355 | { 356 | PiecesToConvert.Add(pieceQueue.Dequeue()); 357 | } 358 | } 359 | } 360 | } 361 | 362 | private void AvailableLeft(Point coord, ref List PiecesToConvert) 363 | { 364 | Queue pieceQueue = new Queue(); 365 | bool foundPlayerPiece = false; 366 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 367 | 368 | if (coord.X != 0) 369 | { 370 | for (int newX = coord.X - 1; newX >= 0; newX--) 371 | { 372 | if (gameManager.pieces[newX][coord.Y].Equals(GameManager.Piece.None)) 373 | { 374 | return; 375 | } 376 | else if (gameManager.pieces[newX][coord.Y].Equals(pieceToCheck)) 377 | { 378 | foundPlayerPiece = true; 379 | break; 380 | } 381 | else 382 | { 383 | pieceQueue.Enqueue(new Point(newX, coord.Y)); 384 | } 385 | } 386 | 387 | if (foundPlayerPiece) 388 | { 389 | while (pieceQueue.Count > 0) 390 | { 391 | PiecesToConvert.Add(pieceQueue.Dequeue()); 392 | } 393 | } 394 | } 395 | } 396 | 397 | private void AvailableUpLeft(Point coord, ref List PiecesToConvert) 398 | { 399 | Queue pieceQueue = new Queue(); 400 | bool foundPlayerPiece = false; 401 | GameManager.Piece pieceToCheck = (gameManager.Turn == GameManager.GameTurn.Player) ? GameManager.Piece.White : GameManager.Piece.Black; 402 | 403 | if (coord.X != 0 && coord.Y != board.Size - 1) 404 | { 405 | for (int newX = coord.X - 1, newY = coord.Y + 1; newX >= 0 && newY < board.Size - 1; newX--, newY++) 406 | { 407 | if (gameManager.pieces[newX][newY].Equals(GameManager.Piece.None)) 408 | { 409 | return; 410 | } 411 | else if (gameManager.pieces[newX][newY].Equals(pieceToCheck)) 412 | { 413 | foundPlayerPiece = true; 414 | break; 415 | } 416 | else 417 | { 418 | pieceQueue.Enqueue(new Point(newX, newY)); 419 | } 420 | } 421 | 422 | if (foundPlayerPiece) 423 | { 424 | while (pieceQueue.Count > 0) 425 | { 426 | PiecesToConvert.Add(pieceQueue.Dequeue()); 427 | } 428 | } 429 | } 430 | } 431 | #endregion 432 | } 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/AIManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 195f2bd4bbdb8bf49ae679431bdc8cc7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/Board.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Board : MonoBehaviour { 5 | 6 | private GameObject[][] board; 7 | 8 | public GameObject Tile; 9 | 10 | public int Size { get; private set; } 11 | public float Offset { get; private set; } 12 | 13 | public int Count { get; set; } 14 | 15 | void Awake() 16 | { 17 | Offset = 0.05f; 18 | Count = 0; 19 | } 20 | 21 | // Sets board dimensions 22 | public void SetBoardDimensions(int boardSize) 23 | { 24 | Camera.main.GetComponent().enabled = true; 25 | 26 | Size = boardSize; 27 | 28 | CreateBoard(); 29 | } 30 | 31 | // Creates game board 32 | private void CreateBoard() 33 | { 34 | InitializeBoard(); 35 | InstantiateBoard(); 36 | } 37 | 38 | // Returns the position of the tile in the world 39 | public Vector3 WorldPosition(float x, float y) 40 | { 41 | float xCoord = (x == 0) ? x + .5f : x + .5f + (Offset * x); 42 | float yCoord = (y == 0) ? y + .5f : y + .5f + (Offset * y); 43 | 44 | return new Vector3(xCoord, yCoord, -1); 45 | } 46 | 47 | // Initializes the GameObject[][] with board tiles 48 | private void InitializeBoard() 49 | { 50 | board = new GameObject[Size][]; 51 | 52 | for (int x = 0; x < Size; x++) 53 | { 54 | board[x] = new GameObject[Size]; 55 | 56 | for (int y = 0; y < Size; y++) 57 | { 58 | board[x][y] = Tile; 59 | } 60 | } 61 | } 62 | 63 | // Instantiates the board tiles 64 | private void InstantiateBoard() 65 | { 66 | for (int x = 0; x < Size; x++) 67 | { 68 | float xCoord = (x == 0) ? x + .5f : x + .5f + (Offset * x); 69 | 70 | for (int y = 0; y < Size; y++) 71 | { 72 | float yCoord = (y == 0) ? y + .5f : y + .5f + (Offset * y); 73 | 74 | Vector3 position = new Vector3(xCoord, yCoord, 0); 75 | 76 | Instantiate(board[x][y], position, Quaternion.identity); 77 | } 78 | } 79 | } 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/Board.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0759df3291e498f4089d386c70545f98 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/CameraManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class CameraManager : MonoBehaviour { 5 | 6 | private Board board; 7 | 8 | void Awake() 9 | { 10 | board = GameObject.Find("Board").GetComponent(); 11 | } 12 | 13 | void Update() 14 | { 15 | // Camera zoom 16 | if (Input.GetAxis("Mouse ScrollWheel") < 0) // Mousewheeldown -> Zoom out 17 | { 18 | Camera.main.orthographicSize += 1; 19 | } 20 | if (Input.GetAxis("Mouse ScrollWheel") > 0) // Mousewheelup -> Zoom in 21 | { 22 | if (Camera.main.orthographicSize - 1 > 0) // Prevents player from zooming orthographic size to a negative number 23 | { 24 | Camera.main.orthographicSize -= 1; 25 | } 26 | } 27 | 28 | // Camera drag using arrow + WASD keys 29 | float vertical = Input.GetAxis("Vertical"); 30 | float horizontal = Input.GetAxis("Horizontal"); 31 | 32 | if (vertical != 0 || horizontal != 0) 33 | { 34 | Vector3 distToMove = new Vector3(horizontal / Camera.main.orthographicSize, vertical / Camera.main.orthographicSize); 35 | 36 | transform.Translate(distToMove, Space.World); 37 | } 38 | } 39 | 40 | // Camera initialization 41 | public void SetCamera() 42 | { 43 | Camera.main.transform.position = new Vector3((board.Size / 2) + ((board.Size / 2) * board.Offset), (board.Size / 2) + ((board.Size / 2) * board.Offset), -10); 44 | Camera.main.orthographicSize = (board.Size / 2) + (((board.Size / 2) - 1) * board.Offset); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/CameraManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61688de85be78394c900bf343d5fe373 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/GameManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | //using UnityEditor; 3 | 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Threading; 7 | using System.Reflection; 8 | 9 | public class GameManager : MonoBehaviour { 10 | 11 | [HideInInspector] public enum Piece { None, Black, White }; 12 | [HideInInspector] public enum GameTurn { Player, Computer }; 13 | 14 | private Board board; 15 | private AIManager aiManager; 16 | private PlayerSettings playerSettings; 17 | private CameraManager cameraManager; 18 | private UIManager uiManager; 19 | 20 | public Piece[][] pieces; 21 | public GameObject[][] pieceGameObjects; 22 | 23 | [HideInInspector] public GameObject black, white; 24 | 25 | private GameTurn turn; 26 | public GameTurn Turn { get { return turn; }} 27 | 28 | public bool WhiteCantMove { get; private set; } 29 | public bool BlackCantMove { get; private set; } 30 | 31 | public int Count, WhiteCount, BlackCount; 32 | 33 | private Point playerMove; 34 | 35 | void Awake() 36 | { 37 | aiManager = GameObject.Find("Managers").GetComponent(); 38 | uiManager = Camera.main.GetComponent(); 39 | playerSettings = Camera.main.GetComponent(); 40 | cameraManager = Camera.main.GetComponent(); 41 | 42 | board = GameObject.Find("Board").GetComponent(); 43 | black = (GameObject)Resources.Load("Black"); 44 | white = (GameObject)Resources.Load("White"); 45 | 46 | turn = GameTurn.Player; 47 | 48 | Count = 0; 49 | WhiteCount = 0; 50 | BlackCount = 0; 51 | 52 | WhiteCantMove = false; 53 | BlackCantMove = false; 54 | 55 | playerMove = null; 56 | } 57 | 58 | // Initializes board and camera, and starts main game loop 59 | IEnumerator Start() 60 | { 61 | // Gets player settings for board size 62 | yield return StartCoroutine(playerSettings.SettingsButton()); 63 | 64 | InitializePieces(); 65 | InstantiatePieces(); 66 | 67 | cameraManager.SetCamera(); 68 | 69 | StartCoroutine(GameLoop()); 70 | } 71 | 72 | // Main game loop handling turns 73 | private IEnumerator GameLoop() 74 | { 75 | // Run game loop while the game isn't over (won/lost) or tied 76 | while (!aiManager.GameOver && !aiManager.GameTied) 77 | { 78 | turn = GameTurn.Player; 79 | 80 | List PiecesToConvert_Player = new List(); 81 | aiManager.GenerateAvailableMoves(); 82 | 83 | // 84 | if (aiManager.PossibleToMove) 85 | { 86 | WhiteCantMove = false; 87 | 88 | while (playerMove == null) 89 | { 90 | yield return null; 91 | } 92 | // Clears the debug log 93 | // ClearLog(); 94 | 95 | Debug.Log("Player's turn."); 96 | 97 | if (aiManager.AvailableMove(playerMove, ref PiecesToConvert_Player)) 98 | { 99 | Debug.Log("Converting pieces from " + playerMove.X + "," + playerMove.Y); 100 | yield return StartCoroutine(ConvertPieces(PiecesToConvert_Player)); 101 | } 102 | else 103 | { 104 | StartCoroutine(uiManager.ShowMessage("Invalid move.", 1)); 105 | playerMove = null; 106 | continue; 107 | } 108 | } 109 | else 110 | { 111 | Debug.Log("No possible player moves."); 112 | StartCoroutine(uiManager.ShowMessage("Player is unable to move.", 1)); 113 | WhiteCantMove = true; 114 | } 115 | // Wait 0.5 seconds before computer moves for a more natural feel 116 | yield return new WaitForSeconds(0.5f); 117 | 118 | // Check whether game over before computer turn 119 | aiManager.CheckGameOver(); 120 | 121 | if (!aiManager.GameOver) 122 | { 123 | Debug.Log("Computer's turn."); 124 | List PiecesToConvert_Computer = new List(); 125 | 126 | turn = GameTurn.Computer; 127 | aiManager.GenerateAvailableMoves(); 128 | 129 | // If the computer can move, make the best possible move 130 | if (aiManager.PossibleToMove) 131 | { 132 | BlackCantMove = false; 133 | 134 | PiecesToConvert_Computer = aiManager.ComputerMove(); 135 | 136 | Debug.Log("Converting pieces from " + PiecesToConvert_Computer[0].X + "," + PiecesToConvert_Computer[0].Y); 137 | yield return StartCoroutine(ConvertPieces(PiecesToConvert_Computer)); 138 | } 139 | else 140 | { 141 | Debug.Log("No possible computer moves."); 142 | StartCoroutine(uiManager.ShowMessage("Computer is unable to move.", 1)); 143 | BlackCantMove = true; 144 | } 145 | } 146 | // Check whether game over before player turn 147 | aiManager.CheckGameOver(); 148 | 149 | playerMove = null; 150 | } 151 | } 152 | 153 | // Sets the player's move this turn 154 | public void SetInput(Point coord) 155 | { 156 | playerMove = coord; 157 | } 158 | 159 | // Converts board pieces following a move 160 | private IEnumerator ConvertPieces(List PiecesToConvert) 161 | { 162 | foreach (Point point in PiecesToConvert) 163 | { 164 | // Sets board square equal to piece 165 | pieces[point.X][point.Y] = (turn.Equals(GameTurn.Player)) ? Piece.White : Piece.Black; 166 | WhiteCount = (turn.Equals(GameTurn.Player)) ? WhiteCount + 1 : WhiteCount - 1; 167 | BlackCount = (turn.Equals(GameTurn.Computer)) ? BlackCount + 1 : BlackCount - 1; 168 | 169 | 170 | GameObject temp = pieceGameObjects[point.X][point.Y]; 171 | 172 | // Sets game object representation to instantiated piece 173 | pieceGameObjects[point.X][point.Y] = (turn.Equals(GameTurn.Player)) ? (GameObject)Instantiate(white, board.WorldPosition(point.X, point.Y), white.transform.rotation) 174 | : (GameObject)Instantiate(black, board.WorldPosition(point.X, point.Y), black.transform.rotation); 175 | Destroy(temp); 176 | 177 | for (float timer = 0.1f; timer > 0; timer -= Time.deltaTime) 178 | { 179 | yield return null; 180 | } 181 | } 182 | 183 | // Accounts for subtracting original piece included in PiecesToConvert 184 | if (turn.Equals(GameTurn.Player)) 185 | { 186 | BlackCount++; 187 | } 188 | else 189 | { 190 | WhiteCount++; 191 | } 192 | 193 | // Adds placed piece to the total count 194 | Count++; 195 | } 196 | 197 | #region Piece initialization methods 198 | // Initializes the Piece[][] grid of pieces 199 | private void InitializePieces() 200 | { 201 | pieces = new Piece[board.Size][]; 202 | pieceGameObjects = new GameObject[board.Size][]; 203 | 204 | for (int x = 0; x < board.Size; x++) 205 | { 206 | pieces[x] = new Piece[board.Size]; 207 | pieceGameObjects[x] = new GameObject[board.Size]; 208 | 209 | for (int y = 0; y < board.Size; y++) 210 | { 211 | pieces[x][y] = Piece.None; 212 | pieceGameObjects[x][y] = null; 213 | } 214 | } 215 | 216 | Point firstPiece = new Point((board.Size - 1) / 2, (board.Size - 1) / 2); 217 | 218 | // Sets first 4 pieces (2 Black, 2 White) in diagonal pattern 219 | pieces[firstPiece.X][firstPiece.Y] = Piece.Black; 220 | pieces[firstPiece.X + 1][firstPiece.Y] = Piece.White; 221 | pieces[firstPiece.X][firstPiece.Y + 1] = Piece.White; 222 | pieces[firstPiece.X + 1][firstPiece.Y + 1] = Piece.Black; 223 | } 224 | 225 | // Instantiates board pieces 226 | private void InstantiatePieces() 227 | { 228 | for (int x = 0; x < board.Size; x++) 229 | { 230 | for (int y = 0; y < board.Size; y++) 231 | { 232 | if (pieces[x][y] == Piece.None) 233 | { 234 | continue; 235 | } 236 | else if (pieces[x][y] == Piece.Black) 237 | { 238 | pieceGameObjects[x][y] = (GameObject)Instantiate(black, board.WorldPosition(x, y), black.transform.rotation); 239 | Count++; 240 | BlackCount++; 241 | } 242 | else 243 | { 244 | pieceGameObjects[x][y] = (GameObject)Instantiate(white, board.WorldPosition(x, y), white.transform.rotation); 245 | Count++; 246 | WhiteCount++; 247 | } 248 | } 249 | } 250 | } 251 | #endregion 252 | 253 | /* 254 | #region Debug console methods 255 | // Clears the debug console 256 | public static void ClearLog() 257 | { 258 | Assembly assembly = Assembly.GetAssembly(typeof(ActiveEditorTracker)); 259 | 260 | System.Type type = assembly.GetType("UnityEditorInternal.LogEntries"); 261 | MethodInfo method = type.GetMethod("Clear"); 262 | method.Invoke(new object(), null); 263 | } 264 | #endregion 265 | */ 266 | } 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b7dc39a7d339364eaed72ea4d9ea32c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/PlayerSettings.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Text.RegularExpressions; 4 | 5 | public class PlayerSettings : MonoBehaviour { 6 | 7 | private Board board; 8 | 9 | private GUIStyle boxStyle; 10 | private GUIStyle buttonStyle; 11 | 12 | private Vector2 buttonPosition; 13 | private float buttonWidth; 14 | private float buttonHeight; 15 | 16 | private float boxMessageOffset; 17 | 18 | private int boardSize; 19 | 20 | // Setting strings 21 | private string menu = "Board size"; 22 | private string four = "4x4"; 23 | private string eight = "8x8"; 24 | private string sixteen = "16x16"; 25 | private string thirtytwo = "32x32"; 26 | 27 | void Awake() 28 | { 29 | GUI.enabled = false; 30 | board = GameObject.Find("Board").GetComponent(); 31 | 32 | buttonWidth = Screen.width * .1f; 33 | buttonHeight = Screen.height * .05f; 34 | boxMessageOffset = 50f; 35 | 36 | boardSize = -1; 37 | 38 | buttonPosition.x = (Screen.width / 2.0f) - (buttonWidth / 2); 39 | buttonPosition.y = (Screen.height / 2.0f) - (buttonHeight / 2); 40 | } 41 | 42 | void OnGUI() 43 | { 44 | // GUI.Box that frames all settings buttons in the middle of the screen 45 | boxStyle = new GUIStyle(GUI.skin.box); 46 | boxStyle.fontSize = 30; 47 | GUI.Box(new Rect(buttonPosition.x - (buttonWidth * 1.5f), buttonPosition.y - boxMessageOffset, buttonWidth * 4, buttonHeight + boxMessageOffset), menu, boxStyle); 48 | 49 | // GUI.Buttons that represent the available board sizes: 4x4, 8x8, 16x16, 32x32 50 | buttonStyle = new GUIStyle(GUI.skin.button); 51 | buttonStyle.fontSize = 16; 52 | 53 | if (GUI.Button(new Rect(buttonPosition.x - (buttonWidth * 1.5f), buttonPosition.y, buttonWidth, buttonHeight), four, buttonStyle)) 54 | { 55 | boardSize = 4; 56 | } 57 | else if (GUI.Button(new Rect(buttonPosition.x - (buttonWidth * .5f), buttonPosition.y, buttonWidth, buttonHeight), eight, buttonStyle)) 58 | { 59 | boardSize = 8; 60 | } 61 | else if (GUI.Button(new Rect(buttonPosition.x + (buttonWidth * .5f), buttonPosition.y, buttonWidth, buttonHeight), sixteen, buttonStyle)) 62 | { 63 | boardSize = 16; 64 | } 65 | else if (GUI.Button(new Rect(buttonPosition.x + (buttonWidth * 1.5f), buttonPosition.y, buttonWidth, buttonHeight), thirtytwo, buttonStyle)) 66 | { 67 | boardSize = 32; 68 | } 69 | } 70 | 71 | // Waits for player to choose board size and then sets board size 72 | public IEnumerator SettingsButton() 73 | { 74 | GUI.enabled = true; 75 | 76 | while (true) 77 | { 78 | if (boardSize != -1) 79 | { 80 | board.SetBoardDimensions(boardSize); 81 | break; 82 | } 83 | else 84 | { 85 | yield return null; 86 | } 87 | } 88 | 89 | Debug.Log("Set board size to " + boardSize + "," + boardSize); 90 | this.enabled = false; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/PlayerSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1c2175f113618347800e5b507330c39 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/Point.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Point { 5 | 6 | public int X { get; private set; } 7 | public int Y { get; private set; } 8 | 9 | public Point() 10 | { 11 | X = -1; 12 | Y = -1; 13 | } 14 | 15 | public Point(int x, int y) 16 | { 17 | X = x; 18 | Y = y; 19 | } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | if (obj == null) 24 | { 25 | return false; 26 | } 27 | 28 | if (!(obj is Point)) 29 | { 30 | return false; 31 | } 32 | 33 | return Equals((Point)obj); 34 | } 35 | 36 | public bool Equals(Point point) 37 | { 38 | if (X != point.X) 39 | { 40 | return false; 41 | } 42 | 43 | return (Y == point.Y); 44 | } 45 | 46 | public override int GetHashCode() 47 | { 48 | return X ^ Y; 49 | } 50 | } -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/Point.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3877fd67e26f47446b900e5bf3950b6c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/TileManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class TileManager : MonoBehaviour { 5 | 6 | private Color tileColor; 7 | private Board board; 8 | private Point coord; 9 | 10 | private GameManager gameManager; 11 | private AIManager aiManager; 12 | 13 | void Awake() 14 | { 15 | board = GameObject.Find("Board").GetComponent(); 16 | gameManager = GameObject.Find("Managers").GetComponent(); 17 | aiManager = GameObject.Find("Managers").GetComponent(); 18 | } 19 | 20 | void Start() 21 | { 22 | tileColor = renderer.material.color; 23 | board.Count++; 24 | 25 | coord = new Point((board.Count - 1) / board.Size, (board.Count - 1) % board.Size); 26 | } 27 | 28 | #region Mouse input methods 29 | void OnMouseEnter() 30 | { 31 | if (!aiManager.GameOver) 32 | { 33 | // Highlights the tile as yellow 34 | renderer.material.color = Color.yellow; 35 | } 36 | } 37 | 38 | void OnMouseExit() 39 | { 40 | // Sets the tile back to its original color 41 | renderer.material.color = tileColor; 42 | } 43 | 44 | void OnMouseUpAsButton() 45 | { 46 | if (gameManager.Turn == GameManager.GameTurn.Player && !aiManager.GameOver) 47 | { 48 | gameManager.SetInput(coord); 49 | } 50 | } 51 | #endregion Mouse input methods 52 | } 53 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/TileManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5412cae3a384b4b4882cc26799c86166 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/UIManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class UIManager : MonoBehaviour { 5 | 6 | private GUIStyle messageStyle; 7 | private GUIStyle buttonStyle; 8 | 9 | private bool drawGameOver; 10 | private bool drawMessage; 11 | 12 | private Vector2 buttonPosition; 13 | private Vector2 messagePosition; 14 | 15 | private float messageHeight; 16 | private float buttonHeight; 17 | 18 | private string message; 19 | 20 | void Awake() 21 | { 22 | messageHeight = Screen.height * .4f; 23 | buttonHeight = Screen.height * .4f; 24 | 25 | drawGameOver = false; 26 | drawMessage = false; 27 | } 28 | 29 | void Start() 30 | { 31 | buttonPosition.x = (Screen.width / 2.0f); 32 | buttonPosition.y = (Screen.height / 3.0f); 33 | 34 | messagePosition.x = buttonPosition.x; 35 | messagePosition.y = (Screen.height / 3f); 36 | } 37 | 38 | public IEnumerator ShowMessage(string message, int duration) 39 | { 40 | this.message = message; 41 | drawMessage = true; 42 | 43 | yield return new WaitForSeconds(duration); 44 | 45 | drawMessage = false; 46 | } 47 | 48 | public void OnGUI() 49 | { 50 | if (drawMessage && !drawGameOver) 51 | { 52 | messageStyle = new GUIStyle(GUI.skin.label); 53 | messageStyle.normal.textColor = Color.red; 54 | messageStyle.fontSize = 50; 55 | messageStyle.alignment = TextAnchor.UpperCenter; 56 | 57 | GUI.Label(new Rect(0, 0, Screen.width, messageHeight), message, messageStyle); 58 | } 59 | 60 | if (drawGameOver) 61 | { 62 | buttonStyle = new GUIStyle(GUI.skin.button); 63 | buttonStyle.fontSize = 30; 64 | buttonStyle.alignment = TextAnchor.MiddleCenter; 65 | 66 | if(GUI.Button(new Rect(0, 0, Screen.width, buttonHeight), message, buttonStyle)) 67 | { 68 | Application.LoadLevel("Othello"); 69 | } 70 | } 71 | } 72 | 73 | public void TieGame(int whiteCount, int blackCount) 74 | { 75 | if (whiteCount > blackCount) 76 | { 77 | message = string.Format("No moves left, but you have more points. You win!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 78 | } 79 | else 80 | { 81 | message = string.Format("No moves left, but you have fewer points. You lose!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 82 | } 83 | 84 | drawGameOver = true; 85 | } 86 | 87 | public void GameOver(int whiteCount, int blackCount) 88 | { 89 | if (whiteCount > blackCount) 90 | { 91 | message = string.Format("You win!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 92 | } 93 | else 94 | { 95 | message = string.Format("You lose!\nScore: W {0} vs. B {1}\n\nNew game?", whiteCount, blackCount); 96 | } 97 | 98 | drawGameOver = true; 99 | } 100 | } 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /Reversi/Othello-master/Assets/Scripts/UIManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3faf4b5fb3378824f99d22dafd479388 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Reversi/Othello-master/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Joseph Domenici 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/Othello-master/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /Reversi/Othello-master/README.md: -------------------------------------------------------------------------------- 1 | Othello 2 | ====================== 3 | 4 | What is Othello? 5 | ------------------------------- 6 | 7 | Othello is a board game in which you must outwit the computer by capturing more pieces than it. Each turn you place a piece down that traps at least one computer piece between two of your own, converting all such pieces to your own side. The game continues until there are no moves left, whereupon the winner is the player with the most pieces. 8 | 9 | Visual demonstration: 10 | ![Othello](http://i.imgur.com/LvW6mUK.gif "Kicked the computer's ass!") 11 | 12 | Todo 13 | ---- 14 | 1. Improve best-move algorithm by switching to minimax 15 | 2. Refactor move-detection methods 16 | 3. Fix board spacing rendering bug 17 | 18 | License 19 | ------- 20 | Othello is licensed under the [MIT License](https://github.com/JosephDomenici/Othello/blob/master/LICENSE.md). 21 | 22 | The author appreciates (but does not require) derivative works and copies of the work that: 23 | 1. Visibly link to this GitHub page 24 | 2. Visibly credit the original author, Joseph Domenici -------------------------------------------------------------------------------- /Reversi/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /Reversi/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottlarkin/Reversi---Monte-Carlo-Tree-Search-AI/a14ddf0f9e963e573a7693faed167af370a18204/Reversi/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /Reversi/sysinfo.txt: -------------------------------------------------------------------------------- 1 | System: 2 | OS: Windows 7 Service Pack 1 (6.1.7601) 64bit 3 | CPU: Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz, count: 8 4 | Physical RAM: 16342 MB 5 | Addressable RAM: 2048 MB 6 | 7 | D3D9: 8 | Renderer: NVIDIA Quadro 4000 9 | VendorID: 10de 10 | Driver: nvd3dum.dll 9.18.13.5306 11 | VRAM: 2000 (via DXGI) 12 | 13 | OpenGL: 14 | Version: 4.5.0 NVIDIA 353.06 15 | Vendor: NVIDIA Corporation 16 | Renderer: Quadro 4000/PCIe/SSE2 17 | VRAM: 2000 (via DXGI) 18 | Extensions: GL_AMD_multi_draw_indirect GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_ES3_1_compatibility GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_NV_internalformat_sample_query GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_query_buffer_object GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_clamp GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_import_sync_object GL_NVX_shared_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_context_flush_control GL_KHR_debug GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KTX_buffer_region GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_blend_equation_advanced GL_NV_blend_square GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_explicit_multisample GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_unified_memory GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_video_capture GL_NVX_sysmem_buffer GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_NV_shader_thread_group GL_KHR_blend_equation_advanced GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control 19 | 20 | User locale: en-GB 21 | System locale: en-GB 22 | 23 | Running processes: 24 | sftdcc.exe (7208) 25 | path: C:\Program Files (x86)\Microsoft Application Virtualization Client\sftdcc.exe 26 | company: Microsoft Corporation 27 | product: Microsoft Application Virtualization 28 | filedesc: Microsoft Application Virtualization Desktop Configuration Controller 29 | filever: 4.6.3.24870 30 | prodver: 4.6.3.24870 31 | SCNotification.exe (2912) 32 | path: C:\WINDOWS\CCM\SCNotification.exe 33 | company: Microsoft Corporation 34 | product: System Center Configuration Manager 35 | filedesc: SCNotification 36 | filever: 5.0.8239.1000 37 | prodver: 5.0.8239.1000 38 | DesktopInfo.exe (7524) 39 | path: \\windows\dfs\Wallpaper\Desktopinfo\DesktopInfo.exe 40 | company: Glenn Delahoy 41 | product: Desktop Info 42 | filedesc: Desktop Info 43 | filever: 1.1.2.513 44 | prodver: 1.1.2.513 45 | ActivMgr.exe (8092) 46 | path: C:\Program Files\Activ Software\ActivDriver\ActivMgr.exe 47 | company: 48 | product: ActivManager 49 | filedesc: ActivManager 50 | filever: 5.9.27.1 51 | prodver: 5.9.27.1 52 | flashbridge-wrapper-crossplatform.exe (7536) 53 | path: C:\Program Files\Activ Software\ActivDriver\FlashExtension\flashbridge-wrapper-crossplatform.exe 54 | company: 55 | product: Promethean SDK - Flash proxy 56 | filedesc: Promethean SDK - Flash proxy 57 | filever: 2.3.0.0 58 | prodver: 2.3.0.0 59 | acrotray.exe (2160) 60 | path: C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\acrotray.exe 61 | company: Adobe Systems Inc. 62 | product: AcroTray - Adobe Acrobat Distiller helper application. 63 | filedesc: AcroTray 64 | filever: 15.7.20033.2203 65 | prodver: 15.7.20033.2203 66 | MonoDevelop.exe (4472) 67 | path: C:\Program Files (x86)\Unity\MonoDevelop\bin\MonoDevelop.exe 68 | company: 69 | product: MonoDevelop 70 | filedesc: MonoDevelop 71 | filever: 2.6.0.0 72 | prodver: 2.6.0.0 73 | UnityBugReporter.exe (5812) 74 | path: C:\Program Files (x86)\Unity\Editor\UnityBugReporter.exe 75 | company: Unity Technologies ApS 76 | product: Unity Bug Reporter 77 | filedesc: Unity Bug Reporter 78 | filever: 4.6.4.63619 79 | prodver: 4.6.4.63619 80 | --------------------------------------------------------------------------------