<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[codeguppy - Medium]]></title>
        <description><![CDATA[Want to Teach Coding? Start with codeguppy.com - Medium]]></description>
        <link>https://medium.com/codeguppy?source=rss----27f0e8d505b3---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>codeguppy - Medium</title>
            <link>https://medium.com/codeguppy?source=rss----27f0e8d505b3---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:48:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/codeguppy" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[JavaScript is like Python]]></title>
            <link>https://medium.com/codeguppy/javascript-is-like-python-4c8a40d84bac?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/4c8a40d84bac</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:43:58 GMT</pubDate>
            <atom:updated>2024-04-04T02:43:58.015Z</atom:updated>
            <content:encoded><![CDATA[<p>This article presents a comparison between the syntax and fundamental programming constructs of JavaScript and Python. It aims to highlight similarities in how basic programming concepts are implemented across these two popular programming languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*LiH-oTnZHR7S8G-MqZ7s8w.jpeg" /></figure><p>While both languages share many commonalities, making it easier for developers to switch between them or understand the other&#39;s code, there are also distinct syntactical and operational differences that one should be aware of.</p><p>It&#39;s important to approach this comparison with a light-hearted perspective and not to overemphasize the likeness or differences between JavaScript and Python. The intention is not to declare one language superior to the other but to provide a resource that can help coders who are familiar with Python to understand and transition to JavaScript more easily.</p><h3>Hello World</h3><p><strong>JavaScript</strong></p><pre>// In codeguppy.com environment<br>println(&#39;Hello, World&#39;);<br><br>// Outside codeguppy.com<br>console.log(&#39;Hello, World&#39;);</pre><p><strong>Python</strong></p><pre>print(&#39;Hello, World&#39;)</pre><h3>Variables and Constants</h3><p><strong>JavaScript</strong></p><pre>let myVariable = 100;<br><br>const MYCONSTANT = 3.14159;</pre><p><strong>Python</strong></p><pre>myVariable = 100<br><br>MYCONSTANT = 3.14159</pre><h3>String Interpolation</h3><p><strong>JavaScript</strong></p><pre>let a = 100;<br>let b = 200;<br><br>println(`Sum of ${a} and ${b} is ${a + b}`);</pre><p><strong>Python</strong></p><pre>a = 100<br>b = 200<br><br>print(f&#39;Sum of {a} and {b} is {a + b}&#39;)</pre><h3>If Expression / Statement</h3><p><strong>JavaScript</strong></p><pre>let age = 18;<br><br>if (age &lt; 13) <br>{<br>    println(&quot;Child&quot;);<br>} <br>else if (age &lt; 20) <br>{<br>    println(&quot;Teenager&quot;);<br>} <br>else <br>{<br>    println(&quot;Adult&quot;);<br>}</pre><p><strong>Python</strong></p><pre>age = 18<br><br>if age &lt; 13:<br>    print(&quot;Child&quot;)<br>elif age &lt; 20:<br>    print(&quot;Teenager&quot;)<br>else:<br>    print(&quot;Adult&quot;)</pre><h3>Conditionals</h3><p><strong>JavaScript</strong></p><pre>let age = 20;<br>let message = age &gt;= 18 ? &quot;Can vote&quot; : &quot;Cannot vote&quot;;<br>println(message);  // Output: Can vote</pre><p><strong>Python</strong></p><pre>age = 20<br>message = &quot;Can vote&quot; if age &gt;= 18 else &quot;Cannot vote&quot;<br>print(message)  # Output: Can vote</pre><h3>Arrays</h3><p><strong>JavaScript</strong></p><pre>// Creating an array<br>let myArray = [1, 2, 3, 4, 5];<br><br>// Accessing elements<br>println(myArray[0]);  // Access the first element: 1<br>println(myArray[3]);  // Access the fourth element: 4<br><br>// Modifying an element<br>myArray[2] = 30;  // Change the third element from 3 to 30<br><br>// Adding a new element<br>myArray.push(6);  // Add a new element to the end</pre><p><strong>Python</strong></p><pre># Creating a list to represent an array<br>my_array = [1, 2, 3, 4, 5]<br><br># Accessing elements<br>print(my_array[0])  # Access the first element: 1<br>print(my_array[3])  # Access the fourth element: 4<br><br># Modifying an element<br>my_array[2] = 30  # Change the third element from 3 to 30<br><br># Adding a new element<br>my_array.append(6)  # Add a new element to the end</pre><h3>ForEach</h3><p><strong>JavaScript</strong></p><pre>let fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;, &quot;date&quot;];<br><br>for(let fruit of fruits)<br>    println(fruit);</pre><p><strong>Python</strong></p><pre>fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;, &quot;date&quot;]<br><br>for fruit in fruits:<br>    print(fruit)</pre><h3>Dictionaries</h3><p><strong>JavaScript</strong></p><pre>// Creating a dictionary<br>fruit_prices = {<br>    apple: 0.65,<br>    banana: 0.35,<br>    cherry: 0.85<br>};<br><br>// Accessing a value by key<br>println(fruit_prices[&quot;apple&quot;]);  // Output: 0.65</pre><p><strong>Python</strong></p><pre># Creating a dictionary<br>fruit_prices = {<br>    &quot;apple&quot;: 0.65,<br>    &quot;banana&quot;: 0.35,<br>    &quot;cherry&quot;: 0.85<br>}<br><br># Accessing a value by key<br>print(fruit_prices[&quot;apple&quot;])  # Output: 0.65</pre><h3>Functions</h3><p><strong>JavaScript</strong></p><pre>function addNumbers(a, b) <br>{<br>    return a + b;<br>}<br><br>let result = addNumbers(100, 200);<br>println(&quot;The sum is: &quot;, result);</pre><p><strong>Python</strong></p><pre>def add_numbers(a, b):<br>    return a + b<br><br>result = add_numbers(100, 200)<br>print(&quot;The sum is: &quot;, result)</pre><h3>Tuple Return</h3><p><strong>JavaScript</strong></p><pre>function getCircleProperties(radius) <br>{<br>    const area = Math.PI * radius ** 2;<br>    const circumference = 2 * Math.PI * radius;<br><br>    return [area, circumference];  // Return as an array<br>}<br><br>// Using the function<br>const [area, circumference] = getCircleProperties(5);<br><br>println(`The area of the circle is: ${area}`);<br>println(`The circumference of the circle is: ${circumference}`);</pre><p><strong>Python</strong></p><pre>import math<br><br>def getCircleProperties(radius):<br>    &quot;&quot;&quot;Calculate and return the area and circumference of a circle.&quot;&quot;&quot;<br>    area = math.pi * radius**2<br>    circumference = 2 * math.pi * radius<br>    return (area, circumference)<br><br># Using the function<br>radius = 5<br>area, circumference = getCircleProperties(radius)<br><br>print(f&quot;The area of the circle is: {area}&quot;)<br>print(f&quot;The circumference of the circle is: {circumference}&quot;)</pre><h3>Variable number of arguments</h3><p><strong>JavaScript</strong></p><pre>function sumNumbers(...args) <br>{<br>    let sum = 0;<br>    for(let i of args)<br>        sum += i;<br>    return sum;<br>}<br><br>println(sumNumbers(1, 2, 3));<br>println(sumNumbers(100, 200));</pre><p><strong>Python</strong></p><pre>def sum_numbers(*args):<br>    sum = 0<br>    for i in args:<br>        sum += i<br>    return sum<br><br>print(sum_numbers(1, 2, 3))<br>print(sum_numbers(100, 200))</pre><h3>Lambdas</h3><p><strong>JavaScript</strong></p><pre>const numbers = [1, 2, 3, 4, 5];<br><br>// Use map to apply a function to all elements of the array<br>const squaredNumbers = numbers.map(x =&gt; x ** 2);<br><br>println(squaredNumbers);  // Output: [1, 4, 9, 16, 25]</pre><p><strong>Python</strong></p><pre>numbers = [1, 2, 3, 4, 5]<br><br># Use map to apply a function to all elements of the list<br>squared_numbers = map(lambda x: x**2, numbers)<br><br># Convert map object to a list to print the results<br>squared_numbers_list = list(squared_numbers)<br><br>print(squared_numbers_list)  # Output: [1, 4, 9, 16, 25]</pre><h3>Classes</h3><p><strong>JavaScript</strong></p><pre>class Book <br>{<br>    constructor(title, author, pages) <br>    {<br>        this.title = title;<br>        this.author = author;<br>        this.pages = pages;<br>    }<br>    <br>    describeBook() <br>    {<br>        println(`Book Title: ${this.title}`);<br>        println(`Author: ${this.author}`);<br>        println(`Number of Pages: ${this.pages}`);<br>    }<br>}</pre><p><strong>Python</strong></p><pre>class Book:<br>    def __init__(self, title, author, pages):<br>        self.title = title<br>        self.author = author<br>        self.pages = pages<br>    <br>    def describe_book(self):<br>        print(f&quot;Book Title: {self.title}&quot;)<br>        print(f&quot;Author: {self.author}&quot;)<br>        print(f&quot;Number of Pages: {self.pages}&quot;)</pre><h3>Usage of classes</h3><p><strong>JavaScript</strong></p><pre>// Creating an instance of the Book class<br>// This is actually a real book (see Curriculum section for more info)<br>const myBook = new Book(&quot;Illustrated JavaScript&quot;, &quot;Marian Veteanu&quot;, 684);<br>myBook.describeBook();</pre><p><strong>Python</strong></p><pre># Creating an instance of the Book class<br># This is actually a real book (see Curriculum section for more info)<br>my_book = Book(&quot;Illustrated JavaScript&quot;, &quot;Marian Veteanu&quot;, 684)<br>my_book.describe_book()</pre><h3>Conclusion</h3><p>We encourage you to get involved in refining this comparison. Your contributions, whether they are corrections, enhancements, or new additions, are highly valued. By collaborating, we can create a more accurate and comprehensive guide that benefits all developers interested in learning about JavaScript and Python.</p><h3>Credits</h3><p>This article was influenced by similar comparisons between other programming languages. Please note that clicking on the following links will take you outside <a href="http://codeguppy.com/">codeguppy.com</a> environment.</p><ul><li>Kotlin is like C# <a href="https://ttu.github.io/kotlin-is-like-csharp/">https://ttu.github.io/kotlin-is-like-csharp/</a></li><li>Kotlin is like TypeScript <a href="https://gi-no.github.io/kotlin-is-like-typescript/">https://gi-no.github.io/kotlin-is-like-typescript/</a></li><li>Swift is like Kotlin <a href="https://nilhcem.com/swift-is-like-kotlin/">https://nilhcem.com/swift-is-like-kotlin/</a></li><li>Swift is like Go <a href="http://repo.tiye.me/jiyinyiyong/swift-is-like-go/">http://repo.tiye.me/jiyinyiyong/swift-is-like-go/</a></li><li>Swift is like Scala <a href="https://leverich.github.io/swiftislikescala/">https://leverich.github.io/swiftislikescala/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c8a40d84bac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/javascript-is-like-python-4c8a40d84bac">JavaScript is like Python</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript for Kids]]></title>
            <link>https://medium.com/codeguppy/javascript-for-kids-3192aaae563d?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/3192aaae563d</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:42:36 GMT</pubDate>
            <atom:updated>2024-04-04T02:42:36.841Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s make a journey in time and remember those early home computers of late 70s, 80s and 90s that started the entire IT revolution. Perhaps you can still remember the ZX-Spectrum, the Commodore 64 or the BBC Micro. Although very primitive by current standards, those early computers were perfect platforms for learning to code.</p><p>They provided everything a user needed to make the jump into programming: a language (BASIC), a library of friendly commands and a code editor.</p><p>An entire generation of today’s professional developers started their careers by learning to code as kids on those early computers.</p><p>The entry path to coding is no longer as simple at is was back then. Modern computing devices are friendlier and easier to use than ever, but their advanced design makes them very difficult to program them.</p><h3>Introducing CodeGuppy</h3><p>CodeGuppy is trying to address this gap, by recreating the programming experience of those early machines in a new environment adapted to the modern world.</p><p>At a glance, CodeGuppy is an online environment that comes with a modern code editor, a modern language and a set of kid friendly commands. However, instead of BASIC, CodeGuppy is proposing JavaScript as a language of choice.</p><p>What makes JavaScript especially interesting for education is its flexible syntax which makes the language appealing to beginners. When further coupled with a library of graphic oriented functions, JavaScript becomes the perfect language for introducing kids as kids as young as 10 into the wonderful world of programming!</p><p>Either if the kids are transitioning from a block-based language such as Scratch, or they are taking the contact for the very first time with the world of programming, we’re sure they’ll have a fun and engaging experience in CodeGuppy.</p><h3>Let’s understand what makes CodeGuppy unique</h3><p>At the very base of CodeGuppy sits the p5.js library — a library with deep roots into academia. The library provides all the basic graphical commands that young students will use in their programs. Due to this design aspect, nearly 99% of p5.js sketches can be adapted to run on CodeGuppy. In the same time, the same design aspect allows CodeGuppy students to graduate to the more complex creative programming area once they are ready.</p><p>Since CodeGuppy was designed from the ground up as an educational environment, it builds on top of p5.js a series of new tools and APIs that makes the entry to programming more appealing to younger students.</p><h4>Built-in coding environment</h4><p>CodeGuppy provides a modern coding environment designed especially for kids and teens. The coding environment provides all the tools necessary to learn coding as well as develop own programs.</p><p>As an online environment there is nothing to install, the environment running directly in the browser. Any Windows, Mac or Chromebook computer being perfect for CodeGuppy. As a matter of fact, CodeGuppy runs also on tablets but we strongly advice to use a computer with a physical keyboard. At the end of the day coding involves a lot of typing.</p><p>The main components of the coding environment are the coding area, where the program is entered, and the graphical output area where the results are displayed. The system initializes automatically the graphical output using a predefined 800x600 canvas that is big enough for a wide range of programs.</p><p>There are also various pallets that can be used to explore included assets and commands.</p><h4>Built-in assets</h4><p>To make programming fun and engaging, CodeGuppy comes with built-in assets such as nice backgrounds, animated sprites as well as music and sound effects.</p><p>All these assets can be accessed and manipulated from code by using simple and intuitive commands: Example: background(&quot;image_name&quot;); to set the background image or music(&quot;tune_name&quot;); to play a certain tune as a background music.</p><p>Some beginners find a possible entry path into coding via drag-and-dropping the assets into the code area and noticing the generated code. For example, the following program was created only by drag and dropping assets:</p><pre>background(&#39;Road&#39;);<br>sprite(&#39;plane&#39;);<br>music(&#39;Rainbow&#39;);</pre><p>Try to type it in to see what it does. Remember that JavaScript is case sensitive, so type carefully.</p><h4>Type-In programs</h4><p>With CodeGuppy, type-in programs are back! Popular in the 70s and 80s, type-in programs were small programs included in magazines or other printed materials that required users to enter them from the keyboard.</p><p>Although this method of entering programs is not very time efficient, it is very good in educational terms. Users that type in programs gets comfortable much quicker with the language and eventually learn to program much faster.</p><p>Afterall, coding is all about typing programs using the keyboard.</p><p>How CodeGuppy enables type-in programs? Very simple: since all assets and libraries come included, young coders need to focus only on the coding part without having to deal with complex project organization or library management like in other environments.</p><p>In coding clubs and class settings, educators can take advantage of this feature and provide kids with printed materials containing code listening. Students will just need to type-in the programs and fix the errors as they appear.</p><p>The same feature is also what makes CodeGuppy appealing to book and magazine article authors. Look for a magazine near you for a CodeGuppy program ready to be typed-in!</p><h4>Gently introduction to programming</h4><p>A certain consideration has been put into CodeGuppy design to facilitate a gentle introduction to programming for beginners.</p><p>In CodeGuppy, even a simple command such as circle(400, 300, 300); becomes a valid program. There is no need to define any setup() or draw() function as in regular p5.js sketches.</p><p>Functions are advanced concepts and having to deal with them at the first steps into programming would make the whole teaching moment more difficult. Of course, functions are supported but they can be introduced later in the curriculum after the basic concepts are understood.</p><p>Did you notice the above-mentioned circle command? This is also one example in which CodeGuppy platform caters to the attention of young coders. The circle command is just an example of a simplified API that CodeGuppy adds on top of p5.js</p><p>As a matter of fact, circle is one of the very first commands that is introduced by CodeGuppy in the coding lessons. You’d be amazed how much fun young kids have with the circle command. An entire bear can be drawn just using circles. Give a try to the following program if you don’t believe:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AX2AGGGH4iN3Ktjh.png" /></figure><h4>Graphics and game building API</h4><p>CodeGuppy is using graphics and game programming to capture the attention and light the imagination of young coders. Since all kids can related to video games is natural for them to dream to build one of their own. Besides the regular p5.js graphics APIs, CodeGuppy further enriches this area with additional new capabilities such as:</p><ul><li>Support for manipulating sprites</li><li>Support for creating multi-scene games</li></ul><h4>Included tutorials and examples</h4><p>The first experience that one has when visits the <a href="http://codeguppy.com/">codeguppy.com</a> website is the multitude of tutorials and code examples.</p><p>Although currently in beta, CodeGuppy still contains a serious number of programs that can be used as a starting point in creating of new programs.</p><p>The included examples span different categories from basic games and pixel art applications to math and advanced polar coordinates programs.</p><h4>Browse / Adapt / Share</h4><p>On CodeGuppy students are encouraged to remix existing programs and reshare modifications. All included programs as well as programs received from friends can be remixed with a single button click.</p><p>The sharing aspect brings also a positive reinforcement aspect to the whole coding experience. By receiving friends and family feedback, young coders are feeling more motivated to continue coding and create new programs.</p><p>Advanced users can even embed or link their created CodeGuppy programs in their blogs or social media channels.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3192aaae563d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/javascript-for-kids-3192aaae563d">JavaScript for Kids</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recursion in JavaScript — Practical examples]]></title>
            <link>https://medium.com/codeguppy/recursion-in-javascript-practical-examples-fa37dd18261b?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/fa37dd18261b</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:34:04 GMT</pubDate>
            <atom:updated>2024-04-04T02:33:44.091Z</atom:updated>
            <content:encoded><![CDATA[<h3>Recursion in JavaScript — Practical examples</h3><p>Recursion is one of the most useful but very little understood programming technique. There are special kind of problems that can be solved very easy and elegant with a recursive function (e.g. locating a file in an hierarchical file system).</p><p>This article doesn’t intend to offer an explanation of how recursion works … but insted in presents you <strong>eight</strong> classical problems implemented both using a recursive solution as well as an iterative solution.</p><p>As you can probably see … for some problems recursion comes more naturally, as for the others it should not be the first choise.</p><h3>How to run the code?</h3><p>Examples from this article have been developed using the <a href="https://codeguppy.com/code.html">codeguppy.com editor</a>. However just by replacing println() with console.log() you can run it in any environment you prefer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*uPYSYUpbYWXZOp-s.png" /></figure><p>Without further ado, let’s see the problems and their solutions.</p><h3>1. Calculate the sum of natural number up to n</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*cnRxW2c3LWhs-R2q.png" /></figure><h4>Recursive solution</h4><pre>let sum = addTo(10);<br>println(sum);</pre><pre>function addTo(n)<br>{<br>    if (n == 0)<br>        return 0;<br>    <br>    return n + addTo(n - 1);<br>}</pre><h4>Iterative solution</h4><pre>let sum = addTo(10);<br>println(sum);</pre><pre>function addTo(n)<br>{<br>    let sum = 0;<br>    <br>    for(let i = 1; i &lt;= n; i++)<br>    {<br>        sum += i;<br>    }<br>    <br>    return sum;<br>}</pre><h3>2. Calculate factorial of n. Reminder n! = 1 * 2 * … * n</h3><h4>Recursive solution</h4><pre>let prod = factorial(10);<br>println(prod);</pre><pre>function factorial(n)<br>{<br>    if (n &lt;= 1)<br>        return 1;<br>        <br>    return n * factorial(n - 1);<br>}</pre><h4>Iterative solution</h4><pre>let prod = factorial(10);<br>println(prod);</pre><pre>function factorial(n)<br>{<br>    let prod = 1;<br>    <br>    for(let i = 1; i &lt;= n; i++)<br>    {<br>        prod *= i;<br>    }<br>    <br>    return prod;<br>}</pre><h3>3. Calculate the value of n to the m power</h3><h4>Recursive solution</h4><pre>println(powerNo(3, 2));</pre><pre>function powerNo(n, m)<br>{<br>    if (m == 0)<br>        return 1;<br>    <br>    if (m == 1)<br>        return n;<br>        <br>    return n * powerNo(n, m - 1);<br>}</pre><h4>Iterative solution</h4><pre>println(powerNo(3, 2));</pre><pre>function powerNo(n, m)<br>{<br>    let prod = 1;<br>    <br>    for(let i = 1; i &lt;= m; i++)<br>    {<br>        prod *= n;<br>    }<br>    <br>    return prod;<br>}</pre><h3>4. Find the nth Fibonacci number</h3><h4>Recursive solution</h4><pre>function findFibonacci(n)<br>{<br>    if (n == 0)<br>        return 0;<br>        <br>    if (n == 1)<br>        return 1;<br>        <br>    return findFibonacci(n - 1) + findFibonacci(n - 2);<br>}</pre><pre>let n = findFibonacci(10);<br>println(n);</pre><h4>Iterative solution</h4><pre>function findFibonacci(n)<br>{<br>    let fib0 = 0;<br>    let fib1 = 1;</pre><pre>    if (n == 0)<br>        return fib0;<br>        <br>    if (n == 1)<br>        return fib1;</pre><pre>    let fib;<br>    <br>    for(let i = 2; i &lt;= n; i++)<br>    {<br>        fib = fib0 + fib1;<br>        <br>        fib0 = fib1;<br>        fib1 = fib;<br>    }<br>    <br>    return fib;<br>}</pre><pre>println(findFibonacci(10));</pre><h3>5. Calculate the sum of elements of an array of numbers</h3><h4>Recursive solution</h4><pre>let ar = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];<br>let n = sum(ar);<br>println(n);<br></pre><pre>function sum(ar)<br>{<br>    return _sum(ar, ar.length - 1);<br>}</pre><pre>function _sum(ar, index)<br>{<br>    if (index == 0)<br>        return ar[0];<br>        <br>    return ar[index] + _sum(ar, index - 1);<br>}</pre><h4>Iterative solution</h4><pre>let ar = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];<br>let n = sum(ar);<br>println(n);</pre><pre>function sum(ar)<br>{<br>    let sum = 0;<br>    <br>    for(let el of ar)<br>    {<br>        sum += el;<br>    }<br>    <br>    return sum;<br>}</pre><h3>6. Sort an array of numbers using bubble sort algorithm</h3><h4>Recursive solution</h4><pre>let ar = [23, 1000, 1, -1, 8, 3];<br>println(ar);<br>bubbleSort(ar);<br>println(ar);</pre><pre>function bubbleSort(ar)<br>{<br>    let shouldSort = false;</pre><pre>    for(let i = 0; i &lt; ar.length - 1; i++)<br>    {<br>        let a = ar[i];<br>        if ( a &gt; ar[i+1] )<br>        {<br>            ar[i] = ar[i+1];<br>            ar[i+1] = a;<br>            shouldSort = true;<br>        }<br>    }<br>    <br>    if (shouldSort)<br>    {<br>        bubbleSort(ar);<br>    }<br>}</pre><h4>Iterative solution</h4><pre>let ar = [23, 1000, 1, -1, 8, 3];<br>println(ar);<br>bubbleSort(ar);<br>println(ar);</pre><pre>function bubbleSort(ar)<br>{<br>    let shouldSort = true;</pre><pre>    while(shouldSort)<br>    {<br>        shouldSort = false;<br>        <br>        for(let i = 0; i &lt; ar.length - 1; i++)<br>        {<br>            let a = ar[i];<br>            if ( a &gt; ar[i+1] )<br>            {<br>                ar[i] = ar[i+1];<br>                ar[i+1] = a;<br>                shouldSort = true;<br>            }<br>        }<br>    }<br>}</pre><h3>7. Find a number in a sorted array (binary search)</h3><h4>Recursive solution</h4><pre>//        0   1   2   3   4   5   6   7   8   9<br>let ar = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100];</pre><pre>let position = findNumber(90, ar);<br>println(position);</pre><pre>// Find number n in sorted array ar<br>// Returns array index if found or -1 if not found<br>function findNumber(n, ar)<br>{<br>    return _findNumber(n, ar, 0, ar.length - 1);<br>}</pre><pre>// Find number n in sorted array ar in between indexes i1 and i2<br>// using recursive approach<br>function _findNumber(n, ar, i1, i2)<br>{<br>    if (i2 &lt; i1)<br>        return -1;</pre><pre>    println(&quot;Checking interval: [&quot; + i1 + &quot;, &quot; + i2 + &quot;]&quot;);<br>    <br>    let mid = i1 + Math.floor((i2 - i1) / 2);<br>    <br>    if (n === ar[mid])<br>        return mid;<br>        <br>    if (n &lt; ar[mid])<br>        return _findNumber(n, ar, i1, mid - 1);<br>        <br>    return _findNumber(n, ar, mid + 1, i2);<br>}</pre><h4>Iterative solution</h4><pre>//        0   1   2   3   4   5   6   7   8   9<br>let ar = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100];</pre><pre>let position = findNumber(90, ar);<br>println(position);</pre><pre>// Find number n in sorted array ar using iterative approach<br>// Returns array index if found or -1 if not found<br>function findNumber(n, ar)<br>{<br>    let i1 = 0;<br>    let i2 = ar.length - 1;<br>    <br>    while(i1 &lt;= i2)<br>    {<br>        println(&quot;Checking interval: [&quot; + i1 + &quot;, &quot; + i2 + &quot;]&quot;);<br>        <br>        let mid = i1 + Math.floor((i2 - i1) / 2);<br>        <br>        if (n === ar[mid])<br>            return mid;</pre><pre>        if (n &lt; ar[mid])<br>        {<br>            i2 = mid - 1;<br>        }<br>        else<br>        {<br>            i1 = mid + 1;<br>        }<br>    }<br>    <br>    return -1;<br>}</pre><h3>8. Find the maximum number in an array containing numbers or other arrays of numbers</h3><h4>Recursive solution</h4><pre>let ar = [2, 4, 10, [12, 4, [100, 99], 4], [3, 2, 99], 0];</pre><pre>let max = findMax(ar);<br>println(&quot;Max  = &quot;, max);</pre><pre>// Use recursion to find the maximum numeric value in an array of arrays<br>function findMax(ar)<br>{<br>    let max = -Infinity;</pre><pre>    // Cycle through all the elements of the array<br>    for(let i = 0; i &lt; ar.length; i++)<br>    {<br>        let el = ar[i];</pre><pre>        // If an element is of type array then invoke the same function<br>        // to find out the maximum element of that subarray<br>        if ( Array.isArray(el) )<br>        {<br>            el = findMax( el );<br>        }</pre><pre>        if ( el &gt; max )<br>        {<br>            max = el;<br>        }<br>    }</pre><pre>    return max;<br>}</pre><h4>Iterative solution</h4><pre>// Find the maximum number in a jagged array of numbers or array of numbers<br>// Do not use recursion</pre><pre>let ar = [2, 4, 10, [12, 4, [100, 99], 4], [3, 2, 99], 0];</pre><pre>let max = findMax(ar);<br>println(&quot;Max  = &quot;, max);</pre><pre>// Use a stack to find the maximum numeric value in an array of arrays<br>function findMax(arElements)<br>{<br>    let max = -Infinity;</pre><pre>    // This is the stack on which will put the first array and then <br>    // all the other sub-arrays that we find as we traverse an array     <br>    let arrays = [];</pre><pre>    arrays.push(arElements);</pre><pre>    // Loop as long as are arrays added to the stack for processing<br>    while(arrays.length &gt; 0)<br>    {<br>        // Extract an array from the stack<br>        ar = arrays.pop();<br>        <br>        // ... and loop through its elements<br>        for(let i = 0; i &lt; ar.length; i++)<br>        {<br>            let el = ar[i];</pre><pre>            // If an element is of type array, we&#39;ll add it to stack<br>            // to be processed later<br>            if ( Array.isArray(el) )<br>            {<br>                arrays.push(el);<br>                continue;<br>            }<br>            <br>            if ( el &gt; max )<br>            {<br>                max = el;<br>            }<br>        }<br>    }</pre><pre>    return max;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa37dd18261b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/recursion-in-javascript-practical-examples-fa37dd18261b">Recursion in JavaScript — Practical examples</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Are There 8 Bits in a Byte?]]></title>
            <link>https://medium.com/codeguppy/why-are-there-8-bits-in-a-byte-cf07dc66c342?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/cf07dc66c342</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:24:15 GMT</pubDate>
            <atom:updated>2024-04-04T02:24:15.091Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello young explorers! Today, we’re diving into a digital mystery: Why are there 8 <strong>bits</strong> in a <strong>byte</strong>? This might sound like a simple question, but it takes us on an adventure through the history of computers and how they think!</p><h3>What’s a Bit? What’s a Byte?</h3><p>First, let’s talk about what bits and bytes are. A bit is the smallest unit of data in computing. It’s like a tiny light switch that can be either off (0) or on (1).</p><p>A byte, on the other hand, is a group of bits that work together to represent something more significant, like a letter on your keyboard or a color in a picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7yhxQm_ElYan4Y4E.png" /></figure><h3>The Journey to 8 Bits</h3><p>Long ago, in the early days of computing, there wasn’t a standard size for these groups of bits. Different computers used different sizes, like 5, 6, 7, or even up to 12 bits per group!</p><p>So, why did 8 bits win the race? There are a few reasons:</p><p><strong>Just Right for Characters</strong>: The English alphabet, numbers, and special characters like !, @, #, etc., can all be represented using different combinations of 8 bits. This size is perfect for creating a system (known as ASCII) that can represent up to 256 different characters or instructions, which was more than enough for English and basic symbols.</p><p><strong>Efficiency</strong>: 8 bits create a balance between not having enough options (which would limit what computers can do) and having too many options (which would make computers more complex and expensive). It’s the “just right” size for a wide range of tasks.</p><p><strong>Power of 2</strong>: Computer scientists love numbers that are powers of 2 (like 2, 4, 8, 16…), because computers think in binary (the language of 0s and 1s). It makes calculations and data storage more efficient and simpler to design.</p><p><strong>Technology Advances</strong>: As technology evolved, the benefits of using 8 bits became even clearer. It made it easier for different types of computers to talk to each other and share information, helping to create the connected world we live in today.</p><h3>The Legacy Continues</h3><p>The decision to standardize on 8 bits wasn’t made overnight. It was the result of trial, error, and a lot of smart thinking by the early computer scientists. And once it was set, it paved the way for the explosion of digital technology we rely on every day, from smartphones to the internet.</p><h3>Beyond the Byte</h3><p>While the byte (8 bits) is still fundamental, the digital world has grown. Now, we talk about kilobytes, megabytes, gigabytes, and even terabytes to measure the vast amounts of data we use and create every day. But at the heart of it all, those 8-bit bytes are working tirelessly, helping us to write stories, share pictures, play games, and explore the vastness of the internet.</p><h3>Conclusion</h3><p>So, why are there 8 bits in a byte? It’s a combination of practicality, efficiency, and a bit of historical happenstance. This choice helped shape the digital age, making technology accessible and useful for everyone. And who knows? Maybe one day, you’ll be part of the next big decision in computing history!</p><p>Remember, every byte counts in the vast universe of computing, and now you know the story behind those 8-bit heroes that make up the digital world. Keep exploring, keep questioning, and who knows what mysteries you’ll uncover next!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf07dc66c342" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/why-are-there-8-bits-in-a-byte-cf07dc66c342">Why Are There 8 Bits in a Byte?</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Kids Learned Programming in the 80s?]]></title>
            <link>https://medium.com/codeguppy/how-kids-learned-programming-in-the-80s-835005758b88?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/835005758b88</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:23:30 GMT</pubDate>
            <atom:updated>2024-04-04T02:23:30.006Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey there, young coders! Ever wondered how kids like you learned to program computers back in the 1980s, long before smartphones, tablets, and super-fast laptops? Well, buckle up, because we’re time-traveling to the era of big hair, cassette tapes, and the dawn of home computing.</p><p>Let’s explore the fascinating world of the <strong>ZX-Spectrum 48K</strong> and <strong>Commodore 64</strong> computers and dive into the <strong>BASIC</strong> programming language — the tools that sparked many of today’s tech geniuses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*UIEkwcnV4zl31yMUQWe0Tg.jpeg" /></figure><h3>The ZX-Spectrum 48K: A Rainbow of Possibilities</h3><p>Imagine a tiny, rainbow-striped computer that could connect to your TV and introduce you to the wonders of programming. That’s the <strong>ZX-Spectrum 48K</strong> for you! Launched in the UK by Sinclair Research in 1982, this little marvel was many kids’ first encounter with computing. It was affordable, which made it a hit with families. The Spectrum came with a built-in programming language called <strong>BASIC</strong>, allowing anyone to start coding right out of the box. Kids could create their own games, animations, and programs, learning the basics of programming in a fun, hands-on way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TzHWAS7g6Cw3rYfz.jpg" /></figure><h3>Commodore 64: The Cool Kid on the Block</h3><p>Across the ocean, another star was born: the <strong>Commodore 64</strong>, affectionately known as the <strong>C64</strong>. With its iconic beige case and rainbow logo, the C64 became the best-selling single computer model of all time. It boasted impressive graphics and sound for its era, making it perfect for games. But it wasn’t just about playing games; the C64 also came equipped with the <strong>BASIC</strong> programming language, encouraging kids to become creators. Many future programmers cut their teeth on the C64, typing in lines of code to bring their own digital worlds to life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RKk3Gmo33dF9cpRK.jpg" /></figure><h3>BASIC: Let’s learn how to code</h3><p>BASIC, which stands for Beginner’s All-purpose Symbolic Instruction Code, was the first programming language for many budding programmers in the 80s. It was designed to be easy to learn, with simple commands that made sense to beginners. Both the ZX-Spectrum and the Commodore 64 used versions of BASIC as their programming language, making them powerful tools for education. Kids could start with simple commands and gradually build up to more complex programs, learning logical thinking and problem-solving skills along the way.</p><p>Back in the 80s, learning to program often meant typing in long programs from magazines or books. Mistakes were common, and debugging was part of the fun. This hands-on approach taught patience, attention to detail, and the thrill of seeing your code come to life. It wasn’t always easy, but the sense of accomplishment when your program finally ran as intended was unbeatable.</p><h3>JavaScript is like BASIC</h3><p>Fast forward from the 80s, and we land in a world where programming languages have evolved dramatically. Yet, the mission to make coding accessible and fun for beginners continues. Enter JavaScript, a language that, in many ways, is the modern equivalent of BASIC for today’s young coders. Just as BASIC opened the doors to programming for kids in the 80s, JavaScript is doing the same today, especially through platforms like CodeGuppy.</p><p><a href="http://codeguppy.com/">codeguppy.com</a> is a shining example of how JavaScript has been made as easy to use as BASIC once was. Designed with young learners in mind, CodeGuppy takes a leaf from the BASIC book, offering an intuitive, engaging platform where kids can learn to code by creating games, animations, and more. It’s a playground where JavaScript comes to life, allowing users to see the immediate results of their code, much like the immediate feedback loop that made BASIC so beloved.</p><p><a href="http://codeguppy.com/">codeguppy.com</a> provides a plethora of resources, tutorials, and projects tailored for beginners. This nurturing environment is perfect for young coders to experiment, learn, and grow their coding skills in a fun, supportive way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h4evnwKQmDW_pwHJ.png" /></figure><h3>Conclusion</h3><p>While technology has advanced light-years since the 80s, the basic principles of programming have remained the same. The spirit of exploration, creativity, and problem-solving that kids experienced with the ZX-Spectrum and Commodore 64 continues to inspire young programmers today. Whether you’re coding on <a href="http://codeguppy.com/">codeguppy.com</a> or on any other modern coding environment, you’re part of a long tradition of digital pioneers. So, next time you sit down to program, remember you’re following in the footsteps of those 80s kids, exploring the limitless potential of what you can build with code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=835005758b88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/how-kids-learned-programming-in-the-80s-835005758b88">How Kids Learned Programming in the 80s?</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Raspberry Pi Paper Computer in Your Coding Club]]></title>
            <link>https://medium.com/codeguppy/building-a-raspberry-pi-paper-computer-in-your-coding-club-e30a63788bd2?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/e30a63788bd2</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:21:32 GMT</pubDate>
            <atom:updated>2024-04-04T02:21:32.095Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Are you looking for a fun and educational project to engage your coding club members? Building a “Raspberry Pi Paper” computer is an exciting endeavor that combines coding, electronics, and crafting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7LWtMgmBucD59OPm.jpg" /></figure><p>In this article, we’ll guide you through the process of creating a simple yet functional Raspberry Pi-powered paper computer that can be a fantastic hands-on learning experience for middle and high school students.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Es1nORX1u0RCgHuP.jpg" /></figure><h3>Materials Needed</h3><p>Before you start, gather the following materials:</p><ol><li>Raspberry Pi 400</li><li>MicroSD card (8GB or larger)</li><li>LCD screen</li><li>HDMI cable</li><li>USB PowerBank (to make it portable)</li><li>Power supply USB cable</li><li>A piece of flexible cardboard</li><li>Assorted craft supplies (markers, colored paper, glue, scissors, etc.)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yn7DlP7110b5rNXU.jpg" /></figure><p>Let’s do first a quick test with the case. Connect the LCD panel to the Raspberry Pi 400 computer using the HDMI cable and then power on the entire assembly.</p><p>If everthing works, you can start designing a case around these components using thing cardboard.</p><h3>Designing the Paper Computer</h3><ol><li>Measure and cut the cardboard into a size that fits the Raspberry Pi and screen comfortably.</li><li>Design the layout of your paper computer. You can use markers, colored paper, and other craft supplies to make it visually appealing.</li><li>Cut holes in the board to accommodate the Raspberry Pi 400 keyboard and screen.</li><li>Attach the Raspberry Pi 400 and screen securely to the board using glue or double-sided tape.</li><li>Connect the screen to the Raspberry Pi 400 using the HTMI cable</li><li>Connect the USB power bank using the USB cable</li><li>Decorate your paper computer with creative elements like labels, and graphics.</li><li>Ensure that all the components are neatly arranged and the cables are organized.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o_IOi8rNp0lBWlpN.jpg" /></figure><p>This is the back of the computer. You can use shorter cables for a more esthetic look.</p><h3>Use a code editor</h3><ol><li>Open <a href="http://codeguppy.com/">codeguppy.com</a> in a browser on the new Raspberry Pi paper computer</li><li>Code a small program</li><li>Currently the UI of <a href="http://codeguppy.com/">codeguppy.com</a> is not optimized for small and ultrawide screens but also this computer is not for real coding.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_T22ez54GQlEysy4.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y0FU3Yv_qqqoyL_B.jpg" /></figure><h3>Conclusion</h3><p>Building a “Raspberry Pi Paper” computer in your coding club is a fantastic way to introduce students to coding, electronics, and creative design. So, grab your Raspberry Pi 400 and the other supplies, and start building your own paper computer today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e30a63788bd2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/building-a-raspberry-pi-paper-computer-in-your-coding-club-e30a63788bd2">Building a Raspberry Pi Paper Computer in Your Coding Club</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Coding Projects for Middle and High School Students]]></title>
            <link>https://medium.com/codeguppy/10-coding-projects-for-middle-and-high-school-students-f910f8417455?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/f910f8417455</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:20:05 GMT</pubDate>
            <atom:updated>2024-04-04T02:17:38.113Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you a middle or high school teacher looking for exciting and educational coding projects to engage your students? Or perhaps you’re a student eager to explore the fascinating world of programming? Look no further!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*PQdMrLcLA6yfJuhyaa1OYA.jpeg" /></figure><p>We’ve compiled a list of captivating project ideas that are perfect for students at these grade levels. And the best part? These projects are all available on CodeGuppy, a fantastic platform for learning and experimenting with coding.</p><h3>1. Draw with Code</h3><p>Encourage artistic expression through coding. Students can create unique drawings and artwork using code as their canvas. This project combines coding and artistry in a captivating way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gsd15Oa-PhaX4A1_.png" /></figure><p><a href="https://codeguppy.com/code.html?t=draw">CodeGuppy Draw with Code Tutorial</a></p><h3>2. Greeting Cards with Code</h3><p>Coding virtual greeting cards is an excellent way to learn how to code. Codeguppy is offering tons of greeting card projects that you can use as starting point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*uHP4VkuzUEadahN-.png" /></figure><p><a href="https://codeguppy.com/code.html?t=Happy_Holidays">Greeting cards</a></p><h3>3. Turtle Graphics</h3><p>Turtle Graphics is a fantastic way to introduce students to the world of coding. They can create beautiful drawings and patterns by giving commands to a virtual turtle. This project enhances problem-solving skills and creativity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vNX7OxCcqWHz-YF0.png" /></figure><p><a href="https://codeguppy.com/code.html?t=turtle_graphics">CodeGuppy Turtle Graphics Tutorial</a></p><h3>4. Breakout Game</h3><p>Breakout is a classic arcade game where students can design their own version. They’ll learn about game development concepts like collision detection and game loops while having fun playing their own creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EO7lS3QTQ22tnb45.png" /></figure><p><a href="https://codeguppy.com/code.html?t=breakout">CodeGuppy Breakout Tutorial</a></p><h3>5. Invaders Game</h3><p>Challenge students to recreate the iconic Space Invaders game. They’ll gain valuable insights into game design, user input handling, and more. It’s a great way to foster creativity and critical thinking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yjE237lzV4qgd4CS.png" /></figure><p><a href="https://codeguppy.com/code.html?t=breakout">CodeGuppy Invaders Tutorial</a></p><h3>6. Analog Clock</h3><p>Students can build a digital analog clock, perfect for learning about graphics and animations. This project introduces concepts like angles and trigonometry while creating a functional clock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7IMgkqi0DdDVcTRi.png" /></figure><p><a href="https://codeguppy.com/code.html?t=clock">CodeGuppy Analog Clock Tutorial</a></p><h3>7. Plot a Function</h3><p>Introduce students to mathematics and coding simultaneously. They can create a program to plot various mathematical functions, helping them understand the relationship between code and real-world concepts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qzlIRUu0TAPXJHWh.png" /></figure><p><a href="https://codeguppy.com/code.html?t=fngraph">CodeGuppy Plot a Function Tutorial</a></p><h3>8. Prime Numbers and Fibonacci</h3><p>Explore the world of mathematical algorithms with projects like finding prime numbers, generating Fibonacci sequences, or even working with cards. These projects offer a deeper understanding of numerical concepts and problem-solving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BjPhCuuNInOTOQjz.png" /></figure><p><a href="https://codeguppy.com/code.html?t=primes">CodeGuppy Prime Numbers Tutorial</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ei8uHB9PbpexqPvf.png" /></figure><p><a href="https://codeguppy.com/code.html?t=fibonacci">CodeGuppy Fibonacci Tutorial</a></p><h3>9. Artist and Color Blokly</h3><p>Challenge students to become digital artists. They can create stunning digital artwork or experiment with color patterns using code. These projects encourage creativity and artistic exploration.</p><p><a href="https://codeguppy.com/code.html?t=artist">CodeGuppy Artist Tutorial</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IPmPwfoZwQwFcajK.png" /></figure><p><a href="https://codeguppy.com/code.html?t=blocky">CodeGuppy Color Blokly Tutorial</a></p><h3>10. Mars Attack</h3><p>Take coding to a new level by developing a space-themed game like “Mars Attack.” Students can design their own intergalactic adventure, gaining insight into game mechanics and programming logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UKPipE0heiyay9mJ.png" /></figure><p><a href="https://codeguppy.com/code.html?t=mars_attack">CodeGuppy Mars Attack Tutorial</a></p><h3>Get Started with CodeGuppy Today!</h3><p>With the resources and tutorials available on CodeGuppy, students can begin coding these captivating projects right away.</p><p>Visit CodeGuppy today, explore the tutorials, and begin coding these captivating projects. With CodeGuppy, students can unlock their creativity and develop valuable coding skills.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f910f8417455" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/10-coding-projects-for-middle-and-high-school-students-f910f8417455">10 Coding Projects for Middle and High School Students</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[8 Computer Science Algorithms You Can Implement in JavaScript]]></title>
            <link>https://medium.com/codeguppy/8-computer-science-algorithms-you-can-implement-in-javascript-47aaf9b3bf67?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/47aaf9b3bf67</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:19:47 GMT</pubDate>
            <atom:updated>2024-04-04T02:15:53.882Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of computer science, algorithms play an important role in solving complex problems, optimizing processes, and enhancing the efficiency of computational tasks.</p><p>JavaScript, with its versatility and wide adoption, provides a fantastic platform for exploring and implementing these algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*UclgiBR7u-qSe1MFflnrRQ.jpeg" /></figure><p>Whether you’re a student, a hobbyist, or a professional developer, understanding and coding these algorithms can sharpen your problem-solving skills and deepen your comprehension of computer science concepts. Here are eight engaging algorithms that we implemented in JavaScript. Feel free to fork the projects and explore the code.</p><h3>1. Flood Fill</h3><p>The Flood Fill algorithm is used to determine the area connected to a given node in a multi-dimensional array. It’s commonly used in paint programs for filling bounded areas with color and in game development for map analysis.</p><p>The algorithm works by recursively filling adjacent cells of a selected cell until it hits a boundary. Implementing Flood Fill in JavaScript is a great way to understand recursion and its applications in graphical operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u8mPurE_y2VtNnVh.png" /></figure><p><a href="https://codeguppy.com/code.html?t=flood_fill">CodeGuppy Flood Fill Tutorial</a></p><h3>2. Bresenham’s Line Algorithm</h3><p>Bresenham’s Line Algorithm is a simple, efficient way to draw straight lines on a pixelated grid, such as a computer screen. Unlike other line-drawing algorithms that may require floating-point arithmetic, Bresenham’s algorithm uses incremental error accumulation to decide the next pixel to draw, ensuring smooth lines with integer calculations. It’s an excellent exercise in understanding how computer graphics work at a fundamental level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BjevWIEhUXk0wXPm.png" /></figure><p><a href="https://codeguppy.com/code.html?t=bresenham">CodeGuppy Bresenham Tutorial</a></p><h3>3. Knight’s Tour</h3><p>The Knight’s Tour is a classic chess problem. The goal is to move a knight on a chessboard in such a way that it visits every square exactly once. This problem can be approached as a graph traversal challenge, making it a perfect candidate for exploring backtracking algorithms in JavaScript. Implementing the Knight’s Tour can help you grasp the concepts of backtracking and depth-first search.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BmVDu-neBmOdGMtO.png" /></figure><p><a href="https://codeguppy.com/code.html?t=knights_tour">CodeGuppy Knight’s Tour Tutorial</a></p><h3>4. Eight Queens</h3><p>The Eight Queens puzzle asks how to place eight queens on an 8x8 chessboard so that no two queens threaten each other. This means placing the queens such that no two queens share the same row, column, or diagonal. Like the Knight’s Tour, solving the Eight Queens puzzle in JavaScript is an excellent way to practice backtracking algorithms, offering insights into constraint satisfaction problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XJJqw6DqO-Yjpx2W.png" /></figure><p><a href="https://codeguppy.com/code.html?t=eight_queens">CodeGuppy Eight Queens Tutorial</a></p><h3>5. Sudoku Solver</h3><p>Sudoku is a popular puzzle that involves filling a 9x9 grid with digits so that each column, each row, and each of the nine 3x3 subgrids contain all the digits from 1 to 9. Writing a Sudoku solver in JavaScript challenges you to apply backtracking algorithms to a real-world problem, enhancing your understanding of how these algorithms can be adapted to various contexts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9Or1fwvW5lGKvE7L.png" /></figure><p><a href="https://codeguppy.com/code.html?t=sudoku">CodeGuppy Sudoku Tutorial</a></p><h3>6. Run-Length Encoding (RLE) Compression</h3><p>RLE is a simple form of data compression in which sequences of the same data value are stored as a single data value and count. Implementing RLE in JavaScript is straightforward and provides a practical introduction to the concepts of data compression, string manipulation, and the trade-offs between space and time complexity in algorithm design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9CQaWK10EUu78eix.png" /></figure><ul><li><a href="https://codeguppy.com/code.html?t=ascii_rle">ASCII RLE Compression</a></li><li><a href="https://codeguppy.com/code.html?t=binary_rle">Binary RLE Compression</a></li></ul><h3>7. Bubble Sort</h3><p>Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. While not the most efficient sorting method for large datasets, visualizing Bubble Sort in JavaScript, with an animation, offers a clear way to understand the basics of sorting algorithms, loops, and array manipulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c3EuEA268FHn_ikt.png" /></figure><p><a href="https://codeguppy.com/code.html?t=visual_sort">CodeGuppy Visualizing Bubble Sort Tutorial</a></p><h3>8. Perceptron</h3><p>The Perceptron is a fundamental building block of neural networks, representing the simplest form of a feedforward neural network. Implementing a Perceptron in JavaScript allows you to dip your toes into the fascinating world of machine learning and artificial intelligence, covering concepts such as weights, bias, and learning rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jGUSclc6AYdp2OmP.png" /></figure><p><a href="https://codeguppy.com/code.html?t=perceptron">CodeGuppy Perceptron Tutorial</a></p><h3>Conclusion</h3><p>These eight algorithms represent just a glimpse into the vast world of computer science and its applications.</p><p>By tackling these projects, you not only gain practical coding skills but also deepen your understanding of algorithmic thinking, problem-solving, and computational theory.</p><p>Whether for personal growth, academic purposes, or professional development, implementing these algorithms is a rewarding journey through the heart of computer science.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47aaf9b3bf67" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/8-computer-science-algorithms-you-can-implement-in-javascript-47aaf9b3bf67">8 Computer Science Algorithms You Can Implement in JavaScript</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Educational Tools That You Can Code Yourself in JavaScript]]></title>
            <link>https://medium.com/codeguppy/7-educational-tools-that-you-can-code-yourself-in-javascript-5fffe291408e?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/5fffe291408e</guid>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:10:23 GMT</pubDate>
            <atom:updated>2024-04-04T02:11:30.844Z</atom:updated>
            <content:encoded><![CDATA[<p>CodeGuppy is a dynamic coding platform tailored for coding education in the classroom or coding clubs. Leveraging the power of the p5.js library — with some thoughtful modifications — CodeGuppy makes coding accessible, fun, and educational.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*Y7AOi6SCLAWq9z8HJvh_8Q.jpeg" /></figure><p>Here, we explore seven educational tools that you can code yourself using JavaScript on the CodeGuppy platform. Each project is offering a unique learning opportunity in mathematics, science, and computer science fundamentals.</p><h3>1. Prime Number Generator</h3><p>Understanding prime numbers is foundational in mathematics and computer science. By coding a prime number generator, students can explore algorithms that identify prime numbers within a specified range. Check out our version below and see the algorithm we use to determine if a number is prime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qqw2XUJp3G9i71KE.png" /></figure><p><a href="https://codeguppy.com/code.html?t=primes">CodeGuppy Prime Number Generator Tutorial</a></p><h3>2. Fibonacci Numbers</h3><p>The Fibonacci sequence, a series where the next number is found by adding up the two numbers before it, is more than just an arithmetic curiosity — it appears in biological settings and is a classic example in recursive programming. Coding a Fibonacci number generator helps students grasp recursion and sequence generation, illuminating the beauty of mathematics in nature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dtW8DQ9pIvDN9y4o.png" /></figure><p><a href="https://codeguppy.com/code.html?t=fibonacci">CodeGuppy Fibonacci Numbers Generator Tutorial</a></p><h3>3. Graph a Math Function</h3><p>Visualizing mathematical functions is important for understanding their behavior. By coding a tool to graph math functions, students can input equations and see their graphical representations. This project not only solidifies an understanding of coordinate geometry but also introduces students to the complexities of computer graphics programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p9A3BifAcj1xTKR7.png" /></figure><p><a href="https://codeguppy.com/code.html?t=fngraph">CodeGuppy Graph a Math Function Tutorial</a></p><h3>4. Equation Generator</h3><p>An equation generator can be an invaluable tool for students to practice solving various mathematical problems. This tool can randomly generate equations within defined parameters, offering endless practice material.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jL9san6jEf4CCm6I.png" /></figure><p><a href="https://codeguppy.com/code.html?t=eq_gen">CodeGuppy Equation Generator Tutorial</a></p><h3>5. Solar System Simulator</h3><p>A solar system simulator is a captivating project that combines physics, astronomy, and programming. By simulating the motion of planets, students can learn about orbital mechanics, the laws of motion, and how to model these using programming. This project not only teaches scientific concepts but also how to translate theoretical models into visual simulations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ivE16IcaciLsXjJa.png" /></figure><p><a href="https://codeguppy.com/code.html?t=planets">CodeGuppy Planets Tutorial</a></p><h3>6. Unit Converter</h3><p>Building a unit converter teaches students about different measurement systems and the importance of precision in science and daily life. By coding a tool that converts between units like length, weight, and temperature, students practice applying mathematical conversion formulas and learn about user interface design, making their programs user-friendly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OvuAPab00bR45fRy.png" /></figure><p><a href="https://codeguppy.com/code.html?t=converters">CodeGuppy Unit Converts Tutorial</a></p><h3>7. Binary-Decimal-Hexadecimal Converter</h3><p>Understanding different number systems is fundamental in computer science. A binary-decimal-hexadecimal converter tool helps demystify how computers represent and process data. This project strengthens students’ understanding of base systems and offers practical insights into computer architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u1VNbfc3qYyMbxDL.png" /></figure><p><a href="https://codeguppy.com/code.html?t=bin_dec_hex">CodeGuppy Bin-Dec-Hex Tutorial</a></p><h3>Conclusion</h3><p>CodeGuppy provides an ideal platform for CS teachers and students to engage deeply with programming through meaningful educational projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fffe291408e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/7-educational-tools-that-you-can-code-yourself-in-javascript-5fffe291408e">7 Educational Tools That You Can Code Yourself in JavaScript</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding challenges for beginners]]></title>
            <link>https://medium.com/codeguppy/coding-challenges-for-beginners-77053af0bcee?source=rss----27f0e8d505b3---4</link>
            <guid isPermaLink="false">https://medium.com/p/77053af0bcee</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding-challenge]]></category>
            <category><![CDATA[coding-for-beginners]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Adrian]]></dc:creator>
            <pubDate>Fri, 14 Jul 2023 16:46:42 GMT</pubDate>
            <atom:updated>2020-07-02T23:38:46.448Z</atom:updated>
            <content:encoded><![CDATA[<p>Mastering these coding challenges may not get you a job at google… but you’ll be one step closer to building your own JavaScript game at <a href="https://codeguppy.com/">codeguppy.com</a>.</p><p>These coding challenges are intended for beginners, therefore the solutions are implemented using only simple / classical programming elements. Each solution is acompanied by an online link that helps you quickly run it in a code playground at <a href="https://codeguppy.com/">codeguppy.com</a></p><blockquote><em>Note: The code is making use of the codeguppy specific function </em><em>println() to print the results. If you want to run these solutions outside </em><a href="https://codeguppy.com/"><em>codeguppy.com</em></a><em>, just replace </em><em>println() with </em><em>console.log() then run them using your browser console tool or node.js.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbU3rudeIU4dAjHytfMKnA.png" /></figure><h3>Coding challenge #1: Print numbers from 1 to 10</h3><p><a href="https://codeguppy.com/code.html?mrgCtLGA90Ozr0Otrs5Z">https://codeguppy.com/code.html?mrgCtLGA90Ozr0Otrs5Z</a></p><pre>for(var i = 1; i &lt;= 10; i++)<br>{<br>    println(i);<br>}</pre><h3>Coding challenge #2: Print the odd numbers less than 100</h3><p><a href="https://codeguppy.com/code.html?eDLA5XPp3bPxP79H2jKT">https://codeguppy.com/code.html?eDLA5XPp3bPxP79H2jKT</a></p><pre>for(var i = 1; i &lt;= 100; i += 2)<br>{<br>    println(i);<br>}</pre><h3>Coding challenge #3: Print the multiplication table with 7</h3><p><a href="https://codeguppy.com/code.html?fpnQzIhnGUUmCUZy1fyQ">https://codeguppy.com/code.html?fpnQzIhnGUUmCUZy1fyQ</a></p><pre>for(var i = 1; i &lt;= 10; i++)<br>{<br>    var row = &quot;7 * &quot; + i + &quot; = &quot; + 7 * i;<br>    println(row);<br>}</pre><h3>Coding challenge #4: Print all the multiplication tables with numbers from 1 to 10</h3><p><a href="https://codeguppy.com/code.html?78aD4mWSCzoNEVxOQ8tI">https://codeguppy.com/code.html?78aD4mWSCzoNEVxOQ8tI</a></p><pre>for(var i = 1; i &lt;= 10; i++)<br>{<br>    printTable(i);<br>    println(&quot;&quot;);<br>}</pre><pre>function printTable(n)<br>{<br>    for(var i = 1; i &lt;= 10; i++)<br>    {<br>        var row = n + &quot; * &quot; + i + &quot; = &quot; + n * i;<br>        println(row);<br>    }<br>}</pre><h3>Coding challenge #5: Calculate the sum of numbers from 1 to 10</h3><p><a href="https://codeguppy.com/code.html?Vy6u9kki2hXM4YjsbpuN">https://codeguppy.com/code.html?Vy6u9kki2hXM4YjsbpuN</a></p><pre>var sum = 0;</pre><pre>for(var i = 1; i &lt;= 10; i++)<br>{<br>    sum += i;<br>}</pre><pre>println(sum);</pre><h3>Coding challenge #6: Calculate 10!</h3><p><a href="https://codeguppy.com/code.html?IIuJX4gnXOndNu0VrywA">https://codeguppy.com/code.html?IIuJX4gnXOndNu0VrywA</a></p><pre>var prod = 1;</pre><pre>for(var i = 1; i &lt;= 10; i++)<br>{<br>    prod *= i;<br>}</pre><pre>println(prod);</pre><h3>Coding challenge #7: Calculate the sum of odd numbers greater than 10 and less than 30</h3><p><a href="https://codeguppy.com/code.html?DcOffOyoIArmNZHVNM2u">https://codeguppy.com/code.html?DcOffOyoIArmNZHVNM2u</a></p><pre>var sum = 0;</pre><pre>for(var i = 11; i &lt;= 30; i += 2)<br>{<br>    sum += i;<br>}</pre><pre>println(sum);</pre><h3>Coding challenge #8: Create a function that will convert from Celsius to Fahrenheit</h3><p><a href="https://codeguppy.com/code.html?oI5mWm6QIMRjY1m9XAmI">https://codeguppy.com/code.html?oI5mWm6QIMRjY1m9XAmI</a></p><pre>function celsiusToFahrenheit(n)<br>{<br>    return n * 1.8 + 32;<br>}</pre><pre>var r = celsiusToFahrenheit(20);<br>println(r);</pre><h3>Coding challenge #9: Create a function that will convert from Fahrenheit to Celsius</h3><p><a href="https://codeguppy.com/code.html?mhnf8DpPRqqgsBgbJNpz">https://codeguppy.com/code.html?mhnf8DpPRqqgsBgbJNpz</a></p><pre>function fahrenheitToCelsius(n)<br>{<br>    return (n - 32) / 1.8;<br>}</pre><pre>var r = fahrenheitToCelsius(68);<br>println(r);</pre><h3>Coding challenge #10: Calculate the sum of numbers in an array of numbers</h3><p><a href="https://codeguppy.com/code.html?TteeVr0aj33ZyCLR685L">https://codeguppy.com/code.html?TteeVr0aj33ZyCLR685L</a></p><pre>function sumArray(ar)<br>{<br>    var sum = 0;<br>    <br>    for(var i = 0; i &lt; ar.length; i++)<br>    {<br>        sum += ar[i];<br>    }<br>    <br>    return sum;<br>}</pre><pre>var ar = [2, 3, -1, 5, 7, 9, 10, 15, 95];<br>var sum = sumArray(ar);<br>println(sum);</pre><h3>Coding challenge #11: Calculate the average of the numbers in an array of numbers</h3><p><a href="https://codeguppy.com/code.html?7i9sje6FuJsI44cuncLh">https://codeguppy.com/code.html?7i9sje6FuJsI44cuncLh</a></p><pre>function averageArray(ar)<br>{<br>    var n = ar.length;<br>    var sum = 0;<br>    <br>    for(var i = 0; i &lt; n; i++)<br>    {<br>        sum += ar[i];<br>    }<br>    <br>    return sum / n;<br>}</pre><pre>var ar = [1, 3, 9, 15, 90];<br>var avg = averageArray(ar);</pre><pre>println(&quot;Average: &quot;, avg);</pre><h3>Coding challenge #12: Create a function that receives an array of numbers and returns an array containing only the positive numbers</h3><p>Solution 1:</p><p><a href="https://codeguppy.com/code.html?0eztj1v6g7iQLzst3Id3">https://codeguppy.com/code.html?0eztj1v6g7iQLzst3Id3</a></p><pre>function getPositives(ar)<br>{<br>    var ar2 = [];<br>    <br>    for(var i = 0; i &lt; ar.length; i++)<br>    {<br>        var el = ar[i];<br>        <br>        if (el &gt;= 0)<br>        {<br>            ar2.push(el);<br>        }<br>    }<br>    <br>    return ar2;<br>}</pre><pre>var ar = [-5, 10, -3, 12, -9, 5, 90, 0, 1];<br>var ar2 = getPositives(ar);</pre><pre>println(ar2);</pre><h3>Coding challenge #12: Create a function that receives an array of numbers and returns an array containing only the positive numbers</h3><p>Solution 2</p><p><a href="https://codeguppy.com/code.html?KefrPtrvJeMpQyrB8V2D">https://codeguppy.com/code.html?KefrPtrvJeMpQyrB8V2D</a></p><pre>function getPositives(ar)<br>{<br>    var ar2 = [];<br>    <br>    for(var el of ar)<br>    {<br>        if (el &gt;= 0)<br>        {<br>            ar2.push(el);<br>        }<br>    }<br>    <br>    return ar2;<br>}</pre><pre>var ar = [-5, 10, -3, 12, -9, 5, 90, 0, 1];<br>var ar2 = getPositives(ar);</pre><pre>println(ar2);</pre><h3>Coding challenge #12: Create a function that receives an array of numbers and returns an array containing only the positive numbers</h3><p>Solution 3</p><p><a href="https://codeguppy.com/code.html?qJBQubNA7z10n6pjYmB8">https://codeguppy.com/code.html?qJBQubNA7z10n6pjYmB8</a></p><pre>function getPositives(ar)<br>{<br>    return ar.filter(el =&gt; el &gt;= 0);<br>}</pre><pre>var ar = [-5, 10, -3, 12, -9, 5, 90, 0, 1];<br>var ar2 = getPositives(ar);<br>println(ar2);</pre><h3>Coding challenge #13: Find the maximum number in an array of numbers</h3><p><a href="https://codeguppy.com/code.html?THmQGgOMRUj6PSvEV8HD">https://codeguppy.com/code.html?THmQGgOMRUj6PSvEV8HD</a></p><pre>function findMax(ar)<br>{<br>    var max = ar[0];<br>    <br>    for(var i = 0; i &lt; ar.length; i++)<br>    {<br>        if (ar[i] &gt; max)<br>        {<br>            max = ar[i];<br>        }<br>    }<br>    <br>    return max;<br>}</pre><pre>var ar = [-5, 10, -3, 12, -9, 5, 90, 0, 1];<br>var max = findMax(ar);<br>println(&quot;Max: &quot;, max);</pre><h3>Coding challenge #14: Print the first 10 Fibonacci numbers without recursion</h3><p><a href="https://codeguppy.com/code.html?rKOfPxHbVwxNWI2d8orH">https://codeguppy.com/code.html?rKOfPxHbVwxNWI2d8orH</a></p><pre>var f0 = 0;<br>println(f0);</pre><pre>var f1 = 1;<br>println(f1);</pre><pre>for(var i = 2; i &lt; 10; i++)<br>{<br>    var fi = f1 + f0;<br>    println(fi);<br>    <br>    f0 = f1;<br>    f1 = fi;<br>}</pre><h3>Coding challenge #15: Create a function that will find the nth Fibonacci number using recursion</h3><p><a href="https://codeguppy.com/code.html?IneuIg9O0rRV8V76omBk">https://codeguppy.com/code.html?IneuIg9O0rRV8V76omBk</a></p><pre>function findFibonacci(n)<br>{<br>    if (n == 0)<br>        return 0;<br>        <br>    if (n == 1)<br>        return 1;<br>        <br>    return findFibonacci(n - 1) + findFibonacci(n - 2);<br>}</pre><pre>var n = findFibonacci(10);<br>println(n);</pre><h3>Coding challenge #16: Create a function that will return a Boolean specifying if a number is prime</h3><p><a href="https://codeguppy.com/code.html?fRYsPEc2vcZTbIU8MKku">https://codeguppy.com/code.html?fRYsPEc2vcZTbIU8MKku</a></p><pre>function isPrime(n)<br>{<br>    if (n &lt; 2)<br>        return false;<br>        <br>    if (n == 2)<br>        return true;<br>    <br>    var maxDiv = Math.sqrt(n);<br>    <br>    for(var i = 2; i &lt;= maxDiv; i++)<br>    {<br>        if (n % i == 0)<br>        {<br>            return false;<br>        }<br>    }<br>    <br>    return true;<br>}</pre><pre>println(2, &quot; is prime? &quot;, isPrime(2));<br>println(3, &quot; is prime? &quot;, isPrime(3));<br>println(4, &quot; is prime? &quot;, isPrime(4));<br>println(5, &quot; is prime? &quot;, isPrime(5));<br>println(9, &quot; is prime? &quot;, isPrime(9));</pre><h3>Coding challenge #17: Calculate the sum of digits of a positive integer number</h3><p><a href="https://codeguppy.com/code.html?RHA714FYio8gWgmjWYPz">https://codeguppy.com/code.html?RHA714FYio8gWgmjWYPz</a></p><pre>function sumDigits(n)<br>{<br>    var s = n.toString();<br>    var sum = 0;<br>    <br>    for(var char of s)<br>    {<br>        var digit = parseInt(char);<br>        sum += digit;<br>    }<br>    <br>    return sum;<br>}</pre><pre>var sum = sumDigits(1235231);<br>println(&quot;Sum: &quot;, sum);</pre><h3>Coding challenge #18: Print the first 100 prime numbers</h3><p><a href="https://codeguppy.com/code.html?gnMVeOZXN6VhLekyvui8">https://codeguppy.com/code.html?gnMVeOZXN6VhLekyvui8</a></p><pre>printPrimes(100);</pre><pre>// Function prints the first nPrimes numbers<br>function printPrimes(nPrimes)<br>{<br>    var n = 0;<br>    var i = 2;<br>    <br>    while(n &lt; nPrimes)<br>    {<br>        if (isPrime(i))<br>        {<br>            println(n, &quot; --&gt; &quot;, i);<br>            n++;<br>        }<br>        <br>        i++;<br>    }<br>}<br></pre><pre>// Returns true if a number is prime<br>function isPrime(n)<br>{<br>    if (n &lt; 2)<br>        return false;<br>        <br>    if (n == 2)<br>        return true;<br>    <br>    var maxDiv = Math.sqrt(n);<br>    <br>    for(var i = 2; i &lt;= maxDiv; i++)<br>    {<br>        if (n % i == 0)<br>        {<br>            return false;<br>        }<br>    }<br>    <br>    return true;<br>}</pre><h3>Coding challenge #19: Create a function that will return in an array the first “nPrimes” prime numbers greater than a particular number “startAt”</h3><p><a href="https://codeguppy.com/code.html?mTi7EdKrviwIn4bfrmM7">https://codeguppy.com/code.html?mTi7EdKrviwIn4bfrmM7</a></p><pre>println(getPrimes(10, 100));</pre><pre>function getPrimes(nPrimes, startAt)<br>{<br>    var ar = [];<br>    <br>    var i = startAt;<br>    <br>    while(ar.length &lt; nPrimes)<br>    {<br>        if (isPrime(i))<br>        {<br>            ar.push(i);<br>        }<br>        <br>        i++;<br>    }<br>    <br>    return ar;<br>}</pre><pre>// Returns true if a number is prime<br>function isPrime(n)<br>{<br>    if (n &lt; 2)<br>        return false;<br>        <br>    if (n == 2)<br>        return true;<br>    <br>    var maxDiv = Math.sqrt(n);<br>    <br>    for(var i = 2; i &lt;= maxDiv; i++)<br>    {<br>        if (n % i == 0)<br>        {<br>            return false;<br>        }<br>    }<br>    <br>    return true;<br>}</pre><h3>Coding challenge #20: Rotate an array to the left 1 position</h3><p><a href="https://codeguppy.com/code.html?MRmfvuQdZpHn0k03hITn">https://codeguppy.com/code.html?MRmfvuQdZpHn0k03hITn</a></p><pre>var ar = [1, 2, 3];<br>rotateLeft(ar);<br>println(ar);</pre><pre>function rotateLeft(ar)<br>{<br>    var first = ar.shift();<br>    ar.push(first);<br>}</pre><h3>Coding challenge #21: Rotate an array to the right 1 position</h3><p><a href="https://codeguppy.com/code.html?fHfZqUmkAVUXKtRupmzZ">https://codeguppy.com/code.html?fHfZqUmkAVUXKtRupmzZ</a></p><pre>var ar = [1, 2, 3];<br>rotateRight(ar);<br>println(ar);</pre><pre>function rotateRight(ar)<br>{<br>    var last = ar.pop();<br>    ar.unshift(last);<br>}</pre><h3>Coding challenge #22: Reverse an array</h3><p><a href="https://codeguppy.com/code.html?GZddBqBVFlqYrsxi3Vbu">https://codeguppy.com/code.html?GZddBqBVFlqYrsxi3Vbu</a></p><pre>var ar = [1, 2, 3];<br>var ar2 = reverseArray(ar);<br>println(ar2);</pre><pre>function reverseArray(ar)<br>{<br>    var ar2 = [];<br>    <br>    for(var i = ar.length - 1; i &gt;= 0; i--)<br>    {<br>        ar2.push(ar[i]);<br>    }<br>    <br>    return ar2;<br>}</pre><h3>Coding challenge #23: Reverse a string</h3><p><a href="https://codeguppy.com/code.html?pGpyBz0dWlsj7KR3WnFF">https://codeguppy.com/code.html?pGpyBz0dWlsj7KR3WnFF</a></p><pre>var s = reverseString(&quot;JavaScript&quot;);<br>println(s);</pre><pre>function reverseString(s)<br>{<br>    var s2 = &quot;&quot;;<br>    <br>    for(var i = s.length - 1; i &gt;= 0; i--)<br>    {<br>        var char = s[i];<br>        s2 += char;<br>    }<br>    <br>    return s2;<br>}</pre><h3>Coding challenge #24: Create a function that will merge two arrays and return the result as a new array</h3><p><a href="https://codeguppy.com/code.html?vcTkLxYTAbIflqdUKivc">https://codeguppy.com/code.html?vcTkLxYTAbIflqdUKivc</a></p><pre>var ar1 = [1, 2, 3];<br>var ar2 = [4, 5, 6];</pre><pre>var ar = mergeArrays(ar1, ar2);<br>println(ar);</pre><pre>function mergeArrays(ar1, ar2)<br>{<br>   var ar = [];<br>   <br>   for(let el of ar1)<br>   {<br>       ar.push(el);<br>   }<br>   <br>   for(let el of ar2)<br>   {<br>       ar.push(el);<br>   }<br>   <br>   return ar;<br>}</pre><h3>Coding challenge #25: Create a function that will receive two arrays of numbers as arguments and return an array composed of all the numbers that are either in the first array or second array but not in both</h3><p><a href="https://codeguppy.com/code.html?Y9gRdgrl6PPt4QxVs7vf">https://codeguppy.com/code.html?Y9gRdgrl6PPt4QxVs7vf</a></p><pre>var ar1 = [1, 2, 3, 10, 5, 3, 14];<br>var ar2 = [1, 4, 5, 6, 14];</pre><pre>var ar = mergeExclusive(ar1, ar2);<br>println(ar);</pre><pre>function mergeExclusive(ar1, ar2)<br>{<br>    var ar = [];<br>    <br>    for(let el of ar1)<br>    {<br>        if (!ar2.includes(el))<br>        {<br>            ar.push(el);<br>        }<br>    }<br>    <br>    for(let el of ar2)<br>    {<br>        if (!ar1.includes(el))<br>        {<br>            ar.push(el);<br>        }<br>    }<br>    <br>    return ar;<br>}</pre><h3>Coding challenge #26: Create a function that will receive two arrays and will return an array with elements that are in the first array but not in the second</h3><p><a href="https://codeguppy.com/code.html?bUduoyY6FfwV5nQGdXzH">https://codeguppy.com/code.html?bUduoyY6FfwV5nQGdXzH</a></p><pre>var ar1 = [1, 2, 3, 10, 5, 3, 14];<br>var ar2 = [-1, 4, 5, 6, 14];</pre><pre>var ar = mergeLeft(ar1, ar2);<br>println(ar);</pre><pre>function mergeLeft(ar1, ar2)<br>{<br>    var ar = [];<br>    <br>    for(let el of ar1)<br>    {<br>        if (!ar2.includes(el))<br>        {<br>            ar.push(el);<br>        }<br>    }</pre><pre>    return ar;<br>}</pre><h3>Coding challenge #27: Create a function that will receive an array of numbers as argument and will return a new array with distinct elements</h3><p>Solution 1</p><p><a href="https://codeguppy.com/code.html?OkbtP1ZksGHXwqk7Jh3i">https://codeguppy.com/code.html?OkbtP1ZksGHXwqk7Jh3i</a></p><pre>var ar = getDistinctElements([1, 2, 3, 6, -1, 2, 9, 7, 10, -1, 100]);<br>println(ar);</pre><pre>function getDistinctElements(ar)<br>{<br>    var ar2 = [];<br>    <br>    for(let i = 0; i &lt; ar.length; i++)<br>    {<br>        if (!isInArray(ar[i], ar2))<br>        {<br>            ar2.push(ar[i]);<br>        }<br>    }<br>    <br>    return ar2;<br>}</pre><pre>function isInArray(n, ar)<br>{<br>    for(let i = 0; i &lt; ar.length; i++)<br>    {<br>        if (ar[i] === n)<br>            return true;<br>    }<br>    <br>    return false;<br>}</pre><h3>Coding challenge #27: Create a function that will receive an array of numbers as argument and will return a new array with distinct elements</h3><p>Solution 2</p><p><a href="https://codeguppy.com/code.html?NjGtyQdMP49QiaAkmwpU">https://codeguppy.com/code.html?NjGtyQdMP49QiaAkmwpU</a></p><pre>var ar = getDistinctElements([1, 2, 3, 6, -1, 2, 9, 7, 10, -1, 100]);<br>println(ar);</pre><pre>function getDistinctElements(ar)<br>{<br>    var ar2 = [];<br>    <br>    var lastIndex = ar.length - 1;<br>    <br>    for(let i = 0; i &lt;= lastIndex; i++)<br>    {<br>        if (!isInArray(ar[i], ar, i + 1, lastIndex))<br>        {<br>            ar2.push(ar[i]);<br>        }<br>    }<br>    <br>    return ar2;<br>}</pre><pre>function isInArray(n, ar, fromIndex, toIndex)<br>{<br>    for(var i = fromIndex; i &lt;= toIndex; i++)<br>    {<br>        if (ar[i] === n)<br>            return true;<br>    }<br>    <br>    return false;<br>}</pre><h3>Coding challenge #28: Calculate the sum of first 100 prime numbers</h3><p><a href="https://codeguppy.com/code.html?v0O9sBfnHbCi1StE2TxA">https://codeguppy.com/code.html?v0O9sBfnHbCi1StE2TxA</a></p><pre>var n = 10;<br>println(&quot;Sum of first &quot;, n, &quot; primes is &quot;, sumPrimes(10));</pre><pre>function sumPrimes(n)<br>{<br>    var foundPrimes = 0;<br>    var i = 2;<br>    var sum = 0;<br>    <br>    while(foundPrimes &lt; n)<br>    {<br>        if (isPrime(i))<br>        {<br>            foundPrimes++;<br>            sum += i;<br>        }<br>        <br>        i++;<br>    }<br>    <br>    return sum;<br>}</pre><pre>// Returns true if number n is prime<br>function isPrime(n)<br>{<br>    if (n &lt; 2)<br>        return false;<br>        <br>    if (n == 2)<br>        return true;<br>    <br>    var maxDiv = Math.sqrt(n);<br>    <br>    for(var i = 2; i &lt;= maxDiv; i++)<br>    {<br>        if (n % i === 0)<br>        {<br>            return false;<br>        }<br>    }<br>    <br>    return true;<br>}</pre><h3>Coding challenge #29: Print the distance between the first 100 prime numbers</h3><p><a href="https://codeguppy.com/code.html?xKQEeKYF1LxZhDhwOH7V">https://codeguppy.com/code.html?xKQEeKYF1LxZhDhwOH7V</a></p><pre>printDistances(100);</pre><pre>// Print distances between the first n prime numbers<br>function printDistances(n)<br>{<br>    var lastPrime = 2;<br>    var i = lastPrime + 1;<br>    var foundPrimes = 1;<br>    <br>    while(foundPrimes &lt; n)<br>    {<br>        if (isPrime(i))<br>        {<br>            println(i - lastPrime, &quot;\t&quot;, i, &quot; - &quot;, lastPrime);</pre><pre>            foundPrimes++;<br>            lastPrime = i;<br>        }<br>        <br>        i++;<br>    }<br>}</pre><pre>// Returns true if number n is prime<br>function isPrime(n)<br>{<br>    if (n &lt; 2)<br>        return false;<br>        <br>    if (n == 2)<br>        return true;<br>    <br>    var maxDiv = Math.sqrt(n);<br>    <br>    for(var i = 2; i &lt;= maxDiv; i++)<br>    {<br>        if (n % i === 0)<br>        {<br>            return false;<br>        }<br>    }<br>    <br>    return true;<br>}</pre><h3>Coding challenge #30-a: Create a function that will add two positive numbers of indefinite size. The numbers are received as strings and the result should be also provided as string.</h3><p>Solution 1</p><p><a href="https://codeguppy.com/code.html?v5A0QBsdHaiAVA2CPN5y">https://codeguppy.com/code.html?v5A0QBsdHaiAVA2CPN5y</a></p><pre>var n1 = &quot;2909034221912398942349&quot;;<br>var n2 = &quot;1290923909029309499&quot;;<br>var sum = add(n1, n2);</pre><pre>println(n1, &quot;\n&quot;, n2, &quot;\n&quot;, sum);</pre><pre>function add(sNumber1, sNumber2)<br>{<br>    var s = &quot;&quot;;<br>    var carry = 0;<br>    <br>    var maxSize = Math.max(sNumber1.length, sNumber2.length);<br>    <br>    for(var i = 0; i &lt; maxSize; i++)<br>    {<br>        var digit1 = digitFromRight(sNumber1, i);<br>        var digit2 = digitFromRight(sNumber2, i);<br>        <br>        var sum = digit1 + digit2 + carry;<br>        var digitSum = sum % 10;<br>        carry = sum &gt;= 10 ? 1 : 0;<br>        <br>        s = digitSum.toString() + s;<br>    }<br>    <br>    if (carry &gt; 0)<br>        s = carry + s;<br>    <br>    return s;<br>}</pre><pre>function digitFromRight(s, digitNo)<br>{<br>    if (digitNo &gt;= s.length)<br>        return 0;<br>        <br>    var char = s[ s.length - 1 - digitNo ];<br>    return parseInt(char);<br>}</pre><h3>Coding challenge #30-b: Create a function that will add two positive numbers of indefinite size. The numbers are received as strings and the result should be also provided as string.</h3><p>Solution 2</p><p><a href="https://codeguppy.com/code.html?yMQXcPgfrYxuaIxqQmZc">https://codeguppy.com/code.html?yMQXcPgfrYxuaIxqQmZc</a></p><pre>var n1 = &quot;2909034221912398942349&quot;;<br>var n2 = &quot;1290923909029309499&quot;;<br>var sum = add(n1, n2);</pre><pre>println(n1);<br>println(n2);<br>println(sum);</pre><pre>function add(sNumber1, sNumber2)<br>{<br>    var maxSize = Math.max(sNumber1.length, sNumber2.length);<br>    <br>    var s1 = sNumber1.padStart(maxSize, &quot;0&quot;);<br>    var s2 = sNumber2.padStart(maxSize, &quot;0&quot;);</pre><pre>    var s = &quot;&quot;;<br>    var carry = 0;<br>    <br>    for(var i = maxSize - 1; i &gt;= 0; i--)<br>    {<br>        var digit1 = parseInt(s1[i]);<br>        var digit2 = parseInt(s2[i]);<br>        <br>        var sum = digit1 + digit2 + carry;<br>        var digitSum = sum % 10;<br>        carry = sum &gt;= 10 ? 1 : 0;<br>        <br>        s = digitSum.toString() + s;<br>    }<br>    <br>    if (carry &gt; 0)<br>        s = carry + s;<br>    <br>    return s;<br>}</pre><h3>Coding challenge #31a. Create a function that will return the number of words in a text</h3><p><a href="https://codeguppy.com/code.html?r4kwkcWiHfzQZkM1qrX4">https://codeguppy.com/code.html?r4kwkcWiHfzQZkM1qrX4</a></p><pre>// Solution 1</pre><pre>function countWords(text)<br>{<br>    var wasSeparator = true;<br>    var words = 0;<br>    <br>    for(var c of text)<br>    {<br>        // if current character is separator then advance and<br>        // set that the previous character was separator<br>        if (isSeparator(c))<br>        {<br>            wasSeparator = true;<br>            continue;<br>        }</pre><pre>        // if current character is not separator<br>        // ... but if previous was separator...<br>        if (wasSeparator)<br>        {<br>            words++;<br>            wasSeparator = false;<br>        }<br>    }<br>    <br>    return words;<br>}</pre><pre>function isSeparator(c)<br>{<br>    var separators = [&quot; &quot;, &quot;\t&quot;, &quot;\n&quot;, &quot;\r&quot;, &quot;,&quot;, &quot;;&quot;, &quot;.&quot;, &quot;!&quot;, &quot;?&quot;];<br>    return separators.includes(c);<br>}</pre><pre>println(countWords(&quot;&quot;));<br>println(countWords(&quot;            &quot;));<br>println(countWords(&quot;JavaScript!!!   &quot;));<br>println(countWords(&quot;     JavaScript&quot;));<br>println(countWords(&quot;    JavaScript is cool      &quot;));<br>println(countWords(&quot;I like to learn JavaScript with codeguppy&quot;));</pre><h3>Coding challenge #31b. Create a function that will return the number of words in a text</h3><p><a href="https://codeguppy.com/code.html?8pdZSfchSXNxBK1f7r7s">https://codeguppy.com/code.html?8pdZSfchSXNxBK1f7r7s</a></p><pre>// Solution 2</pre><pre>function countWords(text)<br>{<br>    var words = 0;<br>    <br>    if (text.length &gt; 0 &amp;&amp; !isSeparator(text[0]))<br>        words++;<br>    <br>    for(var i = 1; i &lt; text.length; i++)<br>    {<br>        var currChr = text[i];<br>        var prevChr = text[i - 1];<br>        <br>        if (!isSeparator(currChr) &amp;&amp; isSeparator(prevChr))<br>        {<br>            words++;<br>        }<br>    }<br>    <br>    return words;<br>}</pre><pre>function isSeparator(c)<br>{<br>    var separators = [&quot; &quot;, &quot;\t&quot;, &quot;\n&quot;, &quot;\r&quot;, &quot;,&quot;, &quot;;&quot;, &quot;.&quot;, &quot;!&quot;, &quot;?&quot;];<br>    return separators.includes(c);<br>}</pre><pre>println(countWords(&quot;&quot;));<br>println(countWords(&quot;            &quot;));<br>println(countWords(&quot;JavaScript!!!   &quot;));<br>println(countWords(&quot;     JavaScript&quot;));<br>println(countWords(&quot;    JavaScript is cool      &quot;));<br>println(countWords(&quot;I like to learn JavaScript with codeguppy&quot;));</pre><h3>Coding challenge #32. Create a function that will capitalize the first letter of each word in a text</h3><p><a href="https://codeguppy.com/code.html?OJoMXT4GKasSfNeX4hjH">https://codeguppy.com/code.html?OJoMXT4GKasSfNeX4hjH</a></p><pre>println(captializeWords(&quot;Create a function that will capitalize the first letter of each word in a text&quot;));</pre><pre>function captializeWords(text)<br>{<br>    var text2 = &quot;&quot;;<br>    <br>    for(var i = 0; i &lt; text.length; i++)<br>    {<br>        var currChr = text[i];<br>        var prevChr = i &gt; 0 ? text[i - 1] : &quot; &quot;;<br>        <br>        if (!isSeparator(currChr) &amp;&amp; isSeparator(prevChr))<br>        {<br>            currChr = currChr.toUpperCase();<br>        }<br>        <br>        text2 += currChr;<br>    }<br>    <br>    return text2;<br>}</pre><pre>function isSeparator(c)<br>{<br>    var separators = [&quot; &quot;, &quot;\t&quot;, &quot;\n&quot;, &quot;\r&quot;, &quot;,&quot;, &quot;;&quot;, &quot;.&quot;, &quot;!&quot;, &quot;?&quot;];<br>    return separators.includes(c);<br>}</pre><h3>Coding challenge #33. Calculate the sum of numbers received in a comma delimited string</h3><p><a href="https://codeguppy.com/code.html?QL6H38rpqjGarwCfsbO3">https://codeguppy.com/code.html?QL6H38rpqjGarwCfsbO3</a></p><pre>println(sumCSV(&quot;1.5, 2.3, 3.1, 4, 5.5, 6, 7, 8, 9, 10.9&quot;));</pre><pre>function sumCSV(s)<br>{<br>    var ar = s.split(&quot;,&quot;);<br>    <br>    var sum = 0;<br>    <br>    for(var n of ar)<br>    {<br>        sum += parseFloat(n);<br>    }<br>    <br>    return sum;<br>}</pre><h3>Coding challenge #34. Create a function that will return an array with words inside a text</h3><p><a href="https://codeguppy.com/code.html?IJI0E4OGnkyTZnoszAzf">https://codeguppy.com/code.html?IJI0E4OGnkyTZnoszAzf</a></p><pre>var text = &quot;Create a function, that will return an array (of string), with the words inside the text&quot;;</pre><pre>println(getWords(text));</pre><pre>function getWords(text)<br>{<br>    let startWord = -1;<br>    let ar = [];<br>    <br>    for(let i = 0; i &lt;= text.length; i++)<br>    {<br>        let c = i &lt; text.length ? text[i] : &quot; &quot;;</pre><pre>        if (!isSeparator(c) &amp;&amp; startWord &lt; 0)<br>        {<br>            startWord = i;<br>        }<br>        <br>        if (isSeparator(c) &amp;&amp; startWord &gt;= 0)<br>        {<br>            let word = text.substring(startWord, i);<br>            ar.push(word);<br>            <br>            startWord = -1;<br>        }<br>    }</pre><pre>    return ar;<br>}</pre><pre>function isSeparator(c)<br>{<br>    var separators = [&quot; &quot;, &quot;\t&quot;, &quot;\n&quot;, &quot;\r&quot;, &quot;,&quot;, &quot;;&quot;, &quot;.&quot;, &quot;!&quot;, &quot;?&quot;, &quot;(&quot;, &quot;)&quot;];<br>    return separators.includes(c);<br>}</pre><h3>Coding challenge #35. Create a function to convert a CSV text to a “bi-dimensional” array</h3><p><a href="https://codeguppy.com/code.html?5Hqv93WXQ6OOjAYApLGw">https://codeguppy.com/code.html?5Hqv93WXQ6OOjAYApLGw</a></p><pre>var data = &quot;John;Smith;954-000-0000\nMich;Tiger;305-000-0000\nMonique;Vasquez;103-000-0000&quot;;</pre><pre>var ar = csvToArray(data);<br>println(JSON.stringify(ar));</pre><pre>function csvToArray(data)<br>{<br>    var arLines = data.split(&quot;\n&quot;);</pre><pre>    for(var i = 0; i &lt; arLines.length; i++)<br>    {<br>        var arLine = arLines[i].split(&quot;;&quot;);<br>        arLines[i] = arLine;<br>    }<br>    <br>    return arLines;<br>}</pre><h3>Coding challenge #36. Create a function that converts a string to an array of characters</h3><p><a href="https://codeguppy.com/code.html?XCD9vmSQ34HrascysDBL">https://codeguppy.com/code.html?XCD9vmSQ34HrascysDBL</a></p><pre>println(getChars(&quot;I like JavaScript&quot;));</pre><pre>function getChars(s)<br>{<br>    return Array.from(s);<br>}</pre><h3>Coding challenge #37. Create a function that will convert a string in an array containing the ASCII codes of each character</h3><p><a href="https://codeguppy.com/code.html?suDlTrNYYmCpNJhZpPdB">https://codeguppy.com/code.html?suDlTrNYYmCpNJhZpPdB</a></p><pre>println(getCharCodes(&quot;I like JavaScript&quot;));</pre><pre>function getCharCodes(s)<br>{<br>    var ar = [];<br>    <br>    for(var i = 0; i &lt; s.length; i++)<br>    {<br>        var code = s.charCodeAt(i);<br>        ar.push(code);<br>    }<br>    <br>    return ar;<br>}</pre><h3>Coding challenge #38. Create a function that will convert an array containing ASCII codes in a string</h3><p><a href="https://codeguppy.com/code.html?QGWEPdBEVk4RFGn6UVhP">https://codeguppy.com/code.html?QGWEPdBEVk4RFGn6UVhP</a></p><pre>println(codesToString([73,32,108,105,107,101,32,74,97,118,97,83,99,114,105,112,116]));</pre><pre>function codesToString(ar)<br>{<br>    return String.fromCharCode(...ar);<br>}</pre><h3>Coding challenge #39. Implement the Caesar cypher</h3><p><a href="https://codeguppy.com/code.html?kextwiVVb9VwhKajJriG">https://codeguppy.com/code.html?kextwiVVb9VwhKajJriG</a></p><pre>var text = &quot;I LOVE JAVASCRIPT&quot;;<br>var textEnc = encrypt(text, 13);<br>var textDec = decrypt(textEnc, 13);</pre><pre>println(text);<br>println(textEnc);<br>println(textDec);</pre><pre>// Decrypt a message by using the same encrypt function<br>// ... but using the inverse of the key (e.g. rotate in the other direction)<br>function decrypt(msg, key)<br>{<br>    return encrypt(msg, key * -1);<br>}</pre><pre>// Function will implement Caesar Cipher to<br>// encrypt / decrypt the msg by shifting the letters<br>// of the message acording to the key<br>function encrypt(msg, key)<br>{<br>    var encMsg = &quot;&quot;;</pre><pre>    for(var i = 0; i &lt; msg.length; i++)<br>    {<br>        var code = msg.charCodeAt(i);</pre><pre>        // Encrypt only letters in &#39;A&#39; ... &#39;Z&#39; interval<br>        if (code &gt;= 65 &amp;&amp; code &lt;= 65 + 26 - 1)<br>        {<br>            code -= 65;<br>            code = mod(code + key, 26);<br>            code += 65;<br>        }</pre><pre>        encMsg += String.fromCharCode(code);<br>    }</pre><pre>    return encMsg;<br>}<br></pre><pre>// Modulo function: n mod p<br>function mod(n, p)<br>{<br>    if ( n &lt; 0 )<br>        n = p - Math.abs(n) % p;</pre><pre>    return n % p;<br>}</pre><h3>Coding challenge #40. Implement the bubble sort algorithm for an array of numbers</h3><p><a href="https://codeguppy.com/code.html?6bPnKHLhArSPdUPK2mqm">https://codeguppy.com/code.html?6bPnKHLhArSPdUPK2mqm</a></p><pre>var ar = [23, 1000, 1, -1, 8, 3];<br>println(ar);<br>bubbleSort(ar);<br>println(ar);</pre><pre>function bubbleSort(ar)<br>{<br>    var shouldSort = true;</pre><pre>    while(shouldSort)<br>    {<br>        shouldSort = false;<br>        <br>        for(var i = 0; i &lt; ar.length - 1; i++)<br>        {<br>            var a = ar[i];<br>            if ( a &gt; ar[i+1] )<br>            {<br>                ar[i] = ar[i+1];<br>                ar[i+1] = a;<br>                shouldSort = true;<br>            }<br>        }<br>    }<br>}</pre><h3>Coding challenge #41. Create a function to calculate the distance between two points defined by their x, y coordinates</h3><p><a href="https://codeguppy.com/code.html?mnAuF3BjhDaFwBtDUnI4">https://codeguppy.com/code.html?mnAuF3BjhDaFwBtDUnI4</a></p><pre>println(getDistance(100, 100, 400, 300));</pre><pre>function getDistance(x1, y1, x2, y2)<br>{<br>    var l1 = x2 - x1;<br>    var l2 = y2 - y1;<br>    <br>    return Math.sqrt(l1 * l1 + l2 * l2);<br>}</pre><h3>Coding challenge #42. Create a function that will return a Boolean value indicating if two circles defined by center coordinates and radius are intersecting</h3><p><a href="https://codeguppy.com/code.html?cTZiewHGAErNUjYRCE6f">https://codeguppy.com/code.html?cTZiewHGAErNUjYRCE6f</a></p><pre>println(collisionCircleCircle(200, 200, 100, 300, 300, 50));</pre><pre>function collisionCircleCircle(circle1X, circle1Y, circle1R, circle2X, circle2Y, circle2R)<br>{<br>    return getDistance(circle1X, circle1Y, circle2X, circle2Y) &lt;= circle1R + circle2R;<br>}</pre><pre>// Calculate the distance between the two specified points<br>function getDistance(x1, y1, x2, y2)<br>{<br>    var l1 = x2 - x1;<br>    var l2 = y2 - y1;<br>    <br>    return Math.sqrt(l1 * l1 + l2 * l2);<br>}</pre><h3>Coding challenge 43. Create a function that will receive a bi-dimensional array as argument and a number and will extract as a unidimensional array the column specified by the number</h3><p><a href="https://codeguppy.com/code.html?b22i9I5CUkFTdHF4Bod8">https://codeguppy.com/code.html?b22i9I5CUkFTdHF4Bod8</a></p><pre>var ar = [ [&quot;John&quot;, 120],<br>            [&quot;Jane&quot;, 115],<br>            [&quot;Thomas&quot;, 123],<br>            [&quot;Mel&quot;, 112],<br>            [&quot;Charley&quot;, 122]<br>         ];</pre><pre>var numbers = extractCol(ar, 1);<br>println(numbers);</pre><pre>function extractCol(ar, colNo)<br>{<br>    var arCol = [];<br>    <br>    for(var i = 0; i &lt; ar.length; i++)<br>    {<br>        arCol.push(ar[i][colNo]);<br>    }<br>    <br>    return arCol;<br>}</pre><h3>Coding challenge #44. Create a function that will convert a string containing a binary number into a number</h3><p><a href="https://codeguppy.com/code.html?iDykr8pqeuTPgZjVAvWv">https://codeguppy.com/code.html?iDykr8pqeuTPgZjVAvWv</a></p><pre>println(binaryToNumber(&quot;11111111&quot;));</pre><pre>function binaryToNumber(sBinary)<br>{<br>    return parseInt(sBinary, 2);<br>}</pre><h3>Coding challenge #45. Create a function to calculate the sum of all the numbers in a jagged array (array contains numbers or other arrays of numbers on an unlimited number of levels)</h3><p><a href="https://codeguppy.com/code.html?3gu4jcQRpBQWu2EsJrv0">https://codeguppy.com/code.html?3gu4jcQRpBQWu2EsJrv0</a></p><pre>var ar = [1, 2, [15, [23], [5, 12]], [100]];</pre><pre>println(sumArray(ar));</pre><pre>function sumArray(ar)<br>{<br>    var sum = 0;<br>    <br>    for(var el of ar)<br>    {<br>        if (Array.isArray(el))<br>        {<br>            el = sumArray(el);<br>        }<br>        <br>        sum += el;<br>    }<br>    <br>    return sum;<br>}</pre><h3>Coding challenge #46-a. Find the maximum number in a jagged array of numbers or array of numbers</h3><p><a href="https://codeguppy.com/code.html?oT5nrxux2yAgIRsuXBSK">https://codeguppy.com/code.html?oT5nrxux2yAgIRsuXBSK</a></p><pre>// Solution 1</pre><pre>var ar = [2, 4, 10, [12, 4, [100, 99], 4], [3, 2, 99], 0];</pre><pre>var max = findMax(ar);<br>println(&quot;Max  = &quot;, max);</pre><pre>// Use recursion to find the maximum numeric value in an array of arrays<br>function findMax(ar)<br>{<br>    var max = -Infinity;</pre><pre>    // Cycle through all the elements of the array<br>    for(var i = 0; i &lt; ar.length; i++)<br>    {<br>        var el = ar[i];</pre><pre>        // If an element is of type array then invoke the same function<br>        // to find out the maximum element of that subarray<br>        if ( Array.isArray(el) )<br>        {<br>            el = findMax( el );<br>        }</pre><pre>        if ( el &gt; max )<br>        {<br>            max = el;<br>        }<br>    }</pre><pre>    return max;<br>}</pre><h3>Coding challenge #46-b. Find the maximum number in a jagged array of numbers or array of numbers</h3><p><a href="https://codeguppy.com/code.html?VvLiW0W3lwnMrbwC9epp">https://codeguppy.com/code.html?VvLiW0W3lwnMrbwC9epp</a></p><pre>// Solution 2</pre><pre>var ar = [2, 4, 10, [12, 4, [100, 99], 4], [3, 2, 99], 0];</pre><pre>var max = findMax(ar);<br>println(&quot;Max  = &quot;, max);</pre><pre>// Use a stack to find the maximum numeric value in an array of arrays<br>function findMax(arElements)<br>{<br>    var max = -Infinity;</pre><pre>    // This is the stack on which will put the first array and then <br>    // all the other sub-arrays that we find as we traverse an array     <br>    var arrays = [];</pre><pre>    arrays.push(arElements);</pre><pre>    // Loop as long as are arrays added to the stack for processing<br>    while(arrays.length &gt; 0)<br>    {<br>        // Extract an array from the stack<br>        ar = arrays.pop();<br>        <br>        // ... and loop through its elements<br>        for(var i = 0; i &lt; ar.length; i++)<br>        {<br>            var el = ar[i];</pre><pre>            // If an element is of type array, we&#39;ll add it to stack<br>            // to be processed later<br>            if ( Array.isArray(el) )<br>            {<br>                arrays.push(el);<br>                continue;<br>            }<br>            <br>            if ( el &gt; max )<br>            {<br>                max = el;<br>            }<br>        }<br>    }</pre><pre>    return max;<br>}</pre><h3>Coding challenge #47. Deep copy a jagged array with numbers or other arrays in a new array</h3><p><a href="https://codeguppy.com/code.html?4eRqha7h7kjOLnDTyf00">https://codeguppy.com/code.html?4eRqha7h7kjOLnDTyf00</a></p><pre>var ar1 = [2, 4, 10, [12, 4, [100, 99], 4], [3, 2, 99], 0];<br>var ar2 = copyArray(ar1);</pre><pre>println(ar2);</pre><pre>function copyArray(ar)<br>{<br>    var ar2 = [];<br>    <br>    for(var el of ar)<br>    {<br>        if (Array.isArray(el))<br>        {<br>            el = copyArray(el);<br>        }<br>        <br>        ar2.push(el);<br>    }<br>    <br>    return ar2;<br>}</pre><h3>Coding challenge #48. Create a function to return the longest word(s) in a string</h3><p><a href="https://codeguppy.com/code.html?6O219iv12e5UaC30fcbG">https://codeguppy.com/code.html?6O219iv12e5UaC30fcbG</a></p><pre>var text = &quot;Create a function to return the longest word(s) in a sentance.&quot;;</pre><pre>println(getLongestWords(text));</pre><pre>function getLongestWords(text)<br>{<br>    var words = getWords(text);<br>    <br>    var maxSize = 0;<br>    var maxPositions = [];<br>    <br>    for(var i = 0; i &lt; words.length; i++)<br>    {<br>        var currWordSize = words[i].length;<br>        <br>        if (currWordSize &gt; maxSize)<br>        {<br>            maxSize = currWordSize;<br>            maxPositions = [ i ];<br>        }<br>        else if (currWordSize === maxSize)<br>        {<br>            maxPositions.push(i);<br>        }<br>    }</pre><pre>    return getElements(words, maxPositions);<br>}</pre><pre>// Get only the elements from specified positions from the array<br>function getElements(ar, arPositions)<br>{<br>    var arNew = [];<br>    <br>    for(var pos of arPositions)<br>    {<br>        arNew.push(ar[pos]);<br>    }<br>    <br>    return arNew;<br>}</pre><pre>// Returns an array with the words from specified text<br>function getWords(text)<br>{<br>    let startWord = -1;<br>    let ar = [];<br>    <br>    for(let i = 0; i &lt;= text.length; i++)<br>    {<br>        let c = i &lt; text.length ? text[i] : &quot; &quot;;</pre><pre>        if (!isSeparator(c) &amp;&amp; startWord &lt; 0)<br>        {<br>            startWord = i;<br>        }<br>        <br>        if (isSeparator(c) &amp;&amp; startWord &gt;= 0)<br>        {<br>            let word = text.substring(startWord, i);<br>            ar.push(word);<br>            <br>            startWord = -1;<br>        }<br>    }</pre><pre>    return ar;<br>}</pre><pre>function isSeparator(c)<br>{<br>    var separators = [&quot; &quot;, &quot;\t&quot;, &quot;\n&quot;, &quot;\r&quot;, &quot;,&quot;, &quot;;&quot;, &quot;.&quot;, &quot;!&quot;, &quot;?&quot;, &quot;(&quot;, &quot;)&quot;];<br>    return separators.includes(c);<br>}</pre><h3>Coding challenge #49. Shuffle an array of strings</h3><p><a href="https://codeguppy.com/code.html?EHvbHKy5uPvSKxsaeqWv">https://codeguppy.com/code.html?EHvbHKy5uPvSKxsaeqWv</a></p><pre>var ar = [&quot;Shuffle&quot;, &quot;an&quot;, &quot;array&quot;, &quot;of&quot;, &quot;strings&quot;];</pre><pre>println(shuffleArray(ar));</pre><pre>// Shuffle array implemented using Fisher–Yates shuffle algorithm<br>function shuffleArray(ar)<br>{<br>    for(var i = ar.length - 1; i &gt; 0; i--)<br>    {<br>        var j = randomInt(0, i - 1);<br>        <br>        var t = ar[i];<br>        ar[i] = ar[j];<br>        ar[j] = t;<br>    }<br>    <br>    return ar;<br>}</pre><pre>// Get a random int between min and max (both included)<br>function randomInt(min, max) <br>{<br>    return Math.floor(Math.random() * (max - min + 1) ) + min;<br>}</pre><h3>Coding challenge #50. Create a function that will receive n as argument and return an array of n unique random numbers from 1 to n.</h3><p><a href="https://codeguppy.com/code.html?GfCrzPkGSPKbvLuf6KyA">https://codeguppy.com/code.html?GfCrzPkGSPKbvLuf6KyA</a></p><pre>println(getRandomNumbers(10));</pre><pre>function getRandomNumbers(n)<br>{<br>    var ar = [];<br>    <br>    for(var i = 1; i &lt;= n; i++)<br>    {<br>        ar.push(i);<br>    }<br>    <br>    shuffleArray(ar);<br>    <br>    return ar;<br>}</pre><pre>// Shuffle array implemented using Fisher–Yates shuffle algorithm<br>function shuffleArray(ar)<br>{<br>    for(var i = ar.length - 1; i &gt; 0; i--)<br>    {<br>        var j = randomInt(0, i - 1);<br>        <br>        var t = ar[i];<br>        ar[i] = ar[j];<br>        ar[j] = t;<br>    }<br>    <br>    return ar;<br>}</pre><pre>// Get a random int between min and max (both included)<br>function randomInt(min, max) <br>{<br>    return Math.floor(Math.random() * (max - min + 1) ) + min;<br>}</pre><h3>Coding challenge #51. Find the frequency of characters inside a string. Return the result as an array of objects. Each object has 2 fields: character and number of occurrences.</h3><p><a href="https://codeguppy.com/code.html?e8wHQuJmeYCDKml5k07d">https://codeguppy.com/code.html?e8wHQuJmeYCDKml5k07d</a></p><pre>var ar = getCharFrequency(&quot;Find the frequency of characters inside a string&quot;);<br>println(JSON.stringify(ar));</pre><pre>function getCharFrequency(text)<br>{<br>    var ar = [];</pre><pre>    for(var chr of text)<br>    {<br>        updateFrequency(ar, chr);<br>    }<br>    <br>    return ar;<br>}</pre><pre>function updateFrequency(ar, chr)<br>{<br>    for(var el of ar)<br>    {<br>        if (el.chr === chr)<br>        {<br>            el.count++;<br>        }<br>    }<br>    <br>    ar.push({ chr : chr, count : 1 });<br>}</pre><h3>Coding challenge #52. Calculate Fibonacci(500) with high precision (all decimals)</h3><p><a href="https://codeguppy.com/code.html?OD5GDYyCVo4wgTRCXzRU">https://codeguppy.com/code.html?OD5GDYyCVo4wgTRCXzRU</a></p><pre>println(fibonacci(500));</pre><pre>function fibonacci(n)<br>{<br>    if (n === 0)<br>        return &quot;0&quot;;</pre><pre>    if (n === 1)<br>        return &quot;1&quot;;</pre><pre>    var n1 = &quot;0&quot;;<br>    var n2 = &quot;1&quot;;</pre><pre>    for(var i = 2; i &lt;= n; i++)<br>    {<br>        var sum = add(n1, n2);</pre><pre>        n1 = n2;<br>        n2 = sum;<br>    }</pre><pre>    return n2;<br>}</pre><pre>function add(sNumber1, sNumber2)<br>{<br>    var maxSize = Math.max(sNumber1.length, sNumber2.length);<br>    <br>    var s1 = sNumber1.padStart(maxSize, &quot;0&quot;);<br>    var s2 = sNumber2.padStart(maxSize, &quot;0&quot;);</pre><pre>    var s = &quot;&quot;;<br>    var carry = 0;<br>    <br>    for(var i = maxSize - 1; i &gt;= 0; i--)<br>    {<br>        var digit1 = parseInt(s1[i]);<br>        var digit2 = parseInt(s2[i]);<br>        <br>        var sum = digit1 + digit2 + carry;<br>        var digitSum = sum % 10;<br>        carry = sum &gt;= 10 ? 1 : 0;</pre><pre>        s = digitSum.toString() + s;<br>    }<br>    <br>    if (carry &gt; 0)<br>        s = carry + s;<br>    <br>    return s;<br>}</pre><h3>Coding challenge #53. Calculate 70! with high precision (all decimals)</h3><p><a href="https://codeguppy.com/code.html?m4AfgJmCABGNEvKlUNtM">https://codeguppy.com/code.html?m4AfgJmCABGNEvKlUNtM</a></p><pre>println(factorial(70));</pre><pre>// Calculate factorial(n) ... using big number calculations<br>function factorial(n)<br>{<br>    var prod = &quot;1&quot;;<br>    <br>    for(var i = 2; i &lt;= n; i++)<br>    {<br>        prod = mult(prod, i.toString());<br>    }<br>    <br>    return prod;<br>}</pre><pre>// Multiplies sNumber1 * sNumber2<br>// Each number is provided as string<br>function mult(sNumber1, sNumber2)<br>{<br>    // Calculate partial results according to multiplication algorithm<br>    var partialResults = [];<br>    <br>    for(var i = sNumber2.length - 1; i &gt;= 0; i--)<br>    {<br>        var digit = parseInt(sNumber2[i]);<br>        <br>        var partialResult = multDigit(sNumber1, digit);<br>        partialResult += &quot;0&quot;.repeat(partialResults.length);<br>        <br>        partialResults.push(partialResult);<br>    }<br>    <br>    // Sum partial results to obtain the product<br>    var sum = &quot;&quot;;<br>    <br>    for(var r of partialResults)<br>    {<br>        sum = add(sum, r);<br>    }<br>    <br>    return sum;<br>}</pre><pre>// Multiplies number sNumber (as string) with a single digit number<br>function multDigit(sNumber, digit)<br>{<br>    var p = &quot;&quot;;<br>    var carry = 0;<br>    <br>    for(var i = sNumber.length - 1; i &gt;= 0; i--)<br>    {<br>        var numberDigit = parseInt(sNumber[i]);<br>        <br>        var prod = digit * numberDigit + carry;<br>        var prodDigit = prod % 10;<br>        carry = Math.floor(prod / 10);<br>        <br>        p = prodDigit.toString() + p;<br>    }<br>    <br>    if (carry &gt; 0)<br>        p = carry + p;<br>        <br>    return p;<br>}</pre><pre>function add(sNumber1, sNumber2)<br>{<br>    var maxSize = Math.max(sNumber1.length, sNumber2.length);<br>    <br>    var s1 = sNumber1.padStart(maxSize, &quot;0&quot;);<br>    var s2 = sNumber2.padStart(maxSize, &quot;0&quot;);</pre><pre>    var s = &quot;&quot;;<br>    var carry = 0;<br>    <br>    for(var i = maxSize - 1; i &gt;= 0; i--)<br>    {<br>        var digit1 = parseInt(s1[i]);<br>        var digit2 = parseInt(s2[i]);<br>        <br>        var sum = digit1 + digit2 + carry;<br>        var digitSum = sum % 10;<br>        carry = sum &gt;= 10 ? 1 : 0;</pre><pre>        s = digitSum.toString() + s;<br>    }<br>    <br>    if (carry &gt; 0)<br>        s = carry + s;<br>    <br>    return s;<br>}</pre><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77053af0bcee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codeguppy/coding-challenges-for-beginners-77053af0bcee">Coding challenges for beginners</a> was originally published in <a href="https://medium.com/codeguppy">codeguppy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>