<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alek Westover</title>
    <description>The latest articles on DEV Community by Alek Westover (@awestover).</description>
    <link>https://dev.to/awestover</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F390089%2F003df020-e6cc-43d3-a295-62d5dd8b2724.png</url>
      <title>DEV Community: Alek Westover</title>
      <link>https://dev.to/awestover</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/awestover"/>
    <language>en</language>
    <item>
      <title>the worst of js: %</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Sat, 22 Aug 2020 03:45:28 +0000</pubDate>
      <link>https://dev.to/awestover/the-worst-of-js-19pd</link>
      <guid>https://dev.to/awestover/the-worst-of-js-19pd</guid>
      <description>&lt;p&gt;Javascript has a lot of weird features. &lt;/p&gt;

&lt;p&gt;Non-transitivity of equality is one pretty weird thing about js, see this meme:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc6x79wc877pzeskb1cr7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc6x79wc877pzeskb1cr7.jpg" alt="non-transitive"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But I have to say, for me the most infuriating thing about js is that it has a &lt;strong&gt;fake modulus operator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In literally every other language: python, C/C++, Julia, Java, whatever,  &lt;code&gt;x%y &amp;gt;= 0&lt;/code&gt; is always true. This is just &lt;strong&gt;so&lt;/strong&gt; useful, because for me the biggest use case of the modulus operator is cycling through elements of a list, in which case I really want &lt;/p&gt;

&lt;p&gt;&lt;code&gt;0 &amp;lt;= (x-1)%n &amp;lt; n&lt;/code&gt;&lt;br&gt;
&lt;code&gt;0 &amp;lt;= (x+1)%n &amp;lt; n&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I dunno I find it really annoying that js says things like &lt;code&gt;-1 % 5 = -1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's typical in math to denote the set &lt;code&gt;Z\nZ&lt;/code&gt; by &lt;code&gt;{0,1,\ldots, n-1}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Of course it's true that &lt;code&gt;-1 = n-1 \mod n&lt;/code&gt; but I want the  reasonable value, not the negative one!&lt;/p&gt;

&lt;p&gt;-Aelk&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[8]</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Sat, 15 Aug 2020 01:04:34 +0000</pubDate>
      <link>https://dev.to/awestover/enchantedforest-8-12kg</link>
      <guid>https://dev.to/awestover/enchantedforest-8-12kg</guid>
      <description>&lt;p&gt;Today we did&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mob dropping items&lt;/li&gt;
&lt;li&gt;made 2 fun new rooms!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p86C1DH5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/byuwroc7dfmsiq7719hg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p86C1DH5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/byuwroc7dfmsiq7719hg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;something interesting we found out, is that we have two different fields in our Entity class, one called type and one called species. Interesetingly enough, item.type="item" whereas item.species=itemType, e.g. "gem".&lt;/p&gt;

&lt;p&gt;wow, great names !Alek.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[7]</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Mon, 10 Aug 2020 01:30:46 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-7-5dn5</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-7-5dn5</guid>
      <description>&lt;p&gt;today, we wrote 3 lines of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;logout&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;del&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"index"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;ok not really, &lt;br&gt;
&lt;a class="comment-mentioned-user" href="https://dev.to/kaisucode"&gt;@kaisucode&lt;/a&gt;
 actually did some stuff.&lt;/p&gt;

&lt;p&gt;I'll probably do some stuff and maybe update this blog post.&lt;/p&gt;

&lt;p&gt;But we did find a lot of bugs. So that's something!&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[5]</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Sat, 18 Jul 2020 03:13:45 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-4-c2k</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-4-c2k</guid>
      <description>&lt;p&gt;&lt;strong&gt;SAVING SYSTEM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today we wrote a saving system for our game. &lt;br&gt;
It's really starting to feel like a real game now!&lt;br&gt;
Once we add real quests, and you can save your quests and level up and stuff it's going to be super epic!&lt;/p&gt;

&lt;p&gt;In writing the saving system we had some adventures.&lt;/p&gt;

&lt;p&gt;Most notably our .git file got corrupted somehow, resulting in massive panic, and &lt;code&gt;cp -r&lt;/code&gt;ing and &lt;code&gt;scp -r&lt;/code&gt;ing. In the end we found a pro solution though: &lt;code&gt;rm -rf .git&lt;/code&gt;, and then &lt;code&gt;cp -r .git&lt;/code&gt; from a different clone of the project. As they say "high quality".&lt;/p&gt;

&lt;p&gt;Anyways, as expressed I'm super hyped about the checkpoints saving your progress.&lt;/p&gt;

&lt;p&gt;For the curious people out there here's what our &lt;code&gt;createAccount&lt;/code&gt; function looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="n"&gt;mongo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert_one&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="s"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"pwd_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pwd_hash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s"&gt;"checkpoint_room"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"llamaPlains"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s"&gt;"health"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;"coins"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;"mana"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s"&gt;"completedQuests"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt; 
        &lt;span class="s"&gt;"level"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s"&gt;"xp"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s"&gt;"items"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt; 
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Also, another really nice thing that we did is we kind of messed around with the stats and stuff. Like we made the mana generation rate more reasonable.&lt;/p&gt;

