Documentation for 2dadbf73f4

This commit is contained in:
github-actions
2024-02-12 20:07:08 +00:00
parent b5b4d78981
commit a1eb9bd385
1261 changed files with 30404 additions and 29974 deletions

View File

@@ -3,16 +3,18 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: games/memory_game.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
@@ -41,7 +43,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -53,7 +55,7 @@ var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
$(function() { init_search(); });
});
/* @license-end */
</script>
@@ -71,7 +73,7 @@ $(function() {
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('dd/d92/memory__game_8cpp.html','../../'); initResizable(); });
$(function(){initNavTree('dd/d92/memory__game_8cpp.html','../../'); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
@@ -121,38 +123,38 @@ Include dependency graph for memory_game.cpp:</div>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a5bdc30951221eae9c33413ff9eb574f6" id="r_a5bdc30951221eae9c33413ff9eb574f6"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a5bdc30951221eae9c33413ff9eb574f6"><td class="memTemplItemLeft" align="right" valign="top">constexpr T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a> (T seconds)</td></tr>
<tr class="memitem:a5bdc30951221eae9c33413ff9eb574f6"><td class="memTemplItemLeft" align="right" valign="top">constexpr T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a> (T seconds)</td></tr>
<tr class="memdesc:a5bdc30951221eae9c33413ff9eb574f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">for sleep() <br /></td></tr>
<tr class="separator:a5bdc30951221eae9c33413ff9eb574f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33167bb9cce6d527b478b4f6ae8c3f59" id="r_a33167bb9cce6d527b478b4f6ae8c3f59"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a33167bb9cce6d527b478b4f6ae8c3f59"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#a33167bb9cce6d527b478b4f6ae8c3f59">games::memory_game::is_number</a> (const T &amp;input)</td></tr>
<tr class="memitem:a33167bb9cce6d527b478b4f6ae8c3f59"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a33167bb9cce6d527b478b4f6ae8c3f59">games::memory_game::is_number</a> (const T &amp;input)</td></tr>
<tr class="memdesc:a33167bb9cce6d527b478b4f6ae8c3f59"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to verify if the given input is a number or not. This is very useful to prevent the program being stuck in a loop. <br /></td></tr>
<tr class="separator:a33167bb9cce6d527b478b4f6ae8c3f59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad573c8ae66ab66156d03e5e81bbba214" id="r_ad573c8ae66ab66156d03e5e81bbba214"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ad573c8ae66ab66156d03e5e81bbba214"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#ad573c8ae66ab66156d03e5e81bbba214">games::memory_game::init</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table)</td></tr>
<tr class="memitem:ad573c8ae66ab66156d03e5e81bbba214"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ad573c8ae66ab66156d03e5e81bbba214">games::memory_game::init</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table)</td></tr>
<tr class="memdesc:ad573c8ae66ab66156d03e5e81bbba214"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the table with the letters. <br /></td></tr>
<tr class="separator:ad573c8ae66ab66156d03e5e81bbba214"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac589ef65abb0a6b9a7116ee0f9fd5280" id="r_ac589ef65abb0a6b9a7116ee0f9fd5280"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ac589ef65abb0a6b9a7116ee0f9fd5280"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#ac589ef65abb0a6b9a7116ee0f9fd5280">games::memory_game::print_table</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table)</td></tr>
<tr class="memitem:ac589ef65abb0a6b9a7116ee0f9fd5280"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ac589ef65abb0a6b9a7116ee0f9fd5280">games::memory_game::print_table</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table)</td></tr>
<tr class="memdesc:ac589ef65abb0a6b9a7116ee0f9fd5280"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to print the table. <br /></td></tr>
<tr class="separator:ac589ef65abb0a6b9a7116ee0f9fd5280"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc62ebb75853446656e24932bdc6dd6b" id="r_adc62ebb75853446656e24932bdc6dd6b"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:adc62ebb75853446656e24932bdc6dd6b"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#adc62ebb75853446656e24932bdc6dd6b">games::memory_game::reset_data</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table, int *answer, int *old_answer, int *memory_count)</td></tr>
<tr class="memitem:adc62ebb75853446656e24932bdc6dd6b"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#adc62ebb75853446656e24932bdc6dd6b">games::memory_game::reset_data</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table, int *answer, int *old_answer, int *memory_count)</td></tr>
<tr class="memdesc:adc62ebb75853446656e24932bdc6dd6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function that resets the data if the user enters an invalid value. <br /></td></tr>
<tr class="separator:adc62ebb75853446656e24932bdc6dd6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5714d97649c0edd57b4fb449799676a3" id="r_a5714d97649c0edd57b4fb449799676a3"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a5714d97649c0edd57b4fb449799676a3"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#a5714d97649c0edd57b4fb449799676a3">games::memory_game::ask_data</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table, int *answer, int *old_answer, int *memory_count)</td></tr>
<tr class="memitem:a5714d97649c0edd57b4fb449799676a3"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a5714d97649c0edd57b4fb449799676a3">games::memory_game::ask_data</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table, int *answer, int *old_answer, int *memory_count)</td></tr>
<tr class="memdesc:a5714d97649c0edd57b4fb449799676a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function that asks the user for their input in the table they previously chose. <br /></td></tr>
<tr class="separator:a5714d97649c0edd57b4fb449799676a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a370760f2b328ad341bcb77d82fa17b01" id="r_a370760f2b328ad341bcb77d82fa17b01"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a370760f2b328ad341bcb77d82fa17b01"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#a370760f2b328ad341bcb77d82fa17b01">games::memory_game::match</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table_empty, const int &amp;answer, bool *first_time, int *old_answer, int *memory_count)</td></tr>
<tr class="memitem:a370760f2b328ad341bcb77d82fa17b01"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a370760f2b328ad341bcb77d82fa17b01">games::memory_game::match</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;table, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table_empty, const int &amp;answer, bool *first_time, int *old_answer, int *memory_count)</td></tr>
<tr class="memdesc:a370760f2b328ad341bcb77d82fa17b01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the two values given by the user match. <br /></td></tr>
<tr class="separator:a370760f2b328ad341bcb77d82fa17b01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ceeea62d8fa6c563e2c66359fd73413" id="r_a3ceeea62d8fa6c563e2c66359fd73413"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a3ceeea62d8fa6c563e2c66359fd73413"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#a3ceeea62d8fa6c563e2c66359fd73413">games::memory_game::assign_results</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table_empty, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table, int *answer, bool *first_time, int *old_answer, int *memory_count)</td></tr>
<tr class="memitem:a3ceeea62d8fa6c563e2c66359fd73413"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a3ceeea62d8fa6c563e2c66359fd73413">games::memory_game::assign_results</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table_empty, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *table, int *answer, bool *first_time, int *old_answer, int *memory_count)</td></tr>
<tr class="memdesc:a3ceeea62d8fa6c563e2c66359fd73413"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to assign the results to the table. <br /></td></tr>
<tr class="separator:a3ceeea62d8fa6c563e2c66359fd73413"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d92/memory__game_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
@@ -173,31 +175,22 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">void games::memory_game::ask_data </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;&#160;</td>
<td class="paramname"><em>table</em>, </td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>table</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>answer</em>, </td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>old_answer</em>, </td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>old_answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>memory_count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>memory_count</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -221,14 +214,14 @@ template&lt;typename T &gt; </div>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 162</span> {</div>
<div class="line"><span class="lineno"> 163</span> (*old_answer) = (*answer);</div>
<div class="line"><span class="lineno"> 164</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#ac589ef65abb0a6b9a7116ee0f9fd5280">print_table</a>(table);</div>
<div class="line"><span class="lineno"> 164</span> <a class="code hl_function" href="#ac589ef65abb0a6b9a7116ee0f9fd5280">print_table</a>(table);</div>
<div class="line"><span class="lineno"> 165</span> </div>
<div class="line"><span class="lineno"> 166</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n\nType your response here (number index):\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 167</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; (*answer);</div>
<div class="line"><span class="lineno"> 168</span> </div>
<div class="line"><span class="lineno"> 169</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a33167bb9cce6d527b478b4f6ae8c3f59">is_number</a>((*answer))) {</div>
<div class="line"><span class="lineno"> 169</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="#a33167bb9cce6d527b478b4f6ae8c3f59">is_number</a>((*answer))) {</div>
<div class="line"><span class="lineno"> 170</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nYou must enter a valid number.\n\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 171</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 171</span> <a class="code hl_function" href="#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 172</span> }</div>
<div class="line"><span class="lineno"> 173</span> </div>
<div class="line"><span class="lineno"> 174</span> <span class="comment">// Increase the memory count, which will be later on used for checking if</span></div>
@@ -238,12 +231,12 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 178</span> <span class="keywordflow">if</span> (((*answer) &gt; table.size()) || ((*answer) &lt; 1)) {</div>
<div class="line"><span class="lineno"> 179</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nYou can&#39;t check a value that doesn&#39;t exist (or an &quot;</span></div>
<div class="line"><span class="lineno"> 180</span> <span class="stringliteral">&quot;invalid number).\n\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 181</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 181</span> <a class="code hl_function" href="#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 182</span> }</div>
<div class="line"><span class="lineno"> 183</span> </div>
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">if</span> ((*old_answer) == (*answer)) {</div>
<div class="line"><span class="lineno"> 185</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nYou can&#39;t check the same value twice.\n\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 186</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 186</span> <a class="code hl_function" href="#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 187</span> }</div>
<div class="line"><span class="lineno"> 188</span> </div>
<div class="line"><span class="lineno"> 189</span> <span class="comment">// If two matches are answered already, but the user checkes a non-answered</span></div>
@@ -252,14 +245,14 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 192</span> <span class="keywordflow">if</span> ((table[(*answer) - 1] != 0) &amp;&amp;</div>
<div class="line"><span class="lineno"> 193</span> ((table[(*old_answer)] == 0) || (table[(*old_answer)] != 0))) {</div>
<div class="line"><span class="lineno"> 194</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nYou can&#39;t check the same value twice.\n\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 195</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 195</span> <a class="code hl_function" href="#adc62ebb75853446656e24932bdc6dd6b">reset_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 196</span> }</div>
<div class="line"><span class="lineno"> 197</span>}</div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="amemory__game_8cpp_html_a33167bb9cce6d527b478b4f6ae8c3f59"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#a33167bb9cce6d527b478b4f6ae8c3f59">games::memory_game::is_number</a></div><div class="ttdeci">bool is_number(const T &amp;input)</div><div class="ttdoc">Utility function to verify if the given input is a number or not. This is very useful to prevent the ...</div><div class="ttdef"><b>Definition</b> memory_game.cpp:62</div></div>
<div class="ttc" id="amemory__game_8cpp_html_ac589ef65abb0a6b9a7116ee0f9fd5280"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#ac589ef65abb0a6b9a7116ee0f9fd5280">games::memory_game::print_table</a></div><div class="ttdeci">void print_table(const std::vector&lt; T &gt; &amp;table)</div><div class="ttdoc">Utility function to print the table.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:123</div></div>
<div class="ttc" id="amemory__game_8cpp_html_adc62ebb75853446656e24932bdc6dd6b"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#adc62ebb75853446656e24932bdc6dd6b">games::memory_game::reset_data</a></div><div class="ttdeci">void reset_data(const std::vector&lt; T &gt; &amp;, int *, int *, int *)</div><div class="ttdoc">Utility function that resets the data if the user enters an invalid value.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:211</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a33167bb9cce6d527b478b4f6ae8c3f59"><div class="ttname"><a href="#a33167bb9cce6d527b478b4f6ae8c3f59">games::memory_game::is_number</a></div><div class="ttdeci">bool is_number(const T &amp;input)</div><div class="ttdoc">Utility function to verify if the given input is a number or not. This is very useful to prevent the ...</div><div class="ttdef"><b>Definition</b> memory_game.cpp:62</div></div>
<div class="ttc" id="amemory__game_8cpp_html_ac589ef65abb0a6b9a7116ee0f9fd5280"><div class="ttname"><a href="#ac589ef65abb0a6b9a7116ee0f9fd5280">games::memory_game::print_table</a></div><div class="ttdeci">void print_table(const std::vector&lt; T &gt; &amp;table)</div><div class="ttdoc">Utility function to print the table.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:123</div></div>
<div class="ttc" id="amemory__game_8cpp_html_adc62ebb75853446656e24932bdc6dd6b"><div class="ttname"><a href="#adc62ebb75853446656e24932bdc6dd6b">games::memory_game::reset_data</a></div><div class="ttdeci">void reset_data(const std::vector&lt; T &gt; &amp;, int *, int *, int *)</div><div class="ttdoc">Utility function that resets the data if the user enters an invalid value.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:211</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -279,43 +272,32 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">void games::memory_game::assign_results </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *&#160;</td>
<td class="paramname"><em>table_empty</em>, </td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>table_empty</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *&#160;</td>
<td class="paramname"><em>table</em>, </td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>table</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>answer</em>, </td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool *&#160;</td>
<td class="paramname"><em>first_time</em>, </td>
<td class="paramtype">bool *</td> <td class="paramname"><span class="paramname"><em>first_time</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>old_answer</em>, </td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>old_answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>memory_count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>memory_count</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -345,7 +327,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 294</span> <span class="comment">// keep older values already answered.</span></div>
<div class="line"><span class="lineno"> 295</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; (*table).size() + 1; i++) {</div>
<div class="line"><span class="lineno"> 296</span> <span class="keywordflow">if</span> (i == (*answer)) {</div>
<div class="line"><span class="lineno"> 297</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a370760f2b328ad341bcb77d82fa17b01">match</a>((*table), table_empty, (*answer), first_time, old_answer,</div>
<div class="line"><span class="lineno"> 297</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a370760f2b328ad341bcb77d82fa17b01">match</a>((*table), table_empty, (*answer), first_time, old_answer,</div>
<div class="line"><span class="lineno"> 298</span> memory_count) == <span class="keyword">true</span>) {</div>
<div class="line"><span class="lineno"> 299</span> (*table_empty)[i - 1] = (*table)[i - 1];</div>
<div class="line"><span class="lineno"> 300</span> (*first_time) = <span class="keyword">true</span>;</div>
@@ -366,7 +348,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 315</span> <span class="keywordflow">if</span> ((*table_empty)[i] == 0) {</div>
<div class="line"><span class="lineno"> 316</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 317</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i == (*table).size() - 1) {</div>
<div class="line"><span class="lineno"> 318</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#ac589ef65abb0a6b9a7116ee0f9fd5280">print_table</a>((*table));</div>
<div class="line"><span class="lineno"> 318</span> <a class="code hl_function" href="#ac589ef65abb0a6b9a7116ee0f9fd5280">print_table</a>((*table));</div>
<div class="line"><span class="lineno"> 319</span> </div>
<div class="line"><span class="lineno"> 320</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n\nYou won. Congratulations! Do you want to play &quot;</span></div>
<div class="line"><span class="lineno"> 321</span> <span class="stringliteral">&quot;again? (y/n)\n&quot;</span>;</div>
@@ -381,15 +363,15 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 330</span> (*table_empty)[i] = 0;</div>
<div class="line"><span class="lineno"> 331</span> }</div>
<div class="line"><span class="lineno"> 332</span> </div>
<div class="line"><span class="lineno"> 333</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#ad573c8ae66ab66156d03e5e81bbba214">init</a>(table);</div>
<div class="line"><span class="lineno"> 333</span> <a class="code hl_function" href="#ad573c8ae66ab66156d03e5e81bbba214">init</a>(table);</div>
<div class="line"><span class="lineno"> 334</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (try_again == <span class="charliteral">&#39;n&#39;</span>) {</div>
<div class="line"><span class="lineno"> 335</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nThanks for playing the game!\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 336</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a>(3);</div>
<div class="line"><span class="lineno"> 336</span> <a class="code hl_function" href="#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a>(3);</div>
<div class="line"><span class="lineno"> 337</span> </div>
<div class="line"><span class="lineno"> 338</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/program/exit.html">exit</a>(0);</div>
<div class="line"><span class="lineno"> 339</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 340</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nInvalid input (exitting...).\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 341</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a>(3);</div>
<div class="line"><span class="lineno"> 341</span> <a class="code hl_function" href="#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a>(3);</div>
<div class="line"><span class="lineno"> 342</span> </div>
<div class="line"><span class="lineno"> 343</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/program/exit.html">exit</a>(0);</div>
<div class="line"><span class="lineno"> 344</span> }</div>
@@ -397,16 +379,16 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 346</span> }</div>
<div class="line"><span class="lineno"> 347</span> </div>
<div class="line"><span class="lineno"> 348</span> <span class="comment">// Ask data again.</span></div>
<div class="line"><span class="lineno"> 349</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a5714d97649c0edd57b4fb449799676a3">ask_data</a>((*table_empty), answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 350</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a3ceeea62d8fa6c563e2c66359fd73413">assign_results</a>(table_empty, table, answer, first_time, old_answer,</div>
<div class="line"><span class="lineno"> 349</span> <a class="code hl_function" href="#a5714d97649c0edd57b4fb449799676a3">ask_data</a>((*table_empty), answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 350</span> <a class="code hl_function" href="#a3ceeea62d8fa6c563e2c66359fd73413">assign_results</a>(table_empty, table, answer, first_time, old_answer,</div>
<div class="line"><span class="lineno"> 351</span> memory_count);</div>
<div class="line"><span class="lineno"> 352</span>}</div>
<div class="ttc" id="aexit_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/program/exit.html">std::exit</a></div><div class="ttdeci">T exit(T... args)</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a370760f2b328ad341bcb77d82fa17b01"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#a370760f2b328ad341bcb77d82fa17b01">games::memory_game::match</a></div><div class="ttdeci">bool match(const std::vector&lt; T &gt; &amp;table, std::vector&lt; T &gt; *table_empty, const int &amp;answer, bool *first_time, int *old_answer, int *memory_count)</div><div class="ttdoc">Checks if the two values given by the user match.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:235</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a3ceeea62d8fa6c563e2c66359fd73413"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#a3ceeea62d8fa6c563e2c66359fd73413">games::memory_game::assign_results</a></div><div class="ttdeci">void assign_results(std::vector&lt; T &gt; *table_empty, std::vector&lt; T &gt; *table, int *answer, bool *first_time, int *old_answer, int *memory_count)</div><div class="ttdoc">Function to assign the results to the table.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:289</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a5714d97649c0edd57b4fb449799676a3"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#a5714d97649c0edd57b4fb449799676a3">games::memory_game::ask_data</a></div><div class="ttdeci">void ask_data(const std::vector&lt; T &gt; &amp;table, int *answer, int *old_answer, int *memory_count)</div><div class="ttdoc">Function that asks the user for their input in the table they previously chose.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:161</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a5bdc30951221eae9c33413ff9eb574f6"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a></div><div class="ttdeci">constexpr T SLEEP(T seconds)</div><div class="ttdoc">for sleep()</div><div class="ttdef"><b>Definition</b> memory_game.cpp:36</div></div>
<div class="ttc" id="amemory__game_8cpp_html_ad573c8ae66ab66156d03e5e81bbba214"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#ad573c8ae66ab66156d03e5e81bbba214">games::memory_game::init</a></div><div class="ttdeci">void init(std::vector&lt; T &gt; *table)</div><div class="ttdoc">Initializes the table with the letters.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:80</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a370760f2b328ad341bcb77d82fa17b01"><div class="ttname"><a href="#a370760f2b328ad341bcb77d82fa17b01">games::memory_game::match</a></div><div class="ttdeci">bool match(const std::vector&lt; T &gt; &amp;table, std::vector&lt; T &gt; *table_empty, const int &amp;answer, bool *first_time, int *old_answer, int *memory_count)</div><div class="ttdoc">Checks if the two values given by the user match.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:235</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a3ceeea62d8fa6c563e2c66359fd73413"><div class="ttname"><a href="#a3ceeea62d8fa6c563e2c66359fd73413">games::memory_game::assign_results</a></div><div class="ttdeci">void assign_results(std::vector&lt; T &gt; *table_empty, std::vector&lt; T &gt; *table, int *answer, bool *first_time, int *old_answer, int *memory_count)</div><div class="ttdoc">Function to assign the results to the table.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:289</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a5714d97649c0edd57b4fb449799676a3"><div class="ttname"><a href="#a5714d97649c0edd57b4fb449799676a3">games::memory_game::ask_data</a></div><div class="ttdeci">void ask_data(const std::vector&lt; T &gt; &amp;table, int *answer, int *old_answer, int *memory_count)</div><div class="ttdoc">Function that asks the user for their input in the table they previously chose.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:161</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a5bdc30951221eae9c33413ff9eb574f6"><div class="ttname"><a href="#a5bdc30951221eae9c33413ff9eb574f6">SLEEP</a></div><div class="ttdeci">constexpr T SLEEP(T seconds)</div><div class="ttdoc">for sleep()</div><div class="ttdef"><b>Definition</b> memory_game.cpp:36</div></div>
<div class="ttc" id="amemory__game_8cpp_html_ad573c8ae66ab66156d03e5e81bbba214"><div class="ttname"><a href="#ad573c8ae66ab66156d03e5e81bbba214">games::memory_game::init</a></div><div class="ttdeci">void init(std::vector&lt; T &gt; *table)</div><div class="ttdoc">Initializes the table with the letters.</div><div class="ttdef"><b>Definition</b> memory_game.cpp:80</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -426,8 +408,7 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">void games::memory_game::init </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *&#160;</td>
<td class="paramname"><em>table</em></td><td>)</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>table</em></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -508,8 +489,7 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">bool games::memory_game::is_number </td>
<td>(</td>
<td class="paramtype">const T &amp;&#160;</td>
<td class="paramname"><em>input</em></td><td>)</td>
<td class="paramtype">const T &amp;</td> <td class="paramname"><span class="paramname"><em>input</em></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -558,8 +538,7 @@ Here is the call graph for this function:</div>
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -589,54 +568,51 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 373</span><span class="comment"> ///&lt; (previous answered values do not count).</span></div>
<div class="line"><span class="lineno"> 374</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 375</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\tMEMORY GAME\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 376</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/boolalpha.html">std::boolalpha</a>;</div>
<div class="line"><span class="lineno"> 377</span> std::cout &lt;&lt; std::is_literal_type&lt;void&gt;::value;</div>
<div class="line"><span class="lineno"> 378</span> </div>
<div class="line"><span class="lineno"> 379</span> <span class="keywordflow">do</span> {</div>
<div class="line"><span class="lineno"> 380</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n1. 4x2 (1)&quot;</span>;</div>
<div class="line"><span class="lineno"> 381</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n2. 5x2 (2)&quot;</span>;</div>
<div class="line"><span class="lineno"> 382</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n3. 7x2 (3)\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 383</span> </div>
<div class="line"><span class="lineno"> 384</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nChoose table size: &quot;</span>;</div>
<div class="line"><span class="lineno"> 385</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; selection;</div>
<div class="line"><span class="lineno"> 386</span> } <span class="keywordflow">while</span> ((selection &lt; 1 || selection &gt; 3) &amp;&amp;</div>
<div class="line"><span class="lineno"> 387</span> (!games::memory_game::is_number(selection)));</div>
<div class="line"><span class="lineno"> 388</span> </div>
<div class="line"><span class="lineno"> 389</span> <span class="keywordflow">switch</span> (selection) {</div>
<div class="line"><span class="lineno"> 390</span> <span class="keywordflow">case</span> 1:</div>
<div class="line"><span class="lineno"> 391</span> size = 8;</div>
<div class="line"><span class="lineno"> 392</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 393</span> <span class="keywordflow">case</span> 2:</div>
<div class="line"><span class="lineno"> 394</span> size = 10;</div>
<div class="line"><span class="lineno"> 395</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 396</span> <span class="keywordflow">case</span> 3:</div>
<div class="line"><span class="lineno"> 397</span> size = 14;</div>
<div class="line"><span class="lineno"> 398</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 399</span> <span class="keywordflow">default</span>:</div>
<div class="line"><span class="lineno"> 400</span> size = 10;</div>
<div class="line"><span class="lineno"> 401</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 402</span> }</div>
<div class="line"><span class="lineno"> 403</span> </div>
<div class="line"><span class="lineno"> 404</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;char&gt;</a> table(size);</div>
<div class="line"><span class="lineno"> 405</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;char&gt;</a> table_empty(size);</div>
<div class="line"><span class="lineno"> 376</span> </div>
<div class="line"><span class="lineno"> 377</span> <span class="keywordflow">do</span> {</div>
<div class="line"><span class="lineno"> 378</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n1. 4x2 (1)&quot;</span>;</div>
<div class="line"><span class="lineno"> 379</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n2. 5x2 (2)&quot;</span>;</div>
<div class="line"><span class="lineno"> 380</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n3. 7x2 (3)\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 381</span> </div>
<div class="line"><span class="lineno"> 382</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nChoose table size: &quot;</span>;</div>
<div class="line"><span class="lineno"> 383</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; selection;</div>
<div class="line"><span class="lineno"> 384</span> } <span class="keywordflow">while</span> ((selection &lt; 1 || selection &gt; 3) &amp;&amp;</div>
<div class="line"><span class="lineno"> 385</span> (!games::memory_game::is_number(selection)));</div>
<div class="line"><span class="lineno"> 386</span> </div>
<div class="line"><span class="lineno"> 387</span> <span class="keywordflow">switch</span> (selection) {</div>
<div class="line"><span class="lineno"> 388</span> <span class="keywordflow">case</span> 1:</div>
<div class="line"><span class="lineno"> 389</span> size = 8;</div>
<div class="line"><span class="lineno"> 390</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 391</span> <span class="keywordflow">case</span> 2:</div>
<div class="line"><span class="lineno"> 392</span> size = 10;</div>
<div class="line"><span class="lineno"> 393</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 394</span> <span class="keywordflow">case</span> 3:</div>
<div class="line"><span class="lineno"> 395</span> size = 14;</div>
<div class="line"><span class="lineno"> 396</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 397</span> <span class="keywordflow">default</span>:</div>
<div class="line"><span class="lineno"> 398</span> size = 10;</div>
<div class="line"><span class="lineno"> 399</span> <span class="keywordflow">break</span>;</div>
<div class="line"><span class="lineno"> 400</span> }</div>
<div class="line"><span class="lineno"> 401</span> </div>
<div class="line"><span class="lineno"> 402</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;char&gt;</a> table(size);</div>
<div class="line"><span class="lineno"> 403</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;char&gt;</a> table_empty(size);</div>
<div class="line"><span class="lineno"> 404</span> </div>
<div class="line"><span class="lineno"> 405</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 406</span> </div>
<div class="line"><span class="lineno"> 407</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 408</span> </div>
<div class="line"><span class="lineno"> 409</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#ad573c8ae66ab66156d03e5e81bbba214">games::memory_game::init</a>(&amp;table);</div>
<div class="line"><span class="lineno"> 410</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a5714d97649c0edd57b4fb449799676a3">games::memory_game::ask_data</a>(table_empty, &amp;response, &amp;old_answer,</div>
<div class="line"><span class="lineno"> 411</span> &amp;memory_count);</div>
<div class="line"><span class="lineno"> 412</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a3ceeea62d8fa6c563e2c66359fd73413">games::memory_game::assign_results</a>(&amp;table_empty, &amp;table, &amp;response,</div>
<div class="line"><span class="lineno"> 413</span> &amp;first_time, &amp;old_answer, &amp;memory_count);</div>
<div class="line"><span class="lineno"> 414</span> </div>
<div class="line"><span class="lineno"> 415</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 416</span>}</div>
<div class="ttc" id="aboolalpha_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/boolalpha.html">std::boolalpha</a></div><div class="ttdeci">T boolalpha(T... args)</div></div>
<div class="line"><span class="lineno"> 407</span> <a class="code hl_function" href="#ad573c8ae66ab66156d03e5e81bbba214">games::memory_game::init</a>(&amp;table);</div>
<div class="line"><span class="lineno"> 408</span> <a class="code hl_function" href="#a5714d97649c0edd57b4fb449799676a3">games::memory_game::ask_data</a>(table_empty, &amp;response, &amp;old_answer,</div>
<div class="line"><span class="lineno"> 409</span> &amp;memory_count);</div>
<div class="line"><span class="lineno"> 410</span> <a class="code hl_function" href="#a3ceeea62d8fa6c563e2c66359fd73413">games::memory_game::assign_results</a>(&amp;table_empty, &amp;table, &amp;response,</div>
<div class="line"><span class="lineno"> 411</span> &amp;first_time, &amp;old_answer, &amp;memory_count);</div>
<div class="line"><span class="lineno"> 412</span> </div>
<div class="line"><span class="lineno"> 413</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 414</span>}</div>
<div class="ttc" id="asrand_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/random/srand.html">std::srand</a></div><div class="ttdeci">T srand(T... args)</div></div>
<div class="ttc" id="atime_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a></div><div class="ttdeci">T time(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d92/memory__game_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="211" height="135"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d92/memory__game_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="188" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -652,43 +628,32 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">bool games::memory_game::match </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;&#160;</td>
<td class="paramname"><em>table</em>, </td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>table</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *&#160;</td>
<td class="paramname"><em>table_empty</em>, </td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>table_empty</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int &amp;&#160;</td>
<td class="paramname"><em>answer</em>, </td>
<td class="paramtype">const int &amp;</td> <td class="paramname"><span class="paramname"><em>answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool *&#160;</td>
<td class="paramname"><em>first_time</em>, </td>
<td class="paramtype">bool *</td> <td class="paramname"><span class="paramname"><em>first_time</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>old_answer</em>, </td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>old_answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>memory_count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>memory_count</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -766,8 +731,7 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">void games::memory_game::print_table </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;&#160;</td>
<td class="paramname"><em>table</em></td><td>)</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>table</em></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -826,31 +790,22 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">void games::memory_game::reset_data </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;&#160;</td>
<td class="paramname"><em>table</em>, </td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>table</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>answer</em>, </td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>old_answer</em>, </td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>old_answer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>memory_count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>memory_count</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -876,7 +831,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 213</span> (*answer) = (*old_answer);</div>
<div class="line"><span class="lineno"> 214</span> (*memory_count)--;</div>
<div class="line"><span class="lineno"> 215</span> </div>
<div class="line"><span class="lineno"> 216</span> <a class="code hl_function" href="../../dd/d92/memory__game_8cpp.html#a5714d97649c0edd57b4fb449799676a3">ask_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 216</span> <a class="code hl_function" href="#a5714d97649c0edd57b4fb449799676a3">ask_data</a>(table, answer, old_answer, memory_count);</div>
<div class="line"><span class="lineno"> 217</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -900,8 +855,7 @@ template&lt;typename T &gt; </div>
<tr>
<td class="memname">constexpr T SLEEP </td>
<td>(</td>
<td class="paramtype">T&#160;</td>
<td class="paramname"><em>seconds</em></td><td>)</td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>seconds</em></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -926,7 +880,7 @@ template&lt;typename T &gt; </div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_4b6f782e158b0b98da980a0e11a23a15.html">games</a></li><li class="navelem"><a class="el" href="../../dd/d92/memory__game_8cpp.html">memory_game.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
</ul>
</div>
</body>