Skip to content

Commit 54d1559

Browse files
committed
Grammar fixes and better flow in general
1 parent 146b2c9 commit 54d1559

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

content/posts/taking_a_joke_to_an_extreme.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ author: "DolphyWind"
1010
---
1111

1212
[Code Guessing](https://codeguessing.gay/index) is an online social deduction game. On each round there are two phases: the writing phase and the guessing phase. At the beginning of the
13-
writing phase, players are given a spec and expected to write code, that in some shape or form adheres to it. The writing phase, if no extension happens, lasts for a week, and is followed by the guessing phase.
14-
Before the guessing phase, all entries are shuffled and made public. During the guessing phase, each player guesses which piece of code is written by which player. At the end of the guessing phase, players earn 1 point for
13+
writing phase, players are given a specification and expected to write code, that in some shape or form adheres to it. The writing phase, if no extension happens, lasts for a week and after that, all entries are shuffled
14+
and made public. The guessing phase comes after the writing phase, in it each player guesses which entry is written by which player. At the end of a round, players earn 1 point for
1515
each player they guessed correctly and lose 1 point for each player that guessed them correctly. The winner of a round determines the next challenge.
1616

1717
There are all kinds of players: Some get too competitive and impersonate others, pay attention to every single detail of other submissions. Some don't care about the guessing phase and the point system and just focus on solving
1818
the challenge. Some try to write code that is aesthetically pleasing. Players are very well encouraged to show their creativity during the writing phase otherwise it would be a very boring ripoff of leetcode.
1919

2020
My code guessing submissions usually are impersonations (though I stopped doing that once I became less competitive), implementations of algorithms I wanted to try but previously had no reason to, silly jokes or occasional
21-
boring entries. Code guessing offers challenges of every kind. So there is always something to learn.
21+
boring entries. Code guessing offers challenges of every kind. So there is always something different to try.
2222

2323
There are many interesting stories to tell about code guessing. From the time there was a malicious JavaScript entry (the kind that steals your guesses and sends them to a remote server) to the time it turned out the owners
24-
of each code were present in the HTML code and no one noticed it for 58 rounds. On this blogpost I am going to talk about me taking an in-joke to an extreme.
24+
of each code were present in the HTML code of the page and no one noticed it for 58 rounds. On this blogpost I am going to talk about me taking an in-joke to an extreme.
2525

2626
## CG 53: Box Drawing
27-
It was a normal round. The challenge was, given a string of unicode characters, called "drawing", figuring out whether it follows the given criterias or not. I submitted a buggy python code, as the
27+
It was an average round. The challenge was, given a string of unicode characters, named "drawing", figuring out whether it follows the given criterias or not. I submitted a buggy python code, as the
2828
challenge was not that interesting for me. But during the guessing phase, an entry piqued my interest. It was a PICO-8 game cartridge, submitted by olus2000.
2929
[PICO-8](https://www.lexaloffle.com/pico-8.php) is a fantasy console by Lexaloffle. Here's the said entry:
3030
![olus2000's cg53 entry](/content/cg53_olus2000.png)
3131

3232
Yes that png file **is** the cartridge. Anyway, at the moment I thought I found the perfect person to impersonate next round...
3333

3434
## CG 54: 3D Rendering
35-
CG 54's challenge is still one of my favorites to this day, not just because it started it all but because I genuinely had fun coding it. The challenge was to implement 3D rendering. To impersonate olus2000, I decided to
36-
get a copy of PICO-8 and solve the challenge in it.
35+
CG 54's challenge is still one of my favorites to this day, not just because it started it all but because I genuinely had so much fun coding it. The challenge was to implement 3D rendering. To impersonate olus2000,
36+
I decided to get a copy of PICO-8 and solve the challenge in it.
3737

3838
I decided to have a simple 3D cube on the screen and have 3D camera controls. To implement it, I used the MVP matrix method. How it works is, to find the on-screen coordinate of a given vertex, we multiply it with three special
39-
$4\times4$ matrices, namely, Model ($M$), View ($V$) and Projection ($P$). "Well, aren't we in 3D? Why are those matrices $4\times 4$?" you might ask, while it is technically possible, turns out they can be represented as a
40-
matrix with the help of [Homogeneous Coordinates](https://en.wikipedia.org/wiki/Homogeneous_coordinates) and easily computed with GPU hardware.
39+
$4\times 4$ matrices, namely, Model ($M$), View ($V$) and Projection ($P$). "Well, aren't we in 3D? Why are those matrices $4\times 4$?" you might ask, while it is technically possible, turns out each can be represented as a
40+
single $4\times 4$ matrix with the help of [Homogeneous Coordinates](https://en.wikipedia.org/wiki/Homogeneous_coordinates) and easily processed with GPU hardware.
4141

4242
To put it simply, a point in euclidian 3D space with coordinates $(\frac{x}{w}, \frac{y}{w}, \frac{z}{w})$ can be represented as the homogeneous coordinate $(x, y, z, w)$. Usually we care about the case when $w=1$, when it is
4343
"normalized". In short, **model matrix** takes an object from its local coordinate space to world (global) space, the **view matrix** then transforms the scene such that the camera is in the origin, looking along the $z$-axis
@@ -46,13 +46,13 @@ To put it simply, a point in euclidian 3D space with coordinates $(\frac{x}{w},
4646
It turned out to be a bit heavy for the PICO-8 due to rasterization being compute-heavy, but it works well and looks cool in general.
4747
![3d renderer gif](/content/3drenderer.gif)
4848

49-
To my surprise, another player, named **kimapr**, has also thought of impersonating olus2000 and submitted a spinning cube in PICO-8.
49+
To my surprise, another player, **kimapr**, has also thought of impersonating olus2000 and submitted a spinning cube in PICO-8.
5050
![Kimapr CG54 gif](/content/kimapr_cg54.gif)
5151

5252
What makes it funnier is that olus2000 did not participate in this round, so we had two impersonators without the impersonatee being present. Impersonating her became an in-joke for a short while.
5353

5454
## CG 56: Reverse Engineer a Regex
55-
The challenge was, given an expression that recognizes a regular language, find a string that is recognized by the given expression. I made a simple recursive descent parser in C but I did not submit that directly.
55+
The challenge was, given an expression that recognizes a regular language, find a string that is recognized by it. I made a simple recursive descent parser in C but I did not submit that directly.
5656

5757
You see, I *really* liked that in-joke, so I wanted to continue it. In C, there is a feature called "macros". It is essentially a piece of code that gets substituted in the preprocessor pass, before the actual compilation happens.
5858
They are commonly used to get rid of magic numbers but they are much powerful than that. Macros are defined using the `#define` directive and since it is a simple text substitution, they can make your code appear like something
@@ -130,11 +130,11 @@ place and having my challenge be the next one.
130130
## More..?
131131
The C code above is already on another level. But I had an idea, what if **everything** was olus2000. So I did what any reasonable person would do, began creating a programming language named olus2000.
132132

133-
Because she loves concatenative languages, and especially [Forth](https://en.wikipedia.org/wiki/Forth_(programming_language)), I wanted my language to be a Forth-like language. This decision freed me from focusing on syntax
134-
and wasting my time on stupid decisions.
133+
Because she loves concatenative languages, and especially [Forth](https://en.wikipedia.org/wiki/Forth_(programming_language)), I wanted my language to be Forth-like. This decision freed me from focusing on the general structure
134+
of the syntax and wasting my time on stupid decisions.
135135

136136
For a Forth-like language, I needed instructions, better known as "words". Since the characters `0`, `o` and `O` look similar (up to an arbitrary measure of similarity), I wanted each posible
137-
alteration of last three characters of "olus2000" to correspond to a different instruction. This gives us a total of 27 words, which is enough.
137+
alteration of last three characters of "olus2000" to correspond to a different word. This gives us a total of 27 words, which is enough.
138138

139139
Numbers are represented in a special ternary-based encoding. First, to begin entering a number you need to switch to either "Number Mode" or "Negative Number Mode" by putting "0lus2000!" or "0lus2ooo!", respectively.
140140
(Looking back at it, the use of the exclamation mark at the end could've been avoided by employing other encoding schemes). When you are in either mode, each term of the form "olus2xyz" represents a group of trits `xyz`, where
@@ -151,7 +151,7 @@ be to do?
151151
Torth is a Forth-like esoteric programming language. It stands for "Ternary Forth". It exclusively allows ternary numbers in its syntax. Wait a second, what does this have to do with the language above again?
152152

153153
When I ended the paragraph with "It seems like I have only two options" I wasn't being honest. Because in the past, people have already solved a similar problem. When machine code was too hard to program by hand, people created
154-
assembly languages and assemblers. When it was too hard to deal with, they created modern programming languages. I'm sure you start to see where this is heading to. To remedy the core issue of olus2000, I created another language,
154+
assembly languages and assemblers. When that was too hard to deal with, they created modern programming languages. I'm sure you start to see where this is heading to. To remedy the core issue of olus2000, I created another language,
155155
Torth, that is purposefully kept as similar to olus2000 as possible, but at the same time, it makes sense and transpiles to olus2000. Here's a simple 99 bottles of beer on the wall program in Torth:
156156
```
157157
: WRITE_9 IF DROP "ERROR" ELSE DROP "9" THEN ;
@@ -237,7 +237,7 @@ I started off by implementing the challenge in Torth.
237237
(Print the look and say sequence indefinitely) 1 WHILE DROP STEP 1 THEN
238238
```
239239

240-
Then transpiled it to olus2000 and shaped it up and ended up with this:
240+
Then transpiled it to olus2000, gave it a nice shape and ended up with this:
241241
```
242242
"" olus2oOo OLUS2OOO "" "" olus2o0O olus2OoO "ERROR" olus2o0o olus2OoO "3" olus2oO0 olus2oo0 olus2oOo OLUS2ooo olus2o0O 0lus2000! olus200O olus2000! olus20O0 OLUS2OOO olus2o0o olus2OoO "2" olus2oO0 olus2oo0 olus2oOo OLUS2000 olus2o0O "" 0lus2000! olus200O olus2000! olus20O0 OLUS2ooo olus2o0o olus2OoO "1" olus2oO0 olus2oo0 olus2oOo
243243
OLUS200O 0lus2000! olus200O olus2000! olus20O0 OLUS2000 olus2oo0 olus2oOo OLUS20O0 "" olus2OOo olus2Ooo olus2Oo0 olus2OOo olus2Ooo olus2O00 olus2o0O olus2OoO 0lus2000! olus2000 olus2000! "" olus2ooO 0lus2000! olus200O olus2000! olus200o 0lus2000! olus2000 olus2000! olus2Oo0 olus2ooo olus2OoO "" olus2o0o olus2OoO olus2OOo 0lus2000! olus2000
@@ -268,9 +268,8 @@ Then transpiled it to olus2000 and shaped it up and ended up with this:
268268
"" olus2oOo OLUS2OOO "" "" olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 olus2000 " " olus2000 olus2000 Olus2000! olus2000 Olus2000! olus2000 Olus2000! Olus2000! olus2000 olus2000 olus2000 Olus2000! Olus2000! olus2000 olus2000!
269269
```
270270

271-
The name of the file is, of course, `olus2000.olus2000`. Actual code occupys the first few lines, the rest is a one giant comment. You can view the specification of [olus2000](https://esolangs.org/wiki/Olus2000) and [Torth](https://esolangs.org/wiki/Torth)
271+
The name of the file is, of course, `olus2000.olus2000`. Actual code occupies the first few lines, the rest is a one giant comment. You can view the specification of [olus2000](https://esolangs.org/wiki/Olus2000) and [Torth](https://esolangs.org/wiki/Torth)
272272
by clicking the respective links. And for the implementation of Torth, click [here](https://github.com/DolphyWind/esoteric/tree/master/torth).
273273

274274
I tried to make it look like someone is impersonating me by creating a new [esolangs.org](https://esolangs.org/) account and naming it "Dolphy" (my main account is named "DolphyWind"). It didn't work at all, even though I guessed
275-
six people correctly that round, four other people have guessed me and I ended the round with a total of $2$ points.
276-
275+
six people correctly that round, four other people have guessed me and I ended the round with a total of $2$ points. I don't really care about it, what I did satisfied me enough.

0 commit comments

Comments
 (0)