<?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[Stories by Renk on Medium]]></title>
        <description><![CDATA[Stories by Renk on Medium]]></description>
        <link>https://medium.com/@renk?source=rss-49f011dee382------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uts9tzpIwFXGOUZ-kcNrhw.jpeg</url>
            <title>Stories by Renk on Medium</title>
            <link>https://medium.com/@renk?source=rss-49f011dee382------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:20:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@renk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating a simple dice with random numbers in Javascript]]></title>
            <link>https://medium.com/@renk/creating-a-simple-dice-with-random-numbers-in-javascript-b56c88ae4ba7?source=rss-49f011dee382------2</link>
            <guid isPermaLink="false">https://medium.com/p/b56c88ae4ba7</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Renk]]></dc:creator>
            <pubDate>Tue, 12 Sep 2017 14:14:26 GMT</pubDate>
            <atom:updated>2017-09-12T14:14:26.566Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey all !</p><p>This is my first blog post, my goal is to keep a track record of what i am learning daily / weekly while on my Javascript journey.</p><p>I have heard that magical things happen when you start writing what you learn, so here we go.</p><p>The <strong>Math.floor()</strong> function returns the largest integer less than or equal to a given number.</p><p>The <strong>Math.random()</strong> function returns a floating-point, pseudo-random number in the range [0, 1); that is, from 0 (inclusive) up to but not including 1 (exclusive), which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.</p><ul><li>We are trying the console to show us a random number (Integer) between 1 and 6.</li><li>In Javascript Code runs inside out, Math.random() is processed first (or evaluated), because it is inside the inner parenthesis.</li></ul><pre>Math.floor( Math.random() * 6 )</pre><p>Each time this code runs you will get a random Integer (Between 0 -5).</p><p>Now we need a number between 1 and 6 so we will add a (+1) to get our random dice.</p><p>Next let’s just add an alert box to display our result.</p><pre>var diceRoll = Math.floor( Math.random() * 6 ) +1;<br>alert(&#39;You rolled a &#39; + diceRoll);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*RU5vSt36ihR7Ry2s0bIQvQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b56c88ae4ba7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>