"Programming" Posts
-
Some Notable Reversible Logic Gates
Logical connectives are the building blocks of logic; and logic gates, derived from logical connectives, are the building blocks of computers. Anyone familiar with programming is likely familiar with most of the basic logic gates:
AND,OR, andNOT. Maybe they’ve heard ofNANDorXOR, or, if they’re more logically-inclined, maybe they’ve heard ofIMPLY. They’re well-known quantities; each logic gate with 2 or fewer arguments even has its own wikipedia page. But what aren’t really documented quite as exhaustively are the “reversible” logic gates. -
Order-Dependent Triangulations
I’ve spent a lot of time working on procedural asset generation code over the last ten years or so, and procedural mesh generation has been a large focus of that work. I researched and reinvented many algorithms over the course of this time, but one of the most valuable concepts I’ve stumbled into is not an algorithm at all, but rather the realization that the order of the elements in your data structures can matter just as much as what’s actually in them. I think many people are aware that this is true for things like binary searches, but I’ve found that it’s a useful tool in an even wider range of applications. Today, I’ll be talking about the applications of this concept to generating triangulations.
-
Reverse Engineering Tears of the Kingdom's Object Rotation System
Tears of the Kingdom, the long awaited followup to Breath of the Wild, was lauded at it release for its intuitive and powerful construction system. I played Tears of the Kingdom, and while I did enjoy playing around with the build system, I couldn’t help feeling like something was strange. The problem that was on my mind the whole time was the fact that you could seemingly rotate objects in the build system by 45 degrees around 2 different axes in any order you chose, but you would only ever end up reaching a small number of possible orientations. Mathematically, this actually shouldn’t be possible.
-
Aiming Projectiles
Shooting is a very common mechanic in video games; however, unless your projectiles are entirely hitscan, meaning that the player instantly hits whatever they are aiming at when pulling the trigger, aiming projectiles is unexpectedly non-trivial from a mathematical perspective. For players, this is part of the fun, and their aim is more driven by physics intuition and muscle memory. But for AI-controlled characters, this is a real problem, and there are a number of factors that can potentially make it even more complicated. In this post, I will be discussing the solutions for the most common category of projectile aiming problems in video games.
-
Reversible Programming Primer: Symmetry-Breaking (Part 2)
In part 1 of the discussion of symmetry-breaking, we discussed what symmetry-breaking was, the motivating problems that necessitated the introduction of symmetry-breaking, and many of the basic primitives that can be used to build symmetry-breaking code. However, we were left with an unwieldy tool that broke all of the patterns that we had previously established. In this sixth post on reversible programming, we will discuss the problems that symmetry-breaking has left us with, a more precise model of how reversible functions can be structured, and a substitute for undo symmetry that can salvage our existing patterns for use in symmetry-breaking code.
-
Reversible Programming Primer: Symmetry-Breaking (Part 1)
Reversible programming languages can run code “in reverse”, but what does that mean? You might have an intuitive idea that “running code in reverse” should be equivalent to “running the inverse of the code”, and this is a good default assumption. However, when we look at some of the practical concerns of real reversible programs, we discover that it’s not always possible for this to be the case, and that, even when it’s possible, it’s not always desirable. In this fifth post on reversible programming, we will be examining the situations where our intuition regarding reverse execution fails.
-
Reversible Programming Primer: Backtracking Control Flow
So far in this series, reversible computation has introduced a lot of restrictions on how you can write code. However, reversible programs are also capable of some very unique functionality that is simply impossible without imposing the constraint of reversibility. In this fourth post on reversible programming, we will finally be justifying the name “reversible computing” by exploring how reversible programming languages can allow programmers to “run code in reverse” and all of the unique things this feature allows you to accomplish.
-
Reversible Programming Primer: Basic Control Flow
In reversible programming languages, many of the fundamental concepts of control flow from traditional programming languages break down. All familiar forms of conditionals and looping allow for programs to effectively erase the history of their own operation, making it impossible to tell whether or not particular branches were taken to reach a particular result. In this third post on reversible programming, I will be going over the reversible counterparts of these control structures and showing how they can be used to implement some basic, familiar programming patterns.
-
Pair Place
I thought that it might be a good challenge to try to introduce and keep up-to-date a daily puzzle on the site for as long as I can manage. So, starting today, I will be uploading a daily puzzle for a puzzle system I’ve been investigating, which has some similarities to sudoku.
-
Reversible Programming Primer: Assignment
Assignment as it is generally understood cannot exist in a reversible programming language. However, assignment as a form of initialization is essential for writing computer programs in general. And so, reversible programming languages will need to introduce new concepts of initialization to serve the role of assignment operators, which could be called “reversible assignment” operators. In this second post on reversible programming, I will be going over some of the most useful types of reversible assignment operators that can be defined.
- •
- 1
- 2