From 4e8eb40bd20284d856ddf4108b767c5c513afedd Mon Sep 17 00:00:00 2001 From: Cassie Jones Date: Fri, 4 Oct 2024 20:03:24 -0700 Subject: [PATCH] Add some old drafts --- drafts/2020/logic-programming.md | 58 ++++++++++++++++++++++++++++++++ drafts/2021/damagegami.md | 42 +++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 drafts/2020/logic-programming.md create mode 100644 drafts/2021/damagegami.md diff --git a/drafts/2020/logic-programming.md b/drafts/2020/logic-programming.md new file mode 100644 index 0000000..fd55d68 --- /dev/null +++ b/drafts/2020/logic-programming.md @@ -0,0 +1,58 @@ +--- +title: "Logic Programming Is Also Pretty Easy?" +date: 2020-02-26 +draft: true +tags: +- unification +- logic programming +summary: "I've been hearing about MiniKanren and MicroKanren for a while, and I finally just decided to go and read the paper to see if I could understand it. Here's my understanding of it." +prev: posts/2020/syntatic-unification +--- + +Last time we implemented unification, with a few paths forward in mind. +One of those was logic programming. + +In a logic program, you write equations that describe what things are true, and then the logic program engine searches for a solution to those equations. +For certain types of problems, this can be a great way to implement things. +For instance, the Rust compiler is currently trying to [reimplement some of their type system this way][chalk] in order to make it simpler and support more features. +There are some full-featured logic programming languages like [Prolog][] that have a long history. +When someone talks about logic programming, they mention Prolog most of the time. +There are other smaller languages like [Datalog][] which is designed for queries and analysis, but it's still a large language, much more than we can implement. +We want something smaller. + +[chalk]: https://smallcultfollowing.com/babysteps/blog/2017/01/26/lowering-rust-traits-to-logic/ +[prolog]: https://en.wikipedia.org/wiki/Prolog +[datalog]: https://en.wikipedia.org/wiki/Datalog + +Luckily, we've got some options. +The [Kanrens][] are a family of small logic languages that are embedded in a host language, letting you write normal code and getting all the features of the host language included for free. +They were originally made for Scheme and ["The Reasoned Schemer"][reasoned-schemer], with the miniKanren language. +Later, microKanren was created with the goal "how simple can we make this?" +[The microKanren paper][] is very readable. +But if you don't want to go read a paper, I'm gonna explain it here. + +[kanrens]: http://minikanren.org/ +[reasoned schemer]: https://mitpress.mit.edu/books/reasoned-schemer-second-edition +[the microkanren paper]: http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf + +### What's In A Logic Program? + +Facts +Rules +-> +Goals +Solving + +### #goals + +How we'll represent goals in Python + +#### The `orr` Goal + +#### The `andd` Goal + +#### The `fresh` Goal + +### Writing Intersting Logic Programs + +### User Interface diff --git a/drafts/2021/damagegami.md b/drafts/2021/damagegami.md new file mode 100644 index 0000000..e737ae3 --- /dev/null +++ b/drafts/2021/damagegami.md @@ -0,0 +1,42 @@ +--- +title: damagegami +date: 2021-00-00 +draft: true +--- +I had an idea with Aaron, "what possible values of damage can you deal to someone in Apex Legends?" +Here's a table I guess. + +https://apexlegends.fandom.com/wiki/Weapon#Stats + + 1: Gibraltar's shield + 2 L-star (18) + 1 volt (15) = 51 damage (1 bleedthrough) + 2: Gibraltar's shield + 2 L-star (18) + 1 devotion (16) = 52 damage (2 bleedthrough) + 2: OR Charge rifle at ~200 meters + 3: Charge rifle (1 tick) + 4: Gibraltar's shield + 2 L-star (18) + 1 flatline (19) = 55 damage (5 bleedthrough, reduced to 4 by fortified) + 5: Gibraltar's sheild + 2 L-star (18) + 1 hemlock (20) = 56 damage (6 bleedthrough, reduced to 5 by fortified) + 6: Charge rifle (2 ticks) + 7: 1 EVA-8 pellet + 8: 1 EVA-8 pellet + amped wall + 9: 1 peacekeeper pellet + 10: 1 EVA-8 pellet + 1 charge rifle tick + 11: 1 mastiff pellet + 12: 1 RE-45 + 13: 1 Alternator (leg shot) + 14: 1 R-301 + 15: 1 Volt + 16: 1 Devotion + 17: 1 R-99 (headshot) + 18: 1 L-star + 19: 1 Flatline + 20: 1 Hemlock + 21: 1 Prowler (headshot) + 22: 2 R-99 + 23: 1 Volt (headshot) + 24: 1 Alternator (headshot) + 25: 1 R-301 (headshot) + 26: 1 Scout (legshot) + 27: 1 P2020 (headshot) + 28: 1 Rampage + 29: + 30: 1 Melee + 34: 1 Scout -- 2.47.0