<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Programming on repetitions</title>
    <link>https://repetitions.de/tags/programming/</link>
    <description>Recent content in Programming on repetitions</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>hi (hiu)</managingEditor>
    <webMaster>hui (hu)</webMaster>
    <copyright>All content by [lou.] licensed as &lt;a href=&#34;https://creativecommons.org/licenses/by-sa/4.0/&#34; target=&#34;_blank&#34; style=&#34;text-decoration:none&#34;&gt;CC-BY-SA 4.0&lt;/a&gt; unless otherwise specified.</copyright>
    <lastBuildDate>Thu, 01 Feb 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://repetitions.de/tags/programming/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Pong Wars | Compiling C to WASM</title>
      <link>https://repetitions.de/posts/pong-wars/</link>
      <pubDate>Thu, 01 Feb 2024 00:00:00 +0000</pubDate>
      <author>hi (hji)</author>
      <guid>https://repetitions.de/posts/pong-wars/</guid>
      <description>&lt;p&gt;Look at my procrastination project! @vnglst&amp;rsquo;s &lt;a href=&#34;https://hachyderm.io/@vnglst/111828811496422610&#34;&gt;Mastodon
Post&lt;/a&gt; and &lt;a href=&#34;https://github.com/vnglst/pong-wars&#34;&gt;Javascript
Version&lt;/a&gt; inspired me to try my hand at
implementing Pong Wars in C using &lt;a href=&#34;https://raylib.com&#34;&gt;raylib&lt;/a&gt;. I also wanted to
test compiling C/Raylib to HTML5. With a little help from raylibs
&lt;a href=&#34;https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)&#34;&gt;documentation&lt;/a&gt;,
it worked so well I don&amp;rsquo;t even know what to write about it here, you can see the
result below.&lt;/p&gt;
&lt;p&gt;Press &lt;code&gt;R&lt;/code&gt; to reset and &lt;code&gt;P&lt;/code&gt; to Pause.&lt;/p&gt;
&lt;style&gt;
canvas {
    padding-left: 0;
    padding-right: 0;
    margin-left: auto;
    margin-right: auto;
    display: block;
	border: 2px solid #eeeeef;
	width: 100%;
	max-width: 600px;
}
&lt;/style&gt;
&lt;p&gt;&lt;canvas class=emscripten id=canvas oncontextmenu=event.preventDefault()
tabindex=-1&gt;&lt;/canvas&gt;&lt;/p&gt;</description>
      <content>&lt;p&gt;Look at my procrastination project! @vnglst&amp;rsquo;s &lt;a href=&#34;https://hachyderm.io/@vnglst/111828811496422610&#34;&gt;Mastodon
Post&lt;/a&gt; and &lt;a href=&#34;https://github.com/vnglst/pong-wars&#34;&gt;Javascript
Version&lt;/a&gt; inspired me to try my hand at
implementing Pong Wars in C using &lt;a href=&#34;https://raylib.com&#34;&gt;raylib&lt;/a&gt;. I also wanted to
test compiling C/Raylib to HTML5. With a little help from raylibs
&lt;a href=&#34;https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)&#34;&gt;documentation&lt;/a&gt;,
it worked so well I don&amp;rsquo;t even know what to write about it here, you can see the
result below.&lt;/p&gt;
&lt;p&gt;Press &lt;code&gt;R&lt;/code&gt; to reset and &lt;code&gt;P&lt;/code&gt; to Pause.&lt;/p&gt;
&lt;style&gt;
canvas {
    padding-left: 0;
    padding-right: 0;
    margin-left: auto;
    margin-right: auto;
    display: block;
	border: 2px solid #eeeeef;
	width: 100%;
	max-width: 600px;
}
&lt;/style&gt;
&lt;p&gt;&lt;canvas class=emscripten id=canvas oncontextmenu=event.preventDefault()
tabindex=-1&gt;&lt;/canvas&gt;&lt;/p&gt;
&lt;p id=&#34;output&#34; /&gt;
&lt;script&gt;
    var Module = {
        print: (function() {
            var element = document.getElementById(&#39;output&#39;);
            if (element) element.value = &#39;&#39;; // clear browser cache
            return function(text) {
                if (arguments.length &gt; 1) text = Array.prototype.slice.call(arguments).join(&#39; &#39;);
                console.log(text);
                if (element) {
                  element.value += text + &#34;\n&#34;;
                  element.scrollTop = element.scrollHeight; // focus on bottom
                }
            };
        })(),
        canvas: (function() {
            var canvas = document.getElementById(&#39;canvas&#39;);
            return canvas;
        })()
    };
&lt;/script&gt;
&lt;script async type=&#34;text/javascript&#34; src=&#34;pong.js&#34;&gt;&lt;/script&gt;
&lt;p&gt;Code is available on &lt;a href=&#34;https://git.repetitions.de/pong-wars/log.html&#34;&gt;git.repetitions.de&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
  </channel>
</rss>
