Skip to content

Commit

Permalink
🔄 Update doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarox28 committed Nov 5, 2023
1 parent 3ab2017 commit 744076f
Show file tree
Hide file tree
Showing 13 changed files with 312 additions and 280 deletions.
61 changes: 34 additions & 27 deletions docs/html/games_2connect4_2main_8cpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,33 +198,40 @@
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <a class="code hl_function" href="games_2connect4_2main_8cpp.html#abffa007bb503ae89633525216553b652">drawConnect4</a>(grid, cusorPos, playerTurn);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">while</span> (winner == 0)</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordtype">int</span> usrInput = <a class="code hl_function" href="namespacetermkit.html#a3ee5435f45bee669e83ec94574952ff8">termkit::getch</a>();</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">if</span> (usrInput == 68 &amp;&amp; cusorPos &gt; 1) <span class="comment">// Left arrow</span></div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> cusorPos--;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usrInput == 67 &amp;&amp; cusorPos &lt; 7) <span class="comment">// Right arrow</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> cusorPos++;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usrInput == 13) <span class="comment">// Enter</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> {</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">while</span> (i &lt; 6 &amp;&amp; grid[i][cusorPos - 1] == 0) <span class="comment">// Find the first used slot from the bottom</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> i++;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">if</span> (i &gt; 0)</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> {</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> grid[i - 1][cusorPos - 1] = playerTurn; <span class="comment">// Place the token (i-1 because i is obviously used and cursorPos-1 because the grid starts at 0 but the cursor starts at 1)</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">if</span> (playerTurn == 1)</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> playerTurn = 2;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> playerTurn = 1;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> }</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> }</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usrInput == 3) <span class="comment">// Ctrl^C</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <a class="code hl_function" href="games_2connect4_2main_8cpp.html#abffa007bb503ae89633525216553b652">drawConnect4</a>(grid, cusorPos, playerTurn);</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> winner = <a class="code hl_function" href="games_2connect4_2main_8cpp.html#a87a636993ed024c19c9ff207f86a2b2b">checkConnect4</a>(grid);</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> }</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> cout &lt;&lt; <a class="code hl_function" href="namespacetermkit.html#af969f49dd6403a6938331ef2039f28ae">termkit::center_line</a>(<span class="stringliteral">&quot;Player &quot;</span> + to_string(winner) + <span class="stringliteral">&quot; won !&quot;</span>) &lt;&lt; endl;</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <a class="code hl_function" href="namespace_utils.html#a78f4b63f11f1d9f8feada0ba4e246e82">Utils::wait</a>(5);</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span>}</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span><span class="preprocessor">#if defined(unix) || defined(__APPLE__) </span><span class="comment">// linux and mac support</span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordtype">int</span> leftArrow = 68;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordtype">int</span> rightArrow = 67;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="preprocessor">#elif defined(_WIN32) || defined(_WIN64) </span><span class="comment">// windows support</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordtype">int</span> leftArrow = 75;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordtype">int</span> rightArrow = 77;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordtype">int</span> usrInput = <a class="code hl_function" href="namespacetermkit.html#a3ee5435f45bee669e83ec94574952ff8">termkit::getch</a>();</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">if</span> (usrInput == leftArrow &amp;&amp; cusorPos &gt; 1) <span class="comment">// Left arrow</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> cusorPos--;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usrInput == rightArrow &amp;&amp; cusorPos &lt; 7) <span class="comment">// Right arrow</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> cusorPos++;</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usrInput == 13) <span class="comment">// Enter</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> {</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">while</span> (i &lt; 6 &amp;&amp; grid[i][cusorPos - 1] == 0) <span class="comment">// Find the first used slot from the bottom</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> i++;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keywordflow">if</span> (i &gt; 0)</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> {</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> grid[i - 1][cusorPos - 1] = playerTurn; <span class="comment">// Place the token (i-1 because i is obviously used and cursorPos-1 because the grid starts at 0 but the cursor starts at 1)</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">if</span> (playerTurn == 1)</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> playerTurn = 2;</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> playerTurn = 1;</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> }</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usrInput == 3) <span class="comment">// Ctrl^C</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <a class="code hl_function" href="games_2connect4_2main_8cpp.html#abffa007bb503ae89633525216553b652">drawConnect4</a>(grid, cusorPos, playerTurn);</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> winner = <a class="code hl_function" href="games_2connect4_2main_8cpp.html#a87a636993ed024c19c9ff207f86a2b2b">checkConnect4</a>(grid);</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> }</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> cout &lt;&lt; <a class="code hl_function" href="namespacetermkit.html#af969f49dd6403a6938331ef2039f28ae">termkit::center_line</a>(<span class="stringliteral">&quot;Player &quot;</span> + to_string(winner) + <span class="stringliteral">&quot; won !&quot;</span>) &lt;&lt; endl;</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <a class="code hl_function" href="namespace_utils.html#a78f4b63f11f1d9f8feada0ba4e246e82">Utils::wait</a>(5);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span>}</div>
</div>
<div class="ttc" id="agames_2connect4_2main_8cpp_html_a461c7e22c55a5716d316a8e3d5f23897"><div class="ttname"><a href="games_2connect4_2main_8cpp.html#a461c7e22c55a5716d316a8e3d5f23897">connect4</a></div><div class="ttdeci">void connect4()</div><div class="ttdoc">Connect 4 game main function.</div><div class="ttdef"><b>Definition</b> main.cpp:124</div></div>
<div class="ttc" id="agames_2connect4_2main_8cpp_html_a87a636993ed024c19c9ff207f86a2b2b"><div class="ttname"><a href="games_2connect4_2main_8cpp.html#a87a636993ed024c19c9ff207f86a2b2b">checkConnect4</a></div><div class="ttdeci">int checkConnect4(int grid[6][7])</div><div class="ttdoc">Chech if there is a connect 4 in the grid.</div><div class="ttdef"><b>Definition</b> main.cpp:86</div></div>
Expand Down
1 change: 1 addition & 0 deletions docs/html/games_2right_01price_2main_8cpp.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<code>#include &lt;random&gt;</code><br />
<code>#include &lt;string&gt;</code><br />
<code>#include &quot;<a class="el" href="utils_8hpp_source.html">../../libs/utils.hpp</a>&quot;</code><br />
<code>#include &lt;time.h&gt;</code><br />
</div>
<p><a href="games_2right_01price_2main_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
Expand Down
Loading

0 comments on commit 744076f

Please sign in to comment.