diff options
Diffstat (limited to 'blog/c')
-rw-r--r-- | blog/c/cherry.html | 171 | ||||
-rw-r--r-- | blog/c/game.html | 346 |
2 files changed, 0 insertions, 517 deletions
diff --git a/blog/c/cherry.html b/blog/c/cherry.html deleted file mode 100644 index e2d9221..0000000 --- a/blog/c/cherry.html +++ /dev/null @@ -1,171 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<!-- 2024-03-17 Sun 21:46 --> -<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Reviving Caesar with a Cherry-flavored Crystal</title> -<meta name="author" content="Crystal & Sloth" /> -<meta name="generator" content="Org Mode" /> -<link rel="stylesheet" type="text/css" href="../../src/css/colors.css"/> -<link rel="stylesheet" type="text/css" href="../../src/css/style.css"/> -<link rel="icon" type="image/x-icon" href="../../../favicon.png"> -</head> -<body> -<div id="org-div-home-and-up"> - <a accesskey="h" href=""> UP </a> - | - <a accesskey="H" href="https://crystal.tilde.institute/"> HOME </a> -</div><div id="content" class="content"> -<h1 class="title">Reviving Caesar with a Cherry-flavored Crystal</h1> -<div id="outline-container-org0bff230" class="outline-2"> -<h2 id="org0bff230">What ?…</h2> -<div class="outline-text-2" id="text-org0bff230"> -<p> -That is probably your reaction reading this title, and no, this isn’t a randomly generated sentence, but rather a simple encryption algorithm I recently made (Actually the first encryption algorithm i make at all!!). Meet <b>Cherry-Crystal Encryption</b>. -</p> -</div> -</div> -<div id="outline-container-org4770304" class="outline-2"> -<h2 id="org4770304">Okay so, what is this all about ?</h2> -<div class="outline-text-2" id="text-org4770304"> -<p> -This encryption Algorithm that we will call <b>CCE</b> for short, takes inspiration from the Caesar cipher which needn’t an introduction (you can find great explanations online). But what about mine you might ask ? -</p> - - -<ul class="org-ul"> -<li>It’s actually pretty simple. We start with a <b>Cherry</b> or a <b>Visible phrase</b>, or a <b>Decoy</b>, that we will share to people who we don’t want to know the secret phrase..</li> -<li>Then we ask the user to enter their <b>Crystal</b>, <b>invisible phrase</b> or <b>secret</b>.</li> -<li>The program then outputs an array of Integers called the <b>Mask</b>, or the <b>Shift</b>. That is, the shift required to go from cherry<sub>i</sub> to crystal<sub>i</sub>.</li> -<li>Finally, we use both the <b>Cherry</b> and <b>Mask</b> to get the <b>Crystal</b>, a single missing number or letter from both of them can and will output rubbish content.</li> -</ul> -</div> -</div> -<div id="outline-container-org4496ca5" class="outline-2"> -<h2 id="org4496ca5">The Code :</h2> -<div class="outline-text-2" id="text-org4496ca5"> -<div class="org-src-container"> -<pre class="src src-c"><span style="color: #f9e2af;">#include</span> <span style="color: #f38ba8;"><</span><span style="color: #a6e3a1;">stdio.h</span><span style="color: #f38ba8;">></span> -<span style="color: #f9e2af;">#include</span> <span style="color: #f38ba8;"><</span><span style="color: #a6e3a1;">stdlib.h</span><span style="color: #f38ba8;">></span> -<span style="color: #f9e2af;">#include</span> <span style="color: #f38ba8;"><</span><span style="color: #a6e3a1;">string.h</span><span style="color: #f38ba8;">></span> - -<span style="color: #f9e2af;">void</span> <span style="color: #89b4fa;">sloth</span><span style="color: #f38ba8;">(</span><span style="color: #f9e2af;">char</span> <span style="color: #cdd6f4;">cherry</span><span style="color: #fab387;">[]</span>, <span style="color: #f9e2af;">char</span> <span style="color: #cdd6f4;">crystal</span><span style="color: #fab387;">[]</span>, <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">mask</span><span style="color: #fab387;">[]</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> - <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">i</span>; - <span style="color: #cba6f7;">for</span> <span style="color: #fab387;">(</span>i = <span style="color: #fab387;">0</span>; i < strlen<span style="color: #f9e2af;">(</span>cherry<span style="color: #f9e2af;">)</span> - <span style="color: #fab387;">1</span>; i++<span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> - mask<span style="color: #f9e2af;">[</span>i<span style="color: #f9e2af;">]</span> = cherry<span style="color: #f9e2af;">[</span>i<span style="color: #f9e2af;">]</span> - crystal<span style="color: #f9e2af;">[</span>i<span style="color: #f9e2af;">]</span>; - <span style="color: #fab387;">}</span> - <span style="color: #cba6f7;">for</span> <span style="color: #fab387;">(</span>i = strlen<span style="color: #f9e2af;">(</span>cherry<span style="color: #f9e2af;">)</span> - <span style="color: #fab387;">1</span>; i < strlen<span style="color: #f9e2af;">(</span>crystal<span style="color: #f9e2af;">)</span> - <span style="color: #fab387;">1</span>; i++<span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> - mask<span style="color: #f9e2af;">[</span>i<span style="color: #f9e2af;">]</span> = crystal<span style="color: #f9e2af;">[</span>i<span style="color: #f9e2af;">]</span>; - <span style="color: #fab387;">}</span> -<span style="color: #f38ba8;">}</span> -<span style="color: #f9e2af;">void</span> <span style="color: #89b4fa;">moon</span><span style="color: #f38ba8;">(</span><span style="color: #f9e2af;">char</span> <span style="color: #cdd6f4;">cherry</span><span style="color: #fab387;">[]</span>, <span style="color: #f9e2af;">char</span> <span style="color: #cdd6f4;">crystal</span><span style="color: #fab387;">[]</span>, <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">mask</span><span style="color: #fab387;">[]</span>, <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">length</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> - <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">i</span>, <span style="color: #cdd6f4;">end</span> = <span style="color: #fab387;">1</span>; - <span style="color: #cba6f7;">for</span> <span style="color: #fab387;">(</span>i = <span style="color: #fab387;">0</span>; i < length; i++<span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> - <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>i == strlen<span style="color: #a6e3a1;">(</span>cherry<span style="color: #a6e3a1;">)</span> - <span style="color: #fab387;">1</span> || end == <span style="color: #fab387;">0</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> - crystal<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">]</span> = mask<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">]</span>; - end = <span style="color: #fab387;">0</span>; - <span style="color: #f9e2af;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #f9e2af;">{</span> - crystal<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">]</span> = cherry<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">]</span> - mask<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">]</span>; - <span style="color: #f9e2af;">}</span> - <span style="color: #fab387;">}</span> -<span style="color: #f38ba8;">}</span> -<span style="color: #f9e2af;">int</span> <span style="color: #89b4fa;">main</span><span style="color: #f38ba8;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">argc</span>, <span style="color: #f9e2af;">char</span> *<span style="color: #cdd6f4;">argv</span><span style="color: #fab387;">[]</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> - <span style="color: #cba6f7;">const</span> <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">size</span> = <span style="color: #fab387;">1028</span>; - <span style="color: #f9e2af;">char</span> <span style="color: #cdd6f4;">cherry</span><span style="color: #fab387;">[</span>size<span style="color: #fab387;">]</span>, <span style="color: #cdd6f4;">cherry2</span><span style="color: #fab387;">[</span>size<span style="color: #fab387;">]</span>, <span style="color: #cdd6f4;">crystal</span><span style="color: #fab387;">[</span>size<span style="color: #fab387;">]</span>, <span style="color: #cdd6f4;">crystal2</span><span style="color: #fab387;">[</span>size<span style="color: #fab387;">]</span>; - <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">mask</span><span style="color: #fab387;">[</span>size<span style="color: #fab387;">]</span>, <span style="color: #cdd6f4;">mask2</span><span style="color: #fab387;">[</span>size<span style="color: #fab387;">]</span>, <span style="color: #cdd6f4;">i</span>; - <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">length</span> = <span style="color: #fab387;">0</span>; - puts<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Enter the Cherry: "</span><span style="color: #fab387;">)</span>; - fgets<span style="color: #fab387;">(</span>cherry, size, stdin<span style="color: #fab387;">)</span>; - puts<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Enter the Crystal: "</span><span style="color: #fab387;">)</span>; - fgets<span style="color: #fab387;">(</span>crystal, size, stdin<span style="color: #fab387;">)</span>; - sloth<span style="color: #fab387;">(</span>cherry, crystal, mask<span style="color: #fab387;">)</span>; - <span style="color: #cba6f7;">for</span> <span style="color: #fab387;">(</span>i = <span style="color: #fab387;">0</span>; i < strlen<span style="color: #f9e2af;">(</span>crystal<span style="color: #f9e2af;">)</span> - <span style="color: #fab387;">1</span>; i++<span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> - printf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">"%d "</span>, mask<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span>; - length++; - <span style="color: #fab387;">}</span> - printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"\nYour mask is : %d characters long"</span>, length<span style="color: #fab387;">)</span>; - puts<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"\n===Decryption: ===\n"</span><span style="color: #fab387;">)</span>; - puts<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Enter the Cherry: "</span><span style="color: #fab387;">)</span>; - fgets<span style="color: #fab387;">(</span>cherry2, size, stdin<span style="color: #fab387;">)</span>; - puts<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Enter the size of the Mask: "</span><span style="color: #fab387;">)</span>; - scanf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"%d"</span>, &length<span style="color: #fab387;">)</span>; - puts<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Enter the mask: "</span><span style="color: #fab387;">)</span>; - <span style="color: #cba6f7;">for</span> <span style="color: #fab387;">(</span>i = <span style="color: #fab387;">0</span>; i < length; i++<span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> - scanf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">"%d"</span>, &mask2<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span>; - <span style="color: #fab387;">}</span> - puts<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"The Crystal is: "</span><span style="color: #fab387;">)</span>; - moon<span style="color: #fab387;">(</span>cherry2, crystal2, mask2, length<span style="color: #fab387;">)</span>; - puts<span style="color: #fab387;">(</span>crystal2<span style="color: #fab387;">)</span>; - <span style="color: #cba6f7;">return</span> <span style="color: #fab387;">0</span>; -<span style="color: #f38ba8;">}</span> - -</pre> -</div> - -<p> -The program has been tested both on Alpine OS with Musl libc (thanks <a href="https://kaa.neocities.org/">Kin</a>) and on OpenBSD 7.5-current. In the close future I will make a git repo as i’m planning to upgrade it and just make it better overall, who knows, maybe i will make a library out of it!! -</p> -</div> -</div> -<div id="outline-container-org6c3305a" class="outline-2"> -<h2 id="org6c3305a">How does it work ?</h2> -<div class="outline-text-2" id="text-org6c3305a"> -</div> -<div id="outline-container-orgf462a7c" class="outline-3"> -<h3 id="orgf462a7c">Slothing (Encrypting) 🦥:</h3> -<div class="outline-text-3" id="text-orgf462a7c"> -<p> -<del>What is it with these names I pick ?</del> Anyways, the <b>sloth(char *cherry, char *crystal, int *mask)</b> void function takes as parameters three variables: -</p> - -<ul class="org-ul"> -<li>A pointer to a <b>char array</b> or simply said <b>a string</b>, It’s the <b>Cherry</b>.</li> -<li>Another pointer to the <b>Crystal</b>.</li> -<li>And Finally, a pointer to an array of integers <b>The Mask</b> which will be output-ed by the function.</li> -</ul> - - -<p> -The general idea of it is like this : (we will use a quick example) -</p> - -<ul class="org-ul"> -<li><b>Cherry</b>: H e l l o \0.</li> -<li><b>Crystal</b>: W o r l d \0.</li> -<li>Cherry[0] here is <b>H</b>, or in ASCII <b>72</b>. And Crystal[0] is <b>W</b> or <b>87</b>.</li> -<li>Mask[0] in this case is : Cherry[0] - Crystal[0]. which is <b>-15</b>. We then repeat the same steps for each letter on the <b>Crystal</b>.</li> -</ul> - -<p> -Why the emphasis on <b>Crystal</b> ? Because we might end up with a case of a Crystal larger than a Cherry. we set the offset to the ASCII value of <b>Crystal[i]</b>, okay which to be fair is not the safest option out there, but I’m planning on fixing it sooner or later. In the case of a large Cherry but a small Crystal…it works but now looking at the code, i have no idea why it works the intended way…. -</p> -</div> -</div> -<div id="outline-container-org7cb73ea" class="outline-3"> -<h3 id="org7cb73ea">Mooning (Decrypting) 🌕:</h3> -<div class="outline-text-3" id="text-org7cb73ea"> -<p> -The function <b>moon(char *cherry, char *crystal, int *mask, int length)</b> works the same way as the sloth function, but in reverse and a small change. -</p> - -<ul class="org-ul"> -<li><b>The for loop goes through all the elements of the Mask and reconstructing the Crystal using the reverse equation of the encryption</b>. But when it arrives at the end of the <b>Cherry</b> (here we enter the case of a Cherry smaller than a Crystal). Then we will just assume that <b>Mask[i]</b> is the ASCII code of <b>Crystal[i]</b>, and we continue this assumption until the end of the loop.</li> -</ul> - - -<p> -And voila that’s it. Of course there might be some things I will change, but the overall concept is here! -</p> -</div> -</div> -</div> -</div> -<div id="postamble" class="status"> -<p class="author">Author: Crystal & Sloth</p> -<p class="date">Created: 2024-03-17 Sun 21:46</p> -</div> -</body> -</html> diff --git a/blog/c/game.html b/blog/c/game.html deleted file mode 100644 index 90c1965..0000000 --- a/blog/c/game.html +++ /dev/null @@ -1,346 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<!-- 2024-02-22 Thu 19:09 --> -<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>The loneliness Game</title> -<meta name="author" content="Crystal" /> -<meta name="generator" content="Org Mode" /> -<link rel="stylesheet" type="text/css" href="../../src/css/colors.css"/> -<link rel="stylesheet" type="text/css" href="../../src/css/style.css"/> -<link rel="icon" type="image/x-icon" href="../../../favicon.png"> -</head> -<body> -<div id="org-div-home-and-up"> - <a accesskey="h" href=""> UP </a> - | - <a accesskey="H" href="https://crystal.tilde.institute/"> HOME </a> -</div><div id="content" class="content"> -<h1 class="title">The loneliness Game</h1> -<p> -Hello !!, I hope you are doing great you amazing person whoever you are, and I really appreciate you reading my little C programming adventure. Soo basically I wanted to blog about a little game I made when bored, and figured out it would be a great way to optimize it, and learn new stuff too by documenting the process! -</p> -<div id="outline-container-org26dcb46" class="outline-2"> -<h2 id="org26dcb46">The concept :</h2> -<div class="outline-text-2" id="text-org26dcb46"> -<p> -Basically the player is faced with a NxM field made up with the sign <b>“-”</b> and the player is denoted by the symbol <b>“+”</b>, there are also Bonuses <b>“B”</b> which add 1 to your score, Traps <b>“T”</b>, that remove one from your score, and Dead <b>“D”</b> which resets the score to 0. I will go into more of the specifics later but for now this is how it works, and the controls are Basic WASD bindings, though i may go for a HJKL style later. -</p> -</div> -</div> -<div id="outline-container-org37eeebf" class="outline-2"> -<h2 id="org37eeebf">The code :</h2> -<div class="outline-text-2" id="text-org37eeebf"> -<div class="org-src-container"> -<pre class="src src-c"><span class="linenr"> 1: </span><span style="color: #f9e2af;">#include</span> <span style="color: #f38ba8;"><</span><span style="color: #a6e3a1;">stdio.h</span><span style="color: #f38ba8;">></span> -<span class="linenr"> 2: </span><span style="color: #f9e2af;">#include</span> <span style="color: #f38ba8;"><</span><span style="color: #a6e3a1;">stdlib.h</span><span style="color: #f38ba8;">></span> -<span class="linenr"> 3: </span><span style="color: #f9e2af;">int</span> <span style="color: #89b4fa;">main</span><span style="color: #f38ba8;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">argc</span>, <span style="color: #f9e2af;">char</span> *<span style="color: #cdd6f4;">argv</span><span style="color: #fab387;">[]</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr"> 4: </span> <span style="color: #f9e2af;">char</span> <span style="color: #cdd6f4;">input</span>,<span style="color: #cdd6f4;">map</span><span style="color: #fab387;">[</span><span style="color: #fab387;">5</span><span style="color: #fab387;">][</span><span style="color: #fab387;">5</span><span style="color: #fab387;">]</span> = <span style="color: #fab387;">{</span> -<span class="linenr"> 5: </span> <span style="color: #f9e2af;">{</span><span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span><span style="color: #f9e2af;">}</span>, -<span class="linenr"> 6: </span> <span style="color: #f9e2af;">{</span><span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span><span style="color: #f9e2af;">}</span>, -<span class="linenr"> 7: </span> <span style="color: #f9e2af;">{</span><span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span><span style="color: #f9e2af;">}</span>, -<span class="linenr"> 8: </span> <span style="color: #f9e2af;">{</span><span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span><span style="color: #f9e2af;">}</span>, -<span class="linenr"> 9: </span> <span style="color: #f9e2af;">{</span><span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span>, <span style="color: #a6e3a1;">'-'</span><span style="color: #f9e2af;">}</span> -<span class="linenr"> 10: </span> <span style="color: #fab387;">}</span>; -<span class="linenr"> 11: </span> <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">stop</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">i</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">moves</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">score</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">pos</span><span style="color: #fab387;">[</span><span style="color: #fab387;">2</span><span style="color: #fab387;">]</span> = <span style="color: #fab387;">{</span><span style="color: #fab387;">2</span>, <span style="color: #fab387;">2</span><span style="color: #fab387;">}</span>; -<span class="linenr"> 12: </span> <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">bonus</span><span style="color: #fab387;">[</span><span style="color: #fab387;">2</span><span style="color: #fab387;">]</span>; -<span class="linenr"> 13: </span> <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">trap</span><span style="color: #fab387;">[</span><span style="color: #fab387;">2</span><span style="color: #fab387;">]</span> ; -<span class="linenr"> 14: </span> <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">death</span><span style="color: #fab387;">[</span><span style="color: #fab387;">2</span><span style="color: #fab387;">]</span>; -<span class="linenr"> 15: </span> map<span style="color: #fab387;">[</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'+'</span>; -<span class="linenr"> 16: </span> <span style="color: #cba6f7;">do</span><span style="color: #fab387;">{</span> -<span class="linenr"> 17: </span> bonus<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span> = arc4random_uniform<span style="color: #f9e2af;">(</span><span style="color: #fab387;">5</span><span style="color: #f9e2af;">)</span>; bonus<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span> = arc4random_uniform<span style="color: #f9e2af;">(</span><span style="color: #fab387;">5</span><span style="color: #f9e2af;">)</span>; -<span class="linenr"> 18: </span> trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span> = arc4random_uniform<span style="color: #f9e2af;">(</span><span style="color: #fab387;">5</span><span style="color: #f9e2af;">)</span>; trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span> = arc4random_uniform<span style="color: #f9e2af;">(</span><span style="color: #fab387;">5</span><span style="color: #f9e2af;">)</span>; -<span class="linenr"> 19: </span> death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span> = arc4random_uniform<span style="color: #f9e2af;">(</span><span style="color: #fab387;">5</span><span style="color: #f9e2af;">)</span>; death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span> = arc4random_uniform<span style="color: #f9e2af;">(</span><span style="color: #fab387;">5</span><span style="color: #f9e2af;">)</span>; -<span class="linenr"> 20: </span> <span style="color: #fab387;">}</span><span style="color: #cba6f7;">while</span><span style="color: #fab387;">(</span><span style="color: #f9e2af;">(</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span><span style="color: #fab387;">)</span>; -<span class="linenr"> 21: </span> map<span style="color: #fab387;">[</span>bonus<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>bonus<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'B'</span>; -<span class="linenr"> 22: </span> map<span style="color: #fab387;">[</span>trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'T'</span>; -<span class="linenr"> 23: </span> map<span style="color: #fab387;">[</span>death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'D'</span>; -<span class="linenr"> 24: </span> <span style="color: #cba6f7;">do</span><span style="color: #fab387;">{</span> -<span class="linenr"> 25: </span> printf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">"Map:\n"</span><span style="color: #f9e2af;">)</span>; -<span class="linenr"> 26: </span> <span style="color: #cba6f7;">for</span> <span style="color: #f9e2af;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">i</span> = <span style="color: #fab387;">0</span>; i < <span style="color: #fab387;">5</span>; i++<span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 27: </span> <span style="color: #cba6f7;">for</span> <span style="color: #a6e3a1;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">j</span> = <span style="color: #fab387;">0</span>; j < <span style="color: #fab387;">5</span>; j++<span style="color: #a6e3a1;">)</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 28: </span> printf<span style="color: #f38ba8;">(</span><span style="color: #a6e3a1;">"%c "</span>, map<span style="color: #fab387;">[</span>i<span style="color: #fab387;">][</span>j<span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span>; -<span class="linenr"> 29: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 30: </span> printf<span style="color: #a6e3a1;">(</span><span style="color: #a6e3a1;">"\n"</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 31: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr"> 32: </span> printf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">"Score: %d\n"</span>, score<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 33: </span> printf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">"Moves: %d\n"</span>, moves<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 34: </span> printf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">"Enter a direction (w,a,s,d) or c to quit: "</span><span style="color: #f9e2af;">)</span>; -<span class="linenr"> 35: </span> scanf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">" %c"</span>, &input<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 36: </span><span style="color: #6c7086;">// </span><span style="color: #6c7086;">pos[0] updown pos[1] lr</span> -<span class="linenr"> 37: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>input == <span style="color: #a6e3a1;">'w'</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 38: </span> printf<span style="color: #a6e3a1;">(</span><span style="color: #a6e3a1;">"Moving up\n"</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 39: </span> map<span style="color: #a6e3a1;">[</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">][</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr"> 40: </span> <span style="color: #cba6f7;">if</span> <span style="color: #a6e3a1;">(</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span> == <span style="color: #fab387;">0</span><span style="color: #a6e3a1;">)</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 41: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span> = <span style="color: #fab387;">4</span>; -<span class="linenr"> 42: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 43: </span> <span style="color: #cba6f7;">else</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 44: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span>--; -<span class="linenr"> 45: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 46: </span> <span style="color: #f9e2af;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>input == <span style="color: #a6e3a1;">'a'</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 47: </span> printf<span style="color: #a6e3a1;">(</span><span style="color: #a6e3a1;">"Moving left\n"</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 48: </span> map<span style="color: #a6e3a1;">[</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">][</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr"> 49: </span> <span style="color: #cba6f7;">if</span> <span style="color: #a6e3a1;">(</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span> == <span style="color: #fab387;">0</span><span style="color: #a6e3a1;">)</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 50: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span> = <span style="color: #fab387;">4</span>; -<span class="linenr"> 51: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 52: </span> <span style="color: #cba6f7;">else</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 53: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span>--; -<span class="linenr"> 54: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 55: </span> <span style="color: #f9e2af;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>input == <span style="color: #a6e3a1;">'s'</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 56: </span> -<span class="linenr"> 57: </span> printf<span style="color: #a6e3a1;">(</span><span style="color: #a6e3a1;">"Moving down\n"</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 58: </span> map<span style="color: #a6e3a1;">[</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">][</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr"> 59: </span> <span style="color: #cba6f7;">if</span> <span style="color: #a6e3a1;">(</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span> == <span style="color: #fab387;">4</span><span style="color: #a6e3a1;">)</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 60: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span> = <span style="color: #fab387;">0</span>; -<span class="linenr"> 61: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 62: </span> <span style="color: #cba6f7;">else</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 63: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span>++; -<span class="linenr"> 64: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 65: </span> <span style="color: #f9e2af;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>input == <span style="color: #a6e3a1;">'d'</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 66: </span> printf<span style="color: #a6e3a1;">(</span><span style="color: #a6e3a1;">"Moving right\n"</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 67: </span> map<span style="color: #a6e3a1;">[</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">][</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr"> 68: </span> <span style="color: #cba6f7;">if</span> <span style="color: #a6e3a1;">(</span>pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span> == <span style="color: #fab387;">4</span><span style="color: #a6e3a1;">)</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 69: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span> = <span style="color: #fab387;">0</span>; -<span class="linenr"> 70: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 71: </span> <span style="color: #cba6f7;">else</span> <span style="color: #a6e3a1;">{</span> -<span class="linenr"> 72: </span> pos<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span>++; -<span class="linenr"> 73: </span> <span style="color: #a6e3a1;">}</span> -<span class="linenr"> 74: </span> <span style="color: #f9e2af;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>input == <span style="color: #a6e3a1;">'c'</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 75: </span> printf<span style="color: #a6e3a1;">(</span><span style="color: #a6e3a1;">"Quitting\n"</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 76: </span> <span style="color: #f9e2af;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 77: </span> printf<span style="color: #a6e3a1;">(</span><span style="color: #a6e3a1;">"Invalid input\n"</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 78: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr"> 79: </span> map<span style="color: #f9e2af;">[</span>pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">][</span>pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">]</span> = <span style="color: #a6e3a1;">'+'</span>; -<span class="linenr"> 80: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 81: </span> score++; -<span class="linenr"> 82: </span> <span style="color: #cba6f7;">do</span><span style="color: #a6e3a1;">{</span> -<span class="linenr"> 83: </span> bonus<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr"> 84: </span> bonus<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr"> 85: </span> <span style="color: #a6e3a1;">}</span><span style="color: #cba6f7;">while</span><span style="color: #a6e3a1;">(</span><span style="color: #f38ba8;">(</span>bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 86: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr"> 87: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 88: </span> score--; -<span class="linenr"> 89: </span> <span style="color: #cba6f7;">do</span><span style="color: #a6e3a1;">{</span> -<span class="linenr"> 90: </span> trap<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr"> 91: </span> trap<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr"> 92: </span> <span style="color: #a6e3a1;">}</span><span style="color: #cba6f7;">while</span><span style="color: #a6e3a1;">(</span><span style="color: #f38ba8;">(</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr"> 93: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr"> 94: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr"> 95: </span> score = <span style="color: #fab387;">0</span>; -<span class="linenr"> 96: </span> <span style="color: #cba6f7;">do</span><span style="color: #a6e3a1;">{</span> -<span class="linenr"> 97: </span> death<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr"> 98: </span> death<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr"> 99: </span> <span style="color: #a6e3a1;">}</span><span style="color: #cba6f7;">while</span><span style="color: #a6e3a1;">(</span><span style="color: #f38ba8;">(</span>death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr">100: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr">101: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>score % <span style="color: #fab387;">3</span> == <span style="color: #fab387;">0</span> && score != <span style="color: #fab387;">0</span> && stop == <span style="color: #fab387;">0</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr">102: </span> map<span style="color: #a6e3a1;">[</span>death<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">][</span>death<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span><span style="color: #a6e3a1;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">103: </span> <span style="color: #cba6f7;">do</span><span style="color: #a6e3a1;">{</span> -<span class="linenr">104: </span> death<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr">105: </span> death<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr">106: </span> <span style="color: #a6e3a1;">}</span><span style="color: #cba6f7;">while</span><span style="color: #a6e3a1;">(</span><span style="color: #f38ba8;">(</span>death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr">107: </span> stop = <span style="color: #fab387;">1</span>; -<span class="linenr">108: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr">109: </span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>score % <span style="color: #fab387;">3</span> != <span style="color: #fab387;">0</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr">110: </span> stop = <span style="color: #fab387;">0</span>; -<span class="linenr">111: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr">112: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f9e2af;">(</span>moves % <span style="color: #fab387;">5</span> == <span style="color: #fab387;">0</span> && moves != <span style="color: #fab387;">0</span><span style="color: #f9e2af;">)</span> <span style="color: #f9e2af;">{</span> -<span class="linenr">113: </span> <span style="color: #cba6f7;">do</span><span style="color: #a6e3a1;">{</span> -<span class="linenr">114: </span> map<span style="color: #f38ba8;">[</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">][</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">115: </span> trap<span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr">116: </span> trap<span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span>= arc4random_uniform<span style="color: #f38ba8;">(</span><span style="color: #fab387;">5</span><span style="color: #f38ba8;">)</span>; -<span class="linenr">117: </span> <span style="color: #a6e3a1;">}</span><span style="color: #cba6f7;">while</span><span style="color: #a6e3a1;">(</span><span style="color: #f38ba8;">(</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> || <span style="color: #f38ba8;">(</span>trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span><span style="color: #a6e3a1;">)</span>; -<span class="linenr">118: </span> -<span class="linenr">119: </span> <span style="color: #f9e2af;">}</span> -<span class="linenr">120: </span> map<span style="color: #f9e2af;">[</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">][</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">]</span> = <span style="color: #a6e3a1;">'B'</span>; -<span class="linenr">121: </span> map<span style="color: #f9e2af;">[</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">][</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">]</span> = <span style="color: #a6e3a1;">'T'</span>; -<span class="linenr">122: </span> map<span style="color: #f9e2af;">[</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">][</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">]</span> = <span style="color: #a6e3a1;">'D'</span>; -<span class="linenr">123: </span> moves++; -<span class="linenr">124: </span> <span style="color: #fab387;">}</span><span style="color: #cba6f7;">while</span><span style="color: #fab387;">(</span>input != <span style="color: #a6e3a1;">'c'</span><span style="color: #fab387;">)</span>; -<span class="linenr">125: </span> <span style="color: #cba6f7;">return</span> <span style="color: #fab387;">0</span>; -<span class="linenr">126: </span><span style="color: #f38ba8;">}</span> -<span class="linenr">127: </span> -</pre> -</div> - - -<p> -Let’s go step by step and see what we can fix or improve, to start off, line 4 to 10 can be reduced to 7 or 8 lines (which will be beneficial later too) -</p> -<div class="org-src-container"> -<pre class="src src-c"><span class="linenr"> 4: </span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">n</span>=<span style="color: #fab387;">5</span>,<span style="color: #cdd6f4;">m</span>=<span style="color: #fab387;">5</span>; -<span class="linenr"> 5: </span><span style="color: #f9e2af;">char</span> <span style="color: #cdd6f4;">input</span>,<span style="color: #cdd6f4;">map</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">50</span><span style="color: #f38ba8;">][</span><span style="color: #fab387;">50</span><span style="color: #f38ba8;">]</span>; -<span class="linenr"> 6: </span> <span style="color: #cba6f7;">for</span> <span style="color: #f38ba8;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">i</span> = <span style="color: #fab387;">0</span>; i < n; i++<span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr"> 7: </span> <span style="color: #cba6f7;">for</span> <span style="color: #fab387;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">j</span> = <span style="color: #fab387;">0</span>; j < m; j++<span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> -<span class="linenr"> 8: </span> map<span style="color: #f9e2af;">[</span>i<span style="color: #f9e2af;">][</span>j<span style="color: #f9e2af;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr"> 9: </span> <span style="color: #fab387;">}</span> -<span class="linenr">10: </span> <span style="color: #f38ba8;">}</span> -<span class="linenr">11: </span> -</pre> -</div> - -<p> -For now at least, n and m are hardcoded to 5, but this will change later. And I picked 50x50 as a max size because why not -</p> - -<p> -Of course we have the usual inits on line 11, though since we are using variables instead of hardcoding 5, we will have to find the center by ourselves -</p> -<div class="org-src-container"> -<pre class="src src-c"><span class="linenr">11: </span> <span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">stop</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">i</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">moves</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">score</span>=<span style="color: #fab387;">0</span>,<span style="color: #cdd6f4;">pos</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">2</span><span style="color: #f38ba8;">]</span> = <span style="color: #f38ba8;">{</span>n/<span style="color: #fab387;">2</span>,m/<span style="color: #fab387;">2</span><span style="color: #f38ba8;">}</span>; -</pre> -</div> - -<p> -This is getting better, of course we then initialize the coordinates of bonus, trap, and death, and set the player as a <b>’+’</b> in the field. -</p> - - -<p> -Here comes the line 17-21, where it generates a random coordinate for the aforementioned pickups, and do that until there is no conflict between eachother and the player) here we will need to change it a tiny bit. -</p> -<div class="org-src-container"> -<pre class="src src-c"><span class="linenr">17: </span> <span style="color: #f9e2af;">bonus</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span> = arc4random_uniform<span style="color: #f38ba8;">(</span>n<span style="color: #f38ba8;">)</span>; <span style="color: #f9e2af;">bonus</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span> = arc4random_uniform<span style="color: #f38ba8;">(</span>m<span style="color: #f38ba8;">)</span>; -<span class="linenr">18: </span> <span style="color: #f9e2af;">trap</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span> = arc4random_uniform<span style="color: #f38ba8;">(</span>n<span style="color: #f38ba8;">)</span>; <span style="color: #f9e2af;">trap</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span> = arc4random_uniform<span style="color: #f38ba8;">(</span>m<span style="color: #f38ba8;">)</span>; -<span class="linenr">19: </span> <span style="color: #f9e2af;">death</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">0</span><span style="color: #f38ba8;">]</span> = arc4random_uniform<span style="color: #f38ba8;">(</span>n<span style="color: #f38ba8;">)</span>; <span style="color: #f9e2af;">death</span><span style="color: #f38ba8;">[</span><span style="color: #fab387;">1</span><span style="color: #f38ba8;">]</span> = arc4random_uniform<span style="color: #f38ba8;">(</span>m<span style="color: #f38ba8;">)</span>; -</pre> -</div> - -<p> -Looking good so far!!, We then have line 21-23 which also shows the pickups as their respective symbols in the map. -</p> - - -<p> -The main interactive program starts here, which will learn at least one time and stop if the received input is a <b>’c’</b>, it starts with a nested for loop on line 26 up to 31 to show the content of the map, nothing fancy, just some matrix stuff. we need to change the 5 though! -</p> -<div class="org-src-container"> -<pre class="src src-c"><span class="linenr">26: </span> <span style="color: #cba6f7;">for</span> <span style="color: #f38ba8;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">i</span> = <span style="color: #fab387;">0</span>; i < n; i++<span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">27: </span> <span style="color: #cba6f7;">for</span> <span style="color: #fab387;">(</span><span style="color: #f9e2af;">int</span> <span style="color: #cdd6f4;">j</span> = <span style="color: #fab387;">0</span>; j < m; j++<span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> -<span class="linenr">28: </span> printf<span style="color: #f9e2af;">(</span><span style="color: #a6e3a1;">"%c "</span>, map<span style="color: #a6e3a1;">[</span>i<span style="color: #a6e3a1;">][</span>j<span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span>; -<span class="linenr">29: </span> <span style="color: #fab387;">}</span> -<span class="linenr">30: </span> printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"\n"</span><span style="color: #fab387;">)</span>; -<span class="linenr">31: </span> <span style="color: #f38ba8;">}</span> -<span class="linenr">32: </span> -</pre> -</div> -<p> -We show the score and the moves too, which at the start of the game are set to 0. and we prompt the user for a direction. Note here the space before the %c, this basically allows for the program to not choke on newlines and also even if the user writes multiple keys at the same time, they will still be done, like <b>ww</b> will make the player move twice up. -</p> - -<p> -After that we have some logic which should also be changed to account for the n and m changes yet again -</p> -<div class="org-src-container"> -<pre class="src src-c"><span class="linenr">37: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>input == <span style="color: #a6e3a1;">'w'</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">38: </span> printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Moving up\n"</span><span style="color: #fab387;">)</span>; -<span class="linenr">39: </span> map<span style="color: #fab387;">[</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">40: </span> <span style="color: #cba6f7;">if</span> <span style="color: #fab387;">(</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span> == <span style="color: #fab387;">0</span><span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> -<span class="linenr">41: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span> = n-<span style="color: #fab387;">1</span>; -<span class="linenr">42: </span> <span style="color: #fab387;">}</span> -<span class="linenr">43: </span> <span style="color: #cba6f7;">else</span> <span style="color: #fab387;">{</span> -<span class="linenr">44: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span>--; -<span class="linenr">45: </span> <span style="color: #fab387;">}</span> -<span class="linenr">46: </span> <span style="color: #f38ba8;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>input == <span style="color: #a6e3a1;">'a'</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">47: </span> printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Moving left\n"</span><span style="color: #fab387;">)</span>; -<span class="linenr">48: </span> map<span style="color: #fab387;">[</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">49: </span> <span style="color: #cba6f7;">if</span> <span style="color: #fab387;">(</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span> == <span style="color: #fab387;">0</span><span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> -<span class="linenr">50: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span> = m-<span style="color: #fab387;">1</span>; -<span class="linenr">51: </span> <span style="color: #fab387;">}</span> -<span class="linenr">52: </span> <span style="color: #cba6f7;">else</span> <span style="color: #fab387;">{</span> -<span class="linenr">53: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span>--; -<span class="linenr">54: </span> <span style="color: #fab387;">}</span> -<span class="linenr">55: </span> <span style="color: #f38ba8;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>input == <span style="color: #a6e3a1;">'s'</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">56: </span> -<span class="linenr">57: </span> printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Moving down\n"</span><span style="color: #fab387;">)</span>; -<span class="linenr">58: </span> map<span style="color: #fab387;">[</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">59: </span> <span style="color: #cba6f7;">if</span> <span style="color: #fab387;">(</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span> == n-<span style="color: #fab387;">1</span><span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> -<span class="linenr">60: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span> = <span style="color: #fab387;">0</span>; -<span class="linenr">61: </span> <span style="color: #fab387;">}</span> -<span class="linenr">62: </span> <span style="color: #cba6f7;">else</span> <span style="color: #fab387;">{</span> -<span class="linenr">63: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span>++; -<span class="linenr">64: </span> <span style="color: #fab387;">}</span> -<span class="linenr">65: </span> <span style="color: #f38ba8;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>input == <span style="color: #a6e3a1;">'d'</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">66: </span> printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Moving right\n"</span><span style="color: #fab387;">)</span>; -<span class="linenr">67: </span> map<span style="color: #fab387;">[</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">68: </span> <span style="color: #cba6f7;">if</span> <span style="color: #fab387;">(</span>pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span> == m-<span style="color: #fab387;">1</span><span style="color: #fab387;">)</span> <span style="color: #fab387;">{</span> -<span class="linenr">69: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span> = <span style="color: #fab387;">0</span>; -<span class="linenr">70: </span> <span style="color: #fab387;">}</span> -<span class="linenr">71: </span> <span style="color: #cba6f7;">else</span> <span style="color: #fab387;">{</span> -<span class="linenr">72: </span> pos<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span>++; -<span class="linenr">73: </span> <span style="color: #fab387;">}</span> -<span class="linenr">74: </span> <span style="color: #f38ba8;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>input == <span style="color: #a6e3a1;">'c'</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">75: </span> printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Quitting\n"</span><span style="color: #fab387;">)</span>; -<span class="linenr">76: </span> <span style="color: #f38ba8;">}</span> <span style="color: #cba6f7;">else</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">77: </span> printf<span style="color: #fab387;">(</span><span style="color: #a6e3a1;">"Invalid input\n"</span><span style="color: #fab387;">)</span>; -<span class="linenr">78: </span> <span style="color: #f38ba8;">}</span> -</pre> -</div> - -<p> -What this achieves is the “teleportation effect” whenever you are at the border of the screen! -</p> - - -<p> -Now we fix things from line 80 to the end of the program, aka replacing ever occurrence of 5 with n or m -</p> -<div class="org-src-container"> -<pre class="src src-c"><span class="linenr"> 80: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == bonus<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr"> 81: </span> score++; -<span class="linenr"> 82: </span> <span style="color: #cba6f7;">do</span><span style="color: #fab387;">{</span> -<span class="linenr"> 83: </span> bonus<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>n<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 84: </span> bonus<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>m<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 85: </span> <span style="color: #fab387;">}</span><span style="color: #cba6f7;">while</span><span style="color: #fab387;">(</span><span style="color: #f9e2af;">(</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span><span style="color: #fab387;">)</span>; -<span class="linenr"> 86: </span> <span style="color: #f38ba8;">}</span> -<span class="linenr"> 87: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == trap<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr"> 88: </span> score--; -<span class="linenr"> 89: </span> <span style="color: #cba6f7;">do</span><span style="color: #fab387;">{</span> -<span class="linenr"> 90: </span> trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>n<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 91: </span> trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>m<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 92: </span> <span style="color: #fab387;">}</span><span style="color: #cba6f7;">while</span><span style="color: #fab387;">(</span><span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span><span style="color: #fab387;">)</span>; -<span class="linenr"> 93: </span> <span style="color: #f38ba8;">}</span> -<span class="linenr"> 94: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>pos<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">0</span><span style="color: #fab387;">]</span> && pos<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span> == death<span style="color: #fab387;">[</span><span style="color: #fab387;">1</span><span style="color: #fab387;">]</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr"> 95: </span> score = <span style="color: #fab387;">0</span>; -<span class="linenr"> 96: </span> <span style="color: #cba6f7;">do</span><span style="color: #fab387;">{</span> -<span class="linenr"> 97: </span> death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>n<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 98: </span> death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>m<span style="color: #f9e2af;">)</span>; -<span class="linenr"> 99: </span> <span style="color: #fab387;">}</span><span style="color: #cba6f7;">while</span><span style="color: #fab387;">(</span><span style="color: #f9e2af;">(</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span><span style="color: #fab387;">)</span>; -<span class="linenr">100: </span> <span style="color: #f38ba8;">}</span> -<span class="linenr">101: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>score % <span style="color: #fab387;">3</span> == <span style="color: #fab387;">0</span> && score != <span style="color: #fab387;">0</span> && stop == <span style="color: #fab387;">0</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">102: </span> map<span style="color: #fab387;">[</span>death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">][</span>death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span><span style="color: #fab387;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">103: </span> <span style="color: #cba6f7;">do</span><span style="color: #fab387;">{</span> -<span class="linenr">104: </span> death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>n<span style="color: #f9e2af;">)</span>; -<span class="linenr">105: </span> death<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>m<span style="color: #f9e2af;">)</span>; -<span class="linenr">106: </span> <span style="color: #fab387;">}</span><span style="color: #cba6f7;">while</span><span style="color: #fab387;">(</span><span style="color: #f9e2af;">(</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span><span style="color: #fab387;">)</span>; -<span class="linenr">107: </span> stop = <span style="color: #fab387;">1</span>; -<span class="linenr">108: </span> <span style="color: #f38ba8;">}</span> -<span class="linenr">109: </span> <span style="color: #cba6f7;">else</span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>score % <span style="color: #fab387;">3</span> != <span style="color: #fab387;">0</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">110: </span> stop = <span style="color: #fab387;">0</span>; -<span class="linenr">111: </span> <span style="color: #f38ba8;">}</span> -<span class="linenr">112: </span> <span style="color: #cba6f7;">if</span> <span style="color: #f38ba8;">(</span>moves % <span style="color: #fab387;">5</span> == <span style="color: #fab387;">0</span> && moves != <span style="color: #fab387;">0</span><span style="color: #f38ba8;">)</span> <span style="color: #f38ba8;">{</span> -<span class="linenr">113: </span> <span style="color: #cba6f7;">do</span><span style="color: #fab387;">{</span> -<span class="linenr">114: </span> map<span style="color: #f9e2af;">[</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">][</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">]</span> = <span style="color: #a6e3a1;">'-'</span>; -<span class="linenr">115: </span> trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">0</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>n<span style="color: #f9e2af;">)</span>; -<span class="linenr">116: </span> trap<span style="color: #f9e2af;">[</span><span style="color: #fab387;">1</span><span style="color: #f9e2af;">]</span>= arc4random_uniform<span style="color: #f9e2af;">(</span>m<span style="color: #f9e2af;">)</span>; -<span class="linenr">117: </span> <span style="color: #fab387;">}</span><span style="color: #cba6f7;">while</span><span style="color: #fab387;">(</span><span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == bonus<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == death<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span> || <span style="color: #f9e2af;">(</span>trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">0</span><span style="color: #a6e3a1;">]</span> && trap<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span> == pos<span style="color: #a6e3a1;">[</span><span style="color: #fab387;">1</span><span style="color: #a6e3a1;">]</span><span style="color: #f9e2af;">)</span><span style="color: #fab387;">)</span>; -<span class="linenr">118: </span> -<span class="linenr">119: </span> <span style="color: #f38ba8;">}</span> -</pre> -</div> - - -<p> -Aaaaand this should be it -</p> -</div> -</div> -</div> -<div id="postamble" class="status"> -<p class="author">Author: Crystal</p> -<p class="date">Created: 2024-02-22 Thu 19:09</p> -</div> -</body> -</html> |