&lt;p&gt;Also, &lt;a class="comment-mentioned-user" href="https://dev.to/kaisucode"&gt;@kaisucode&lt;/a&gt;
 made an absolutely epic health bar, that is way better than hearts imo. &lt;/p&gt;

&lt;p&gt;Also a little comic strip for your enjoyment:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Alek: yo how do you update something in MongoDB?&lt;br&gt;
Kevin: let me look it up &lt;br&gt;
Alek: wait no I can just drop the database&lt;br&gt;
Alek: how do you insert something into a database?&lt;br&gt;
&lt;em&gt;presses up arrow 100 times&lt;/em&gt;&lt;br&gt;
Alek: found it!&lt;br&gt;
Alek: Aw crap we're hashing the pwds&lt;br&gt;
Alek: loolllll &lt;em&gt;creates account with same pwd, copies hash&lt;/em&gt;&lt;br&gt;
Alek: drops database again&lt;br&gt;
Alek: wait should I drop the database again? ok&lt;br&gt;
Alek: hmmm. &lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: Why can't I press tab to autocomplete filenames when I'm &lt;code&gt;scp&lt;/code&gt;ing. oh wait. lolll.&lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: &lt;code&gt;db.dropDatabase()&lt;/code&gt;&lt;br&gt;
Alek: ayy it works! ok we're never allowed to modify the database btw.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Next time we're gonna be making the game more legit. In particular, we will be&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;adding the first boss&lt;/li&gt;
&lt;li&gt;adding some more rooms &lt;/li&gt;
&lt;li&gt;making the quests real&lt;/li&gt;
&lt;li&gt;making the npcs real&lt;/li&gt;
&lt;li&gt;making the merchants real&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's going to feel like a real game!&lt;br&gt;
Get ready!!!!!&lt;/p&gt;

&lt;p&gt;Finally, I would like to close with an inspirational thought.&lt;br&gt;
When testing the game saving stuff, we made it save health first. In order to get the test to pass we had to lose health, and then reload the page and have the low health. Getting to a checkpoint took a while though. This prompted the following brilliant realization: if the player died, it respawned close to the checkpoint. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You would kill yourself to get to the checkpoint faster?&lt;br&gt;
Some things are worth dying for.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;pretty much.&lt;/p&gt;

&lt;p&gt;Ah, what an &lt;em&gt;enchanting forest&lt;/em&gt;. &lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[3]</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Tue, 30 Jun 2020 23:45:11 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-3-1793</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-3-1793</guid>
      <description>&lt;p&gt;Today we did some more work on the enchanted forest&lt;/p&gt;

&lt;p&gt;Pretty much are just setting up the database stuff.&lt;/p&gt;

&lt;p&gt;So we made a little login / create account page, &lt;br&gt;
and it sends a post request to python &lt;br&gt;
hashes your password checks if there are users with the same username, etc etc. &lt;/p&gt;

&lt;p&gt;And eventually you get redirected to the game site with all your user data&lt;/p&gt;

&lt;p&gt;Then our idea is, in the game there will be these things called checkpoints.&lt;/p&gt;

&lt;p&gt;They are physical locations that you can go to &lt;/p&gt;

&lt;p&gt;And save your game state.&lt;/p&gt;

&lt;p&gt;So yeah, there you go. &lt;/p&gt;

&lt;p&gt;When working with a new library I find it's really helpful to use &lt;code&gt;ipdb&lt;/code&gt;, for me its a nice complement to reading the docs, cuz I can play around with the objects and get a feel for them. &lt;/p&gt;

&lt;p&gt;Unfortunately I had some problems with &lt;code&gt;ipdb&lt;/code&gt;, like cancelling stuff after it got a bunch of requests. ¯_(ツ)_/¯ . not really sure what that was about &lt;a class="comment-mentioned-user" href="https://dev.to/kaisucode"&gt;@kaisucode&lt;/a&gt;
's server&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[2]</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Wed, 24 Jun 2020 02:18:20 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-2-2j23</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-2-2j23</guid>
      <description>&lt;p&gt;Today we added Vue to our project!&lt;/p&gt;

&lt;p&gt;We felt like this was going to be better than integrating something like React or Angular with Flask. &lt;/p&gt;

&lt;p&gt;Vue is pretty cool. &lt;/p&gt;

&lt;p&gt;Basically what you do is something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/vue"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;style &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt; &lt;span class="na"&gt;media=&lt;/span&gt;&lt;span class="s"&gt;"screen"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nf"&gt;#blah2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;


