Spaces:
Running
Running
aepstar
commited on
Commit
·
4de660c
1
Parent(s):
7993167
update
Browse files- countsheep.html +44 -1
- evenodd.html +36 -20
- index.html +13 -1
- multiply.html +31 -12
- reducegrow.html +35 -16
- references.html +15 -3
countsheep.html
CHANGED
@@ -75,6 +75,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
75 |
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
|
|
78 |
<script id="quarto-search-options" type="application/json">{
|
79 |
"location": "sidebar",
|
80 |
"copy-button": false,
|
@@ -162,6 +163,18 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
162 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
163 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
164 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
</li>
|
166 |
<li class="sidebar-item">
|
167 |
<div class="sidebar-item-container">
|
@@ -207,7 +220,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
207 |
|
208 |
</header>
|
209 |
|
|
|
210 |
<p><a href="https://www.codewars.com/kata/5b077ebdaf15be5c7f000077/train/r" class="uri">https://www.codewars.com/kata/5b077ebdaf15be5c7f000077/train/r</a></p>
|
|
|
211 |
<section id="instruction" class="level2" data-number="3.1">
|
212 |
<h2 data-number="3.1" class="anchored" data-anchor-id="instruction"><span class="header-section-number">3.1</span> Instruction</h2>
|
213 |
<p>Given a non-negative integer, 3 for example, return a string with a murmur: “1 sheep…2 sheep…3 sheep…”. Input will always be valid, i.e. no negative integers.</p>
|
@@ -219,12 +234,40 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
219 |
<section id="solution-code" class="level2" data-number="3.3">
|
220 |
<h2 data-number="3.3" class="anchored" data-anchor-id="solution-code"><span class="header-section-number">3.3</span> Solution Code</h2>
|
221 |
<p>Solusi bar-bar</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
<p>Solusi simple</p>
|
|
|
|
|
|
|
|
|
|
|
223 |
</section>
|
224 |
<section id="test" class="level2" data-number="3.4">
|
225 |
<h2 data-number="3.4" class="anchored" data-anchor-id="test"><span class="header-section-number">3.4</span> Test</h2>
|
226 |
<div class="cell">
|
227 |
-
<div class="sourceCode cell-code" id="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
</div>
|
229 |
</section>
|
230 |
<section id="supported-by" class="level2" data-number="3.5">
|
|
|
75 |
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
78 |
+
<link href="site_libs/quarto-contrib/badge/badge.css" rel="stylesheet">
|
79 |
<script id="quarto-search-options" type="application/json">{
|
80 |
"location": "sidebar",
|
81 |
"copy-button": false,
|
|
|
163 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
164 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
165 |
</div>
|
166 |
+
</li>
|
167 |
+
<li class="sidebar-item">
|
168 |
+
<div class="sidebar-item-container">
|
169 |
+
<a href="./make_negative.html" class="sidebar-item-text sidebar-link">
|
170 |
+
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Return Negative</span></span></a>
|
171 |
+
</div>
|
172 |
+
</li>
|
173 |
+
<li class="sidebar-item">
|
174 |
+
<div class="sidebar-item-container">
|
175 |
+
<a href="./positive_sum.html" class="sidebar-item-text sidebar-link">
|
176 |
+
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Sum of positive</span></span></a>
|
177 |
+
</div>
|
178 |
</li>
|
179 |
<li class="sidebar-item">
|
180 |
<div class="sidebar-item-container">
|
|
|
220 |
|
221 |
</header>
|
222 |
|
223 |
+
<p>Tantangan #3/366 - 17 Feb 2024</p>
|
224 |
<p><a href="https://www.codewars.com/kata/5b077ebdaf15be5c7f000077/train/r" class="uri">https://www.codewars.com/kata/5b077ebdaf15be5c7f000077/train/r</a></p>
|
225 |
+
<p><span class="badge rounded-pill quarto-badge " style="background-color: grey90;">8kyu</span> If you can’t sleep, just count sheep!!</p>
|
226 |
<section id="instruction" class="level2" data-number="3.1">
|
227 |
<h2 data-number="3.1" class="anchored" data-anchor-id="instruction"><span class="header-section-number">3.1</span> Instruction</h2>
|
228 |
<p>Given a non-negative integer, 3 for example, return a string with a murmur: “1 sheep…2 sheep…3 sheep…”. Input will always be valid, i.e. no negative integers.</p>
|
|
|
234 |
<section id="solution-code" class="level2" data-number="3.3">
|
235 |
<h2 data-number="3.3" class="anchored" data-anchor-id="solution-code"><span class="header-section-number">3.3</span> Solution Code</h2>
|
236 |
<p>Solusi bar-bar</p>
|
237 |
+
<div class="cell">
|
238 |
+
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>countSheep <span class="ot"><-</span> <span class="cf">function</span>(num){</span>
|
239 |
+
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span>(num <span class="sc">==</span> <span class="dv">0</span>){</span>
|
240 |
+
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(<span class="st">""</span>)</span>
|
241 |
+
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> } <span class="cf">else</span> {</span>
|
242 |
+
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> result <span class="ot"><-</span> <span class="st">""</span></span>
|
243 |
+
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span>(i <span class="cf">in</span> <span class="dv">1</span><span class="sc">:</span>num){</span>
|
244 |
+
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> result <span class="ot"><-</span> <span class="fu">paste</span>(result, i, <span class="st">" sheep..."</span>, <span class="at">sep =</span> <span class="st">""</span>)</span>
|
245 |
+
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> }</span>
|
246 |
+
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(result)</span>
|
247 |
+
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a> }</span>
|
248 |
+
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
249 |
+
</div>
|
250 |
<p>Solusi simple</p>
|
251 |
+
<div class="cell">
|
252 |
+
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>countSheep <span class="ot"><-</span> <span class="cf">function</span>(num){</span>
|
253 |
+
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">ifelse</span>(num <span class="sc">==</span> <span class="dv">0</span>, <span class="st">""</span>, <span class="fu">paste</span>(<span class="dv">1</span><span class="sc">:</span>num, <span class="st">"sheep..."</span>, <span class="at">collapse =</span> <span class="st">""</span>))</span>
|
254 |
+
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
255 |
+
</div>
|
256 |
</section>
|
257 |
<section id="test" class="level2" data-number="3.4">
|
258 |
<h2 data-number="3.4" class="anchored" data-anchor-id="test"><span class="header-section-number">3.4</span> Test</h2>
|
259 |
<div class="cell">
|
260 |
+
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(testthat)</span>
|
261 |
+
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
|
262 |
+
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">"Fixed tests"</span>, {</span>
|
263 |
+
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">countSheep</span>(<span class="dv">0</span>), <span class="st">""</span>)</span>
|
264 |
+
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">countSheep</span>(<span class="dv">1</span>), <span class="st">"1 sheep..."</span>)</span>
|
265 |
+
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">countSheep</span>(<span class="dv">2</span>), <span class="st">"1 sheep...2 sheep..."</span>)</span>
|
266 |
+
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">countSheep</span>(<span class="dv">3</span>), <span class="st">"1 sheep...2 sheep...3 sheep..."</span>)</span>
|
267 |
+
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
268 |
+
<div class="cell-output cell-output-stdout">
|
269 |
+
<pre><code>Test passed 🥳</code></pre>
|
270 |
+
</div>
|
271 |
</div>
|
272 |
</section>
|
273 |
<section id="supported-by" class="level2" data-number="3.5">
|
evenodd.html
CHANGED
@@ -163,6 +163,18 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
163 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
164 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
165 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
</li>
|
167 |
<li class="sidebar-item">
|
168 |
<div class="sidebar-item-container">
|
@@ -208,8 +220,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
208 |
|
209 |
</header>
|
210 |
|
|
|
211 |
<p><a href="https://www.codewars.com/kata/53da3dbb4a5168369a0000fe/train/r" class="uri">https://www.codewars.com/kata/53da3dbb4a5168369a0000fe/train/r</a></p>
|
212 |
-
<p><span class="badge rounded-pill quarto-badge " style="background-color:
|
213 |
<section id="instruction" class="level2" data-number="1.1">
|
214 |
<h2 data-number="1.1" class="anchored" data-anchor-id="instruction"><span class="header-section-number">1.1</span> Instruction</h2>
|
215 |
<p>Create a function that takes an integer as an argument and returns <code>"Even"</code> for even numbers or <code>"Odd"</code> for odd numbers.</p>
|
@@ -233,38 +246,41 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
233 |
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">ifelse</span>(n <span class="sc">%%</span> <span class="dv">2</span> <span class="sc">==</span> <span class="dv">1</span>, <span class="st">"Odd"</span>, <span class="st">"Even"</span>)</span>
|
234 |
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
235 |
</div>
|
|
|
|
|
|
|
236 |
</section>
|
237 |
<section id="test" class="level2" data-number="1.4">
|
238 |
<h2 data-number="1.4" class="anchored" data-anchor-id="test"><span class="header-section-number">1.4</span> Test</h2>
|
239 |
<div class="cell">
|
240 |
-
<div class="sourceCode cell-code" id="
|
241 |
-
<span id="
|
242 |
-
<span id="
|
243 |
-
<span id="
|
244 |
<div class="cell-output cell-output-stdout">
|
245 |
<pre><code>Test passed 🎉</code></pre>
|
246 |
</div>
|
247 |
-
<div class="sourceCode cell-code" id="
|
248 |
-
<span id="
|
249 |
-
<span id="
|
250 |
<div class="cell-output cell-output-stdout">
|
251 |
-
<pre><code>Test passed
|
252 |
</div>
|
253 |
-
<div class="sourceCode cell-code" id="
|
254 |
-
<span id="
|
255 |
-
<span id="
|
256 |
<div class="cell-output cell-output-stdout">
|
257 |
-
<pre><code>Test passed
|
258 |
</div>
|
259 |
-
<div class="sourceCode cell-code" id="
|
260 |
-
<span id="
|
261 |
-
<span id="
|
262 |
<div class="cell-output cell-output-stdout">
|
263 |
-
<pre><code>Test passed
|
264 |
</div>
|
265 |
-
<div class="sourceCode cell-code" id="
|
266 |
-
<span id="
|
267 |
-
<span id="
|
268 |
<div class="cell-output cell-output-stdout">
|
269 |
<pre><code>Test passed 🥇</code></pre>
|
270 |
</div>
|
|
|
163 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
164 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
165 |
</div>
|
166 |
+
</li>
|
167 |
+
<li class="sidebar-item">
|
168 |
+
<div class="sidebar-item-container">
|
169 |
+
<a href="./make_negative.html" class="sidebar-item-text sidebar-link">
|
170 |
+
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Return Negative</span></span></a>
|
171 |
+
</div>
|
172 |
+
</li>
|
173 |
+
<li class="sidebar-item">
|
174 |
+
<div class="sidebar-item-container">
|
175 |
+
<a href="./positive_sum.html" class="sidebar-item-text sidebar-link">
|
176 |
+
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Sum of positive</span></span></a>
|
177 |
+
</div>
|
178 |
</li>
|
179 |
<li class="sidebar-item">
|
180 |
<div class="sidebar-item-container">
|
|
|
220 |
|
221 |
</header>
|
222 |
|
223 |
+
<p>Tantangan #1/366 - 15 Feb 2024</p>
|
224 |
<p><a href="https://www.codewars.com/kata/53da3dbb4a5168369a0000fe/train/r" class="uri">https://www.codewars.com/kata/53da3dbb4a5168369a0000fe/train/r</a></p>
|
225 |
+
<p><span class="badge rounded-pill quarto-badge " style="background-color: grey90;">8kyu</span> Even or Odd</p>
|
226 |
<section id="instruction" class="level2" data-number="1.1">
|
227 |
<h2 data-number="1.1" class="anchored" data-anchor-id="instruction"><span class="header-section-number">1.1</span> Instruction</h2>
|
228 |
<p>Create a function that takes an integer as an argument and returns <code>"Even"</code> for even numbers or <code>"Odd"</code> for odd numbers.</p>
|
|
|
246 |
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">ifelse</span>(n <span class="sc">%%</span> <span class="dv">2</span> <span class="sc">==</span> <span class="dv">1</span>, <span class="st">"Odd"</span>, <span class="st">"Even"</span>)</span>
|
247 |
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
248 |
</div>
|
249 |
+
<div class="cell">
|
250 |
+
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>even_or_odd <span class="ot"><-</span> <span class="cf">function</span>(n) <span class="fu">c</span>(<span class="st">"Even"</span>, <span class="st">"Odd"</span>)[n <span class="sc">%%</span> <span class="dv">2</span> <span class="sc">+</span> <span class="dv">1</span>]</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
251 |
+
</div>
|
252 |
</section>
|
253 |
<section id="test" class="level2" data-number="1.4">
|
254 |
<h2 data-number="1.4" class="anchored" data-anchor-id="test"><span class="header-section-number">1.4</span> Test</h2>
|
255 |
<div class="cell">
|
256 |
+
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(testthat)</span>
|
257 |
+
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">'even_or_odd(1) returns "Odd"'</span>, {</span>
|
258 |
+
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">even_or_odd</span>(<span class="dv">1</span>), <span class="st">"Odd"</span>)</span>
|
259 |
+
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
260 |
<div class="cell-output cell-output-stdout">
|
261 |
<pre><code>Test passed 🎉</code></pre>
|
262 |
</div>
|
263 |
+
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">'even_or_odd(2) returns "Even"'</span>, {</span>
|
264 |
+
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">even_or_odd</span>(<span class="dv">2</span>), <span class="st">"Even"</span>)</span>
|
265 |
+
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
266 |
<div class="cell-output cell-output-stdout">
|
267 |
+
<pre><code>Test passed 🥳</code></pre>
|
268 |
</div>
|
269 |
+
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">'even_or_odd(0) returns "Even"'</span>, {</span>
|
270 |
+
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">even_or_odd</span>(<span class="dv">0</span>), <span class="st">"Even"</span>)</span>
|
271 |
+
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
272 |
<div class="cell-output cell-output-stdout">
|
273 |
+
<pre><code>Test passed 🥇</code></pre>
|
274 |
</div>
|
275 |
+
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">'even_or_odd(-1) returns "Odd"'</span>, {</span>
|
276 |
+
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">even_or_odd</span>(<span class="sc">-</span><span class="dv">1</span>), <span class="st">"Odd"</span>)</span>
|
277 |
+
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
278 |
<div class="cell-output cell-output-stdout">
|
279 |
+
<pre><code>Test passed 😸</code></pre>
|
280 |
</div>
|
281 |
+
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">'even_or_odd(-2) returns "Even"'</span>, {</span>
|
282 |
+
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">even_or_odd</span>(<span class="sc">-</span><span class="dv">2</span>), <span class="st">"Even"</span>)</span>
|
283 |
+
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
284 |
<div class="cell-output cell-output-stdout">
|
285 |
<pre><code>Test passed 🥇</code></pre>
|
286 |
</div>
|
index.html
CHANGED
@@ -128,6 +128,18 @@ ul.task-list li input[type="checkbox"] {
|
|
128 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
129 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
130 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
</li>
|
132 |
<li class="sidebar-item">
|
133 |
<div class="sidebar-item-container">
|
@@ -174,7 +186,7 @@ ul.task-list li input[type="checkbox"] {
|
|
174 |
<div>
|
175 |
<div class="quarto-title-meta-heading">Published</div>
|
176 |
<div class="quarto-title-meta-contents">
|
177 |
-
<p class="date">Last Updated on
|
178 |
</div>
|
179 |
</div>
|
180 |
|
|
|
128 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
129 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
130 |
</div>
|
131 |
+
</li>
|
132 |
+
<li class="sidebar-item">
|
133 |
+
<div class="sidebar-item-container">
|
134 |
+
<a href="./make_negative.html" class="sidebar-item-text sidebar-link">
|
135 |
+
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Return Negative</span></span></a>
|
136 |
+
</div>
|
137 |
+
</li>
|
138 |
+
<li class="sidebar-item">
|
139 |
+
<div class="sidebar-item-container">
|
140 |
+
<a href="./positive_sum.html" class="sidebar-item-text sidebar-link">
|
141 |
+
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Sum of positive</span></span></a>
|
142 |
+
</div>
|
143 |
</li>
|
144 |
<li class="sidebar-item">
|
145 |
<div class="sidebar-item-container">
|
|
|
186 |
<div>
|
187 |
<div class="quarto-title-meta-heading">Published</div>
|
188 |
<div class="quarto-title-meta-contents">
|
189 |
+
<p class="date">Last Updated on 06 February, 2024</p>
|
190 |
</div>
|
191 |
</div>
|
192 |
|
multiply.html
CHANGED
@@ -75,6 +75,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
75 |
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
|
|
78 |
<script id="quarto-search-options" type="application/json">{
|
79 |
"location": "sidebar",
|
80 |
"copy-button": false,
|
@@ -162,6 +163,18 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
162 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
163 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
164 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
</li>
|
166 |
<li class="sidebar-item">
|
167 |
<div class="sidebar-item-container">
|
@@ -179,10 +192,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
179 |
<h2 id="toc-title">Table of contents</h2>
|
180 |
|
181 |
<ul>
|
182 |
-
<li><a href="#
|
183 |
-
<li><a href="#
|
184 |
-
<li><a href="#
|
185 |
-
<li><a href="#
|
|
|
186 |
</ul>
|
187 |
</nav>
|
188 |
</div>
|
@@ -206,25 +220,30 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
206 |
|
207 |
</header>
|
208 |
|
|
|
209 |
<p><a href="https://www.codewars.com/kata/50654ddff44f800200000004/train/r" class="uri">https://www.codewars.com/kata/50654ddff44f800200000004/train/r</a></p>
|
|
|
|
|
|
|
210 |
<p>This code does not execute properly. Try to figure out why.</p>
|
211 |
-
|
212 |
-
<
|
|
|
213 |
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/L8aczEhqymk?si=DSx84acpNvbkucrK" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
|
214 |
</section>
|
215 |
-
<section id="solution-code" class="level2" data-number="2.
|
216 |
-
<h2 data-number="2.
|
217 |
<p>Solusi bar-bar</p>
|
218 |
<p>Solusi simple</p>
|
219 |
</section>
|
220 |
-
<section id="test" class="level2" data-number="2.
|
221 |
-
<h2 data-number="2.
|
222 |
<div class="cell">
|
223 |
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(testthat)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
224 |
</div>
|
225 |
</section>
|
226 |
-
<section id="supported-by" class="level2" data-number="2.
|
227 |
-
<h2 data-number="2.
|
228 |
<div class="quarto-figure quarto-figure-center">
|
229 |
<figure class="figure">
|
230 |
<p><a href="https://www.starcore.co"><img src="new_starcore_logo.png" class="img-fluid figure-img"></a></p>
|
|
|
75 |
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
78 |
+
<link href="site_libs/quarto-contrib/badge/badge.css" rel="stylesheet">
|
79 |
<script id="quarto-search-options" type="application/json">{
|
80 |
"location": "sidebar",
|
81 |
"copy-button": false,
|
|
|
163 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
164 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
165 |
</div>
|
166 |
+
</li>
|
167 |
+
<li class="sidebar-item">
|
168 |
+
<div class="sidebar-item-container">
|
169 |
+
<a href="./make_negative.html" class="sidebar-item-text sidebar-link">
|
170 |
+
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Return Negative</span></span></a>
|
171 |
+
</div>
|
172 |
+
</li>
|
173 |
+
<li class="sidebar-item">
|
174 |
+
<div class="sidebar-item-container">
|
175 |
+
<a href="./positive_sum.html" class="sidebar-item-text sidebar-link">
|
176 |
+
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Sum of positive</span></span></a>
|
177 |
+
</div>
|
178 |
</li>
|
179 |
<li class="sidebar-item">
|
180 |
<div class="sidebar-item-container">
|
|
|
192 |
<h2 id="toc-title">Table of contents</h2>
|
193 |
|
194 |
<ul>
|
195 |
+
<li><a href="#instruction" id="toc-instruction" class="nav-link active" data-scroll-target="#instruction"><span class="header-section-number">2.1</span> Instruction</a></li>
|
196 |
+
<li><a href="#youtube-video" id="toc-youtube-video" class="nav-link" data-scroll-target="#youtube-video"><span class="header-section-number">2.2</span> YouTube Video</a></li>
|
197 |
+
<li><a href="#solution-code" id="toc-solution-code" class="nav-link" data-scroll-target="#solution-code"><span class="header-section-number">2.3</span> Solution Code</a></li>
|
198 |
+
<li><a href="#test" id="toc-test" class="nav-link" data-scroll-target="#test"><span class="header-section-number">2.4</span> Test</a></li>
|
199 |
+
<li><a href="#supported-by" id="toc-supported-by" class="nav-link" data-scroll-target="#supported-by"><span class="header-section-number">2.5</span> Supported by</a></li>
|
200 |
</ul>
|
201 |
</nav>
|
202 |
</div>
|
|
|
220 |
|
221 |
</header>
|
222 |
|
223 |
+
<p>Tantangan #2/366 - 16 Feb 2024</p>
|
224 |
<p><a href="https://www.codewars.com/kata/50654ddff44f800200000004/train/r" class="uri">https://www.codewars.com/kata/50654ddff44f800200000004/train/r</a></p>
|
225 |
+
<p><span class="badge rounded-pill quarto-badge " style="background-color: grey90;">8kyu</span> Multiply</p>
|
226 |
+
<section id="instruction" class="level2" data-number="2.1">
|
227 |
+
<h2 data-number="2.1" class="anchored" data-anchor-id="instruction"><span class="header-section-number">2.1</span> Instruction</h2>
|
228 |
<p>This code does not execute properly. Try to figure out why.</p>
|
229 |
+
</section>
|
230 |
+
<section id="youtube-video" class="level2" data-number="2.2">
|
231 |
+
<h2 data-number="2.2" class="anchored" data-anchor-id="youtube-video"><span class="header-section-number">2.2</span> YouTube Video</h2>
|
232 |
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/L8aczEhqymk?si=DSx84acpNvbkucrK" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
|
233 |
</section>
|
234 |
+
<section id="solution-code" class="level2" data-number="2.3">
|
235 |
+
<h2 data-number="2.3" class="anchored" data-anchor-id="solution-code"><span class="header-section-number">2.3</span> Solution Code</h2>
|
236 |
<p>Solusi bar-bar</p>
|
237 |
<p>Solusi simple</p>
|
238 |
</section>
|
239 |
+
<section id="test" class="level2" data-number="2.4">
|
240 |
+
<h2 data-number="2.4" class="anchored" data-anchor-id="test"><span class="header-section-number">2.4</span> Test</h2>
|
241 |
<div class="cell">
|
242 |
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(testthat)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
243 |
</div>
|
244 |
</section>
|
245 |
+
<section id="supported-by" class="level2" data-number="2.5">
|
246 |
+
<h2 data-number="2.5" class="anchored" data-anchor-id="supported-by"><span class="header-section-number">2.5</span> Supported by</h2>
|
247 |
<div class="quarto-figure quarto-figure-center">
|
248 |
<figure class="figure">
|
249 |
<p><a href="https://www.starcore.co"><img src="new_starcore_logo.png" class="img-fluid figure-img"></a></p>
|
reducegrow.html
CHANGED
@@ -64,7 +64,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
64 |
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
65 |
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
66 |
<meta name="quarto:offset" content="./">
|
67 |
-
<link href="./
|
68 |
<link href="./countsheep.html" rel="prev">
|
69 |
<script src="site_libs/quarto-html/quarto.js"></script>
|
70 |
<script src="site_libs/quarto-html/popper.min.js"></script>
|
@@ -75,6 +75,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
75 |
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
|
|
78 |
<script id="quarto-search-options" type="application/json">{
|
79 |
"location": "sidebar",
|
80 |
"copy-button": false,
|
@@ -162,6 +163,18 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
162 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link active">
|
163 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
164 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
</li>
|
166 |
<li class="sidebar-item">
|
167 |
<div class="sidebar-item-container">
|
@@ -179,10 +192,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
179 |
<h2 id="toc-title">Table of contents</h2>
|
180 |
|
181 |
<ul>
|
182 |
-
<li><a href="#
|
183 |
-
<li><a href="#
|
184 |
-
<li><a href="#
|
185 |
-
<li><a href="#
|
|
|
186 |
</ul>
|
187 |
</nav>
|
188 |
</div>
|
@@ -206,15 +220,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
206 |
|
207 |
</header>
|
208 |
|
|
|
209 |
<p><a href="https://www.codewars.com/kata/57f780909f7e8e3183000078/train/r" class="uri">https://www.codewars.com/kata/57f780909f7e8e3183000078/train/r</a></p>
|
|
|
|
|
|
|
210 |
<p>Given a non-empty array of integers, return the result of multiplying the values together in order. Example:</p>
|
211 |
<pre><code>[1, 2, 3, 4] => 1 * 2 * 3 * 4 = 24</code></pre>
|
212 |
-
|
213 |
-
<
|
|
|
214 |
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/xCvHwR52p4k?si=yoLfpHfcIBYk0j9c" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
|
215 |
</section>
|
216 |
-
<section id="solution-code" class="level2" data-number="4.
|
217 |
-
<h2 data-number="4.
|
218 |
<p>Solusi bar-bar</p>
|
219 |
<div class="cell">
|
220 |
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>grow <span class="ot"><-</span> <span class="cf">function</span>(arr) {</span>
|
@@ -231,8 +250,8 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
231 |
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>grow <span class="ot"><-</span> prod</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
232 |
</div>
|
233 |
</section>
|
234 |
-
<section id="test" class="level2" data-number="4.
|
235 |
-
<h2 data-number="4.
|
236 |
<div class="cell">
|
237 |
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(testthat)</span>
|
238 |
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">"basic tests"</span>, {</span>
|
@@ -241,12 +260,12 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
|
241 |
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">grow</span>(<span class="fu">c</span>(<span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>)), <span class="dv">64</span>)</span>
|
242 |
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
243 |
<div class="cell-output cell-output-stdout">
|
244 |
-
<pre><code>Test passed
|
245 |
</div>
|
246 |
</div>
|
247 |
</section>
|
248 |
-
<section id="supported-by" class="level2" data-number="4.
|
249 |
-
<h2 data-number="4.
|
250 |
<div class="quarto-figure quarto-figure-center">
|
251 |
<figure class="figure">
|
252 |
<p><a href="https://www.starcore.co"><img src="new_starcore_logo.png" class="img-fluid figure-img"></a></p>
|
@@ -498,8 +517,8 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|
498 |
</a>
|
499 |
</div>
|
500 |
<div class="nav-page nav-page-next">
|
501 |
-
<a href="./
|
502 |
-
<span class="nav-page-text">
|
503 |
</a>
|
504 |
</div>
|
505 |
</nav>
|
|
|
64 |
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
65 |
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
66 |
<meta name="quarto:offset" content="./">
|
67 |
+
<link href="./make_negative.html" rel="next">
|
68 |
<link href="./countsheep.html" rel="prev">
|
69 |
<script src="site_libs/quarto-html/quarto.js"></script>
|
70 |
<script src="site_libs/quarto-html/popper.min.js"></script>
|
|
|
75 |
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
78 |
+
<link href="site_libs/quarto-contrib/badge/badge.css" rel="stylesheet">
|
79 |
<script id="quarto-search-options" type="application/json">{
|
80 |
"location": "sidebar",
|
81 |
"copy-button": false,
|
|
|
163 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link active">
|
164 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
165 |
</div>
|
166 |
+
</li>
|
167 |
+
<li class="sidebar-item">
|
168 |
+
<div class="sidebar-item-container">
|
169 |
+
<a href="./make_negative.html" class="sidebar-item-text sidebar-link">
|
170 |
+
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Return Negative</span></span></a>
|
171 |
+
</div>
|
172 |
+
</li>
|
173 |
+
<li class="sidebar-item">
|
174 |
+
<div class="sidebar-item-container">
|
175 |
+
<a href="./positive_sum.html" class="sidebar-item-text sidebar-link">
|
176 |
+
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Sum of positive</span></span></a>
|
177 |
+
</div>
|
178 |
</li>
|
179 |
<li class="sidebar-item">
|
180 |
<div class="sidebar-item-container">
|
|
|
192 |
<h2 id="toc-title">Table of contents</h2>
|
193 |
|
194 |
<ul>
|
195 |
+
<li><a href="#instruction" id="toc-instruction" class="nav-link active" data-scroll-target="#instruction"><span class="header-section-number">4.1</span> Instruction</a></li>
|
196 |
+
<li><a href="#youtube-video" id="toc-youtube-video" class="nav-link" data-scroll-target="#youtube-video"><span class="header-section-number">4.2</span> YouTube Video</a></li>
|
197 |
+
<li><a href="#solution-code" id="toc-solution-code" class="nav-link" data-scroll-target="#solution-code"><span class="header-section-number">4.3</span> Solution Code</a></li>
|
198 |
+
<li><a href="#test" id="toc-test" class="nav-link" data-scroll-target="#test"><span class="header-section-number">4.4</span> Test</a></li>
|
199 |
+
<li><a href="#supported-by" id="toc-supported-by" class="nav-link" data-scroll-target="#supported-by"><span class="header-section-number">4.5</span> Supported by</a></li>
|
200 |
</ul>
|
201 |
</nav>
|
202 |
</div>
|
|
|
220 |
|
221 |
</header>
|
222 |
|
223 |
+
<p>Tantangan #4/366 - 15 Feb 2024</p>
|
224 |
<p><a href="https://www.codewars.com/kata/57f780909f7e8e3183000078/train/r" class="uri">https://www.codewars.com/kata/57f780909f7e8e3183000078/train/r</a></p>
|
225 |
+
<p><span class="badge rounded-pill quarto-badge " style="background-color: grey90;">8kyu</span> Beginner - Reduce but Grow</p>
|
226 |
+
<section id="instruction" class="level2" data-number="4.1">
|
227 |
+
<h2 data-number="4.1" class="anchored" data-anchor-id="instruction"><span class="header-section-number">4.1</span> Instruction</h2>
|
228 |
<p>Given a non-empty array of integers, return the result of multiplying the values together in order. Example:</p>
|
229 |
<pre><code>[1, 2, 3, 4] => 1 * 2 * 3 * 4 = 24</code></pre>
|
230 |
+
</section>
|
231 |
+
<section id="youtube-video" class="level2" data-number="4.2">
|
232 |
+
<h2 data-number="4.2" class="anchored" data-anchor-id="youtube-video"><span class="header-section-number">4.2</span> YouTube Video</h2>
|
233 |
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/xCvHwR52p4k?si=yoLfpHfcIBYk0j9c" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
|
234 |
</section>
|
235 |
+
<section id="solution-code" class="level2" data-number="4.3">
|
236 |
+
<h2 data-number="4.3" class="anchored" data-anchor-id="solution-code"><span class="header-section-number">4.3</span> Solution Code</h2>
|
237 |
<p>Solusi bar-bar</p>
|
238 |
<div class="cell">
|
239 |
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>grow <span class="ot"><-</span> <span class="cf">function</span>(arr) {</span>
|
|
|
250 |
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>grow <span class="ot"><-</span> prod</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
251 |
</div>
|
252 |
</section>
|
253 |
+
<section id="test" class="level2" data-number="4.4">
|
254 |
+
<h2 data-number="4.4" class="anchored" data-anchor-id="test"><span class="header-section-number">4.4</span> Test</h2>
|
255 |
<div class="cell">
|
256 |
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(testthat)</span>
|
257 |
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">"basic tests"</span>, {</span>
|
|
|
260 |
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">grow</span>(<span class="fu">c</span>(<span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>)), <span class="dv">64</span>)</span>
|
261 |
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
262 |
<div class="cell-output cell-output-stdout">
|
263 |
+
<pre><code>Test passed 🎉</code></pre>
|
264 |
</div>
|
265 |
</div>
|
266 |
</section>
|
267 |
+
<section id="supported-by" class="level2" data-number="4.5">
|
268 |
+
<h2 data-number="4.5" class="anchored" data-anchor-id="supported-by"><span class="header-section-number">4.5</span> Supported by</h2>
|
269 |
<div class="quarto-figure quarto-figure-center">
|
270 |
<figure class="figure">
|
271 |
<p><a href="https://www.starcore.co"><img src="new_starcore_logo.png" class="img-fluid figure-img"></a></p>
|
|
|
517 |
</a>
|
518 |
</div>
|
519 |
<div class="nav-page nav-page-next">
|
520 |
+
<a href="./make_negative.html" class="pagination-link">
|
521 |
+
<span class="nav-page-text"><span class="chapter-number">5</span> <span class="chapter-title">Return Negative</span></span> <i class="bi bi-arrow-right-short"></i>
|
522 |
</a>
|
523 |
</div>
|
524 |
</nav>
|
references.html
CHANGED
@@ -49,7 +49,7 @@ div.csl-indent {
|
|
49 |
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
50 |
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
51 |
<meta name="quarto:offset" content="./">
|
52 |
-
<link href="./
|
53 |
<script src="site_libs/quarto-html/quarto.js"></script>
|
54 |
<script src="site_libs/quarto-html/popper.min.js"></script>
|
55 |
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
@@ -146,6 +146,18 @@ div.csl-indent {
|
|
146 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
147 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
148 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
</li>
|
150 |
<li class="sidebar-item">
|
151 |
<div class="sidebar-item-container">
|
@@ -423,8 +435,8 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|
423 |
</script>
|
424 |
<nav class="page-navigation">
|
425 |
<div class="nav-page nav-page-previous">
|
426 |
-
<a href="./
|
427 |
-
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">
|
428 |
</a>
|
429 |
</div>
|
430 |
<div class="nav-page nav-page-next">
|
|
|
49 |
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
50 |
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
51 |
<meta name="quarto:offset" content="./">
|
52 |
+
<link href="./positive_sum.html" rel="prev">
|
53 |
<script src="site_libs/quarto-html/quarto.js"></script>
|
54 |
<script src="site_libs/quarto-html/popper.min.js"></script>
|
55 |
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
|
|
146 |
<a href="./reducegrow.html" class="sidebar-item-text sidebar-link">
|
147 |
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
148 |
</div>
|
149 |
+
</li>
|
150 |
+
<li class="sidebar-item">
|
151 |
+
<div class="sidebar-item-container">
|
152 |
+
<a href="./make_negative.html" class="sidebar-item-text sidebar-link">
|
153 |
+
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Return Negative</span></span></a>
|
154 |
+
</div>
|
155 |
+
</li>
|
156 |
+
<li class="sidebar-item">
|
157 |
+
<div class="sidebar-item-container">
|
158 |
+
<a href="./positive_sum.html" class="sidebar-item-text sidebar-link">
|
159 |
+
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Sum of positive</span></span></a>
|
160 |
+
</div>
|
161 |
</li>
|
162 |
<li class="sidebar-item">
|
163 |
<div class="sidebar-item-container">
|
|
|
435 |
</script>
|
436 |
<nav class="page-navigation">
|
437 |
<div class="nav-page nav-page-previous">
|
438 |
+
<a href="./positive_sum.html" class="pagination-link">
|
439 |
+
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">6</span> <span class="chapter-title">Sum of positive</span></span>
|
440 |
</a>
|
441 |
</div>
|
442 |
<div class="nav-page nav-page-next">
|