GCD and the magic of subtraction

The greatest common divisor is something I learned in school but it was one of those “so what?” subjects. But recently I revisited it and it is very interesting. Why is gcd cool? Every number, can be expressed as the product of prime numbers. This product for every number is unique; sort of like saying,Continue reading “GCD and the magic of subtraction”

Sitting with: Lomuto’s Partitioning Scheme

I snagged this pseudocode from Wikipedia and I am planning on going through it step by step to understand what is going on. I recommend having this snippet handy for reference. Here is my breakdown. The Idea The Lomuto partitioning scheme is used to partition an array into 2 parts, smaller and bigger than theContinue reading “Sitting with: Lomuto’s Partitioning Scheme”

How to ethically kill a sentient AI?

The short answer: Always save their storage units (and also make sure they are enlightened) And by that I mean the memory, the hard drive, the floppy et cetera. Sit with me and let me show you what I mean. When we unlock the technology to a sentient machine, believe me you that we willContinue reading “How to ethically kill a sentient AI?”

If you cheat on rock-paper-scissors, you should look within: a minimal approach

Here is the game: http://www.luck.consulting Here is the code: https://github.com/plumSemPy/rock-paper-scissors There comes a time in everyone’s life, where tough decisions should be made — who gets the last slice? who takes off the shirt first? In impasses like this, instead of spiraling down a futile vortex of reasoning to turn the tides in my favor,Continue reading “If you cheat on rock-paper-scissors, you should look within: a minimal approach”

Tetris on Google Sheets

I made a game of Tetris on Google Sheets. Where can I see it? HereĀ is a video. Where to play it? UPDATE: I was and then confirmed that the app no longer responds correctly to arrow inputs. This might not work. I might fix it one day.But if anyone feels adventurous, I welcome and appreciateContinue reading “Tetris on Google Sheets”