Coding, collabs, Community Projects, Contributing, Crafty, Group, JavaScript, Milestones, Notes on everyday life, Simon makes gamez, Simon's Own Code

New Collab

Simon’s got a new collab going and possibly what is a beginning of a real friendship with a peer from Bangalore, India. They have already finished several wonderful projects together that have been merged on The Coding Train GitHub:

A screenshot of the Bombsweeper game
A screenshot from The Coding Train website listing community contributions. Simon and Abhay’s contributions are at the end of the list.
Simon has developed a random project picker that helps him and his friend and collaborator Abhay to choose what project they’re going to tackle next
art, Coding, Coding Everywhere, Community Projects, Contributing, Crafty, JavaScript, Math and Computer Science Everywhere, Murderous Maths, RaspberryPi, Simon's Own Code

Merry Xmas! Simon’s Xmas Card.

Increasing multiples of the Golden Ratio and taking the fractional part. Essentially, this is a random number card. Merry Xmas! Code: https://editor.p5js.org/simontiger/sketches/rSkU6oMNr

You can turn the card around by using the mouse if you open it in p5.js:

Simon made this card during Daniel Shiffman’s Processing Telethon last night, joining other programmers and supporting the Processing Foundation.

We also had some great nerdy fun watching Matt Parker’s new Xmas video about turning your tree into a hologram and applying math to create vfx art with xmas lights! Might try this next year!

Coding, Crafty, Dutch, JavaScript, Notes on everyday life, Simon teaching, Together with sis

St.Nicolas Obsessions

Tomorrow we are celebrating Sinterklaas, or St.Nicolas’ birthday. It’s the climax of the traditional Dutch gift-giving season embracing the last two weeks of November and the first week of December. During this period, kids sing century-old songs (lately replaced by their less racist versions) and get to place their shoes (or in our case, roller-skates) in front of the fireplace every few nights before bedtime to find them filled with small presents and seasonal goodies (like spicy ginger cookies and special chocolates) in the morning. The legend goes that while the children are asleep, St.Nicolas and his gang of sooty-faced pages drop by to slide the gifts in their shoes, but Simon and Neva are old enough to have realized it’s just me. The magic isn’t gone though. On the contrary, I don’t think I’ve ever seen them this preoccupied with St.Nocolas before and it’s all thanks to the so-called Sinterklaasjournaal, a daily St.Nicolas news show on Dutch tv packed with irony and allusions to current events. Neva has even programmed her first game ever, inspired by the classic games featured on the Sinterklaasjournaal website. She came up with the algorithms all on her own, and Simon helped her a little with writing the actual code. She didn’t want to use any arrays and classes yet, so she wrote spaghetti code instead 🙂

Play Neva’s game here. Eat all the spicy cookies before your time runs out and you win! See the code here.

Dad playing the game
Coding, Contributing, Geometry Joys, JavaScript, Math and Computer Science Everywhere, Milestones, Murderous Maths, Notes on everyday life, Simon teaching, Simon's Own Code

Simon’s BĂ©zier Editor in p5.js

One more project inspired by Sebastian Lague: a BĂ©zier Editor. Simon used Sebastian Lague’s algorithms to recreate the editor in p5.JS.

Editor: https://editor.p5js.org/simontiger/present/r4gW2mgIo

Code: https://editor.p5js.org/simontiger/sketches/r4gW2mgIo

I added the export button! It’s under the “export” folder. Clicking it will show you a serialized version of your path. It’s just in JSON format, so you can read/use it quite easily.

The BĂ©zier curve is made out of multiple “segments”, also called “cubic curves”. It turns out that if you write down the equation for such cubic curve, you actually get a cubic polynomial. I derived these equations:

I started with the equation of a linear curve, worked up to a quadratic curve and the to a cubic curve. Maybe there’s a mistake in these, because there’re a lot of steps and I was a bit inconsistent. If you watch my previous video about BĂ©zier curves, you’ll see how a cubic curve is derived.

Yes, Simon had already made another video about BĂ©zier curves, see our earlier blog post. It’s funny how back then I had no idea what BĂ©zier curves were, and by now, after I have started studying motion design, bĂ©ziers have become my daily thing. And I’m learning so much from Simon! This is the power of the homeschooling lifestyle!

Coding, Computer Science, Crafty, Electronics, Engineering, Experiments, JavaScript, Logic, Math and Computer Science Everywhere, Milestones, Murderous Maths, Notes on everyday life, Simon teaching, Simon's Own Code, Simon's sketch book, Together with sis

Logic Gates. Simon has programmed his own Digital Logic Simulator.

Simon has been greatly inspired by Sebastian Lague’s new video on how computers work, it seems to have sparked a whole new wave of enthusiasm about logic gates and logic simulations. Simon has ended up recreating Sebastian Lague’s digital logic simulation, making his own digital circuits editor in p5.js: https://editor.p5js.org/simontiger/present/bqKM00Ejq Simon’s code: https://editor.p5js.org/simontiger/sketches/bqKM00Ejq