&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"hmmm"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"i in asdf"&lt;/span&gt; &lt;span class="na"&gt;:id=&lt;/span&gt;&lt;span class="s"&gt;"'blah'+i"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;i&amp;gt;&lt;/span&gt;
      blah {{ i }}
      &lt;span class="nt"&gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"item in items"&lt;/span&gt; &lt;span class="na"&gt;:key=&lt;/span&gt;&lt;span class="s"&gt;"item.message"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;b&amp;gt;&lt;/span&gt;
    {{ item.message }}
    &lt;span class="nt"&gt;&amp;lt;/b&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;myObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;el&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello Vue!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isComplete&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello Vue!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isComplete&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello Vue!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello Vue!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello Vue!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bar&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;blah&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;el&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#hmmm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;asdf&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Pretty cool! (to run it, just do &lt;code&gt;python3 -m http.sever&lt;/code&gt;, we're using CDNs so no installs necessary)&lt;/p&gt;

&lt;p&gt;One thing that we ran into while doing this was&lt;br&gt;
how to integrate Vue with Flask.&lt;br&gt;
In particular, jinja template stuff collides with Vue (both use "mustaches" i.e. &lt;code&gt;{{ }}&lt;/code&gt; for stuff). &lt;/p&gt;

&lt;p&gt;So the way we fixed this, was we just loaded the js thing as a static page. Vue is a tool for making static pages, so this works fine!&lt;br&gt;
Here's the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send_static_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'index.html'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And, something that I found kind of surprising is that we were still able to do jquery requests even though the page is static!&lt;/p&gt;

&lt;p&gt;So yay! probably next time we can integrate mongodb with our game.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;copolla&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[0]</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Fri, 12 Jun 2020 07:41:42 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-init-50bn</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-init-50bn</guid>
      <description>&lt;p&gt;Hey!&lt;br&gt;
Me and Kevin are making a cool game called "The Enchanted Forest"&lt;/p&gt;

&lt;p&gt;It's a single-player RPG.&lt;br&gt;
We're writing pretty much the entire game from scratch, using the really minimal p5.js graphics library.&lt;/p&gt;

&lt;p&gt;So far my favorite features are the weather particle effects (especially lightning) and the boar path finding algorithm!&lt;br&gt;
The collision detection for the player staying on blocks is pretty nice too.&lt;br&gt;
I also really like how we are able to import our maps directly from the Tiled map editor.&lt;/p&gt;

&lt;p&gt;In addition to coding this game, we're also going to be writing the plot for the RPG!&lt;/p&gt;

&lt;p&gt;The project is a WIP. Our code so far can be found &lt;a href="https://github.com/awestover/enchantedForest"&gt;on github&lt;/a&gt; and we have a static version of the game up &lt;a href="http://enchantedforest.surge.sh/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This blog post series will be about our adventures in making this adventure.&lt;br&gt;
It's going to be a fun time!&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>digital yearbook</title>
      <dc:creator>Alek Westover</dc:creator>
      <pubDate>Wed, 20 May 2020 06:31:45 +0000</pubDate>
      <link>https://dev.to/awestover/digital-yearbook-26ej</link>
      <guid>https://dev.to/awestover/digital-yearbook-26ej</guid>
      <description>&lt;h1&gt;
  
  
  Project
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/alekfourierwestover/yearbook2020"&gt;code for the project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Me, and a bunch of my highschool friends (see the list of contributers on GitHub) made a vritual  yearbook!&lt;/p&gt;

&lt;h1&gt;
  
  
  features
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;register for an account (we have some cool "security stuff" like sending verification codes via email, and hashing passwords, and not letting people do script injections) &lt;/li&gt;
&lt;li&gt;modify account (password reset, update photo or quote)&lt;/li&gt;
&lt;li&gt;see where people are going to go to college&lt;/li&gt;
&lt;li&gt;see the main yearbook, which displays everyone's pictures and quotes&lt;/li&gt;
&lt;li&gt;send people messages&lt;/li&gt;
&lt;li&gt;view your messages&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  tools
&lt;/h1&gt;

&lt;p&gt;We used python (Flask) for the backend. Basically we had to create accounts for users with name, email, college they're going to go to, senior quote, and a yearbook picture. &lt;br&gt;
We used bootstrap to help out with the front-end web development. &lt;/p&gt;

&lt;p&gt;We set up our project on a little digital ocean droplet, and actually got our school to use it!&lt;/p&gt;

&lt;h1&gt;
  
  
  cool stuff
&lt;/h1&gt;

&lt;p&gt;I learned a lot of really cool stuff from working on this project. Here are some of the highlights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's really easy to set up a digital ocean server. Except you have to have a credit card even though it's going to be free. (Dang.)&lt;/li&gt;
&lt;li&gt;Flask's &lt;code&gt;sessions&lt;/code&gt; are super cool! My understanding of them is that you can cache user data on their computer. So like you can keep someone logged in even if they visit separate pages. &lt;/li&gt;
&lt;li&gt;Flex-boxes are pretty awesome. &lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