I decided to ditch the parsing idea and instead just adapt the code to what I already have. See the result in my Digital Logic Simulation Part 2 video:

I filmed Simon while he was coming up with solutions. He also used some advice from fellow programmers on Twitter:

XOR gate
Simon on the evening the debugged code worked for the first time (November 19)
Simon’s sketch of logic gates
Building logic gates with dominos: an AND gate
And it worked!
chemistry, Coding, Electricity, JavaScript, Notes on everyday life, Simon makes gamez, Simon's Own Code

Test Tube Games

Simon has had hours of fun with Test Tube Games, a science games portal featuring interactive explanations and dynamic puzzles on Chemistry and Physics. He has created two simulations based on the games he played. The first one is an electromagnetic field simulator:

This project was inspired by the game/explanation “The Electric Shocktopus” on TestTubeGames.com

Code: https://editor.p5js.org/simontiger/sketches/nIwYhXLdj

Press “1” for positive charge, “2” for negative charge, “R” to run. Press “3” and “4” to create magnetic fields/ press “0” to erase them. Press Shift+1 and Shift+2 for “lazy particles”.

Simon’s other TestTubeGames-inspired project is called “Floating Astronaut”:

This project was inspired by the game/explanation “Why Do Astronauts Float?

Code: https://editor.p5js.org/simontiger/sketches/obGZyfVze

Haven’t figured out a way to put the astronaut inside the rocket yet though.

One more science game is definitely a hit at our home, “Bond Breaker” (on chemical bonds). At a certain point, it gets so hard you start feeling like a secret agent on a mission.

Simon playing “Bond Breaker”
Coding, Good Reads, history, JavaScript, Milestones, Notes on everyday life, Set the beautiful mind free, Simon teaching, Simon's Own Code, Social Studies, Thoughts about the world

Simon’s remix of one of Nicky Case’s playable essays

If you’re interested in why #covid-19 tracing apps are important and the most privacy-friendly way to implement them, please read this interactive essay by Nicky Case and play with the colorful simulations of all our possible futures. For Simon, this has been the entrance into the Nicky Case @ncasenmare universe (first recommended by 3Blue1Brown). Simon has been gulping down the playable essays on human networks and the spread of complex ideas, self-synchronization in nature, the shape of society and several other burning themes (like coming out and anxiety) and watching Nicky Case’s talks, like this one. Nicky is a self-made indie artist, programmer and writer making very edgy, very 21st century multimedia products that are both profound in content and have an engaging/interactive interface. It’s as if reading an informative piece is turned into a game. And that’s exactly what Nicky stands for: learning through play and messing about. Maybe that’s why Simon has embraced his works so eagerly, Nicky has proven to be one of those perfect matches for our self-directed learning style.

Simon has made a remix of Nicky’s Evolution of Trust, an iterated prisoner’s dilemma: https://editor.p5js.org/simontiger/present/oOurTdGWT

Simon’s code: https://editor.p5js.org/simontiger/sketches/oOurTdGWT

Coding, Geometry Joys, Group, JavaScript, Milestones, Murderous Maths, Simon's sketch book

Dissecting Polygons

Every polygon can be triangulated into exactly n-2 triangles. So you’ve got the triangulation theorem and the totally opposite theorem in the math universe, Girard’s theorem (the formula for the era of a spherical triangle). I’m going to attempt to put these two together to prove Euler’s polyhedral formula (also known as Euler’s characteristic) V – E + F = 2.

A week later Simon and a friend of his from Germany worked together for several hours, writing a program to cut polygons. It’s still unfinished but is already fun to play with: https://editor.p5js.org/simontiger/sketches/YxNUp5rdJ

Coding, Community Projects, Contributing, JavaScript, Math and Computer Science Everywhere, Milestones, Murderous Maths, Notes on everyday life, Simon makes gamez, Simon's Own Code, Together with sis

Spring Challenge 2020 PacMan in p5.js

Simon has recreated the CodingGame.com’s Spring Challenge 2020 PacMan game in p5.js to be able to work on the AI versions after the spring challenge has finished.

Link to Simon’s PacMan Game version featured in the video (playable for two players on the same keyboard): https://editor.p5js.org/simontiger/present/k9PDqMeew

Simon’s code for this version: https://editor.p5js.org/simontiger/sketches/k9PDqMeew

The PacMan is built on top of a Maze Generator, here’s an example of one of Simon’s maze generators and solvers: https://editor.p5js.org/simontiger/sketches/vj75cHYkf

Simon had been taking part in the Spring Challenge 2020 for several days and reached bronze level.

However he quickly realized that the 11 days of the competition felt too cramped for him to try various algorithms and still be able to work on his other projects. So what he did was recreate the whole PacMan game from scratch in p5.js, so that he has an “archived version” of the challenge and can play with new AI versions later